dealpos 25.35.2 → 25.35.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/browser/{chunk-FY4JABYL.js → chunk-2XMIL3M5.js} +1 -1
  2. package/browser/{chunk-LKZE2HD4.js → chunk-32XPQS72.js} +1 -1
  3. package/browser/{chunk-ZYTLUHOS.js → chunk-3BF3LB6Z.js} +1 -1
  4. package/browser/{chunk-VMIXOKE7.js → chunk-3T3RRVKX.js} +1 -1
  5. package/browser/{chunk-BBRBME3A.js → chunk-3Z3TRQBS.js} +1 -1
  6. package/browser/{chunk-ETHIPTBJ.js → chunk-4E4L6WXO.js} +1 -1
  7. package/browser/{chunk-45Q3TR52.js → chunk-5LVF3GQO.js} +1 -1
  8. package/browser/{chunk-M2DBAY4P.js → chunk-6DJNKKNB.js} +1 -1
  9. package/browser/{chunk-LHGABVF6.js → chunk-7AAAKDTU.js} +2 -2
  10. package/browser/{chunk-LYOMQKFY.js → chunk-7BDVBLHM.js} +1 -1
  11. package/browser/{chunk-2BRCOLHG.js → chunk-7IVZ7O4B.js} +1 -1
  12. package/browser/{chunk-LFRQUM6J.js → chunk-7J6JNI44.js} +1 -1
  13. package/browser/{chunk-4DIUJNZF.js → chunk-AAVH5EBY.js} +1 -1
  14. package/browser/{chunk-FBTUV7TY.js → chunk-AK6EELSP.js} +1 -1
  15. package/browser/{chunk-SVW3DCFV.js → chunk-BGQQUPTZ.js} +1 -1
  16. package/browser/{chunk-A477JKU4.js → chunk-BN2DUB4S.js} +1 -1
  17. package/browser/{chunk-XGQGO4PE.js → chunk-BUFUGEKP.js} +1 -1
  18. package/browser/{chunk-U7VNF37P.js → chunk-BXFKD2CO.js} +1 -1
  19. package/browser/{chunk-ZCKT34V7.js → chunk-BZAN6DNV.js} +1 -1
  20. package/browser/{chunk-AYEQLVMX.js → chunk-CESIM7I2.js} +1 -1
  21. package/browser/{chunk-EXCJNRRJ.js → chunk-CUD4PHJT.js} +1 -1
  22. package/browser/{chunk-E5UK2WMM.js → chunk-DDSUKJHT.js} +1 -1
  23. package/browser/{chunk-M7KP6PSY.js → chunk-DHQUQTIV.js} +1 -1
  24. package/browser/{chunk-GK45LVUY.js → chunk-DKX7YVH4.js} +1 -1
  25. package/browser/{chunk-OZOAAIBM.js → chunk-DO6W6BG2.js} +1 -1
  26. package/browser/{chunk-73ESQDPI.js → chunk-DU2U47CB.js} +1 -1
  27. package/browser/{chunk-5IY3H7NG.js → chunk-E7SOAHON.js} +1 -1
  28. package/browser/{chunk-6CUC5ZVY.js → chunk-EIPWN4ZG.js} +1 -1
  29. package/browser/{chunk-J4SLL7XI.js → chunk-F3QKO3WX.js} +1 -1
  30. package/browser/{chunk-WDIJOVDQ.js → chunk-FQSQUAUB.js} +1 -1
  31. package/browser/{chunk-NT4HXAUQ.js → chunk-GIMMGWIY.js} +1 -1
  32. package/browser/chunk-GLXNXL3M.js +1 -0
  33. package/browser/chunk-GWY532ZF.js +3 -0
  34. package/browser/{chunk-2ULGMZHE.js → chunk-H24HNIUV.js} +1 -1
  35. package/browser/{chunk-6E4UKP3I.js → chunk-H5EACBML.js} +2 -2
  36. package/browser/chunk-H7DCK5WJ.js +1 -0
  37. package/browser/{chunk-RXY2UMNO.js → chunk-HJZUPJW2.js} +1 -1
  38. package/browser/{chunk-GFFJDDRS.js → chunk-HKACPPVL.js} +1 -1
  39. package/browser/{chunk-HV7GI3KE.js → chunk-HSQKKFE6.js} +1 -1
  40. package/browser/{chunk-66WXWMUG.js → chunk-IWQEXFGO.js} +1 -1
  41. package/browser/{chunk-XXGDZ22Y.js → chunk-JRMGNV6W.js} +1 -1
  42. package/browser/chunk-JUDTCQVV.js +1 -0
  43. package/browser/{chunk-W64M5WBH.js → chunk-K4YUTEMS.js} +1 -1
  44. package/browser/{chunk-3GB5DSK3.js → chunk-KHHM6IFR.js} +1 -1
  45. package/browser/{chunk-33JZH2UR.js → chunk-KM4YGIPJ.js} +1 -1
  46. package/browser/{chunk-CNY7II6H.js → chunk-KQLFNIFZ.js} +1 -1
  47. package/browser/{chunk-7NMXZ55P.js → chunk-LS4LCNAF.js} +2 -2
  48. package/browser/{chunk-SO3WWYN3.js → chunk-MERQX2AF.js} +1 -1
  49. package/browser/{chunk-4YPJAUSY.js → chunk-MLMSIZGP.js} +1 -1
  50. package/browser/{chunk-FOVCORMR.js → chunk-MUFGLBTW.js} +1 -1
  51. package/browser/{chunk-WDS6MTSX.js → chunk-MXRJZC7D.js} +2 -2
  52. package/browser/{chunk-V4OYKDE2.js → chunk-NHVQ6BHI.js} +1 -1
  53. package/browser/{chunk-LXZS75G2.js → chunk-NLWPMDWU.js} +1 -1
  54. package/browser/{chunk-WOBW4V44.js → chunk-NMGT5PYX.js} +1 -1
  55. package/browser/{chunk-CZTNOFUC.js → chunk-NQPOGM3H.js} +1 -1
  56. package/browser/{chunk-Q76KX5JJ.js → chunk-NY4SVPPU.js} +1 -1
  57. package/browser/{chunk-Q5YFG526.js → chunk-O3IGBF5Z.js} +1 -1
  58. package/browser/{chunk-F3ZJVCRK.js → chunk-OFNXPEBH.js} +1 -1
  59. package/browser/{chunk-P5KSSZK7.js → chunk-P4TUOMJ4.js} +1 -1
  60. package/browser/{chunk-7B7ON5E6.js → chunk-QZFGYG5J.js} +1 -1
  61. package/browser/{chunk-K76G23WC.js → chunk-RJSPJ6CG.js} +1 -1
  62. package/browser/{chunk-Z7WYC46Q.js → chunk-RYONOB6O.js} +1 -1
  63. package/browser/{chunk-VDKUDQZO.js → chunk-S7QH3NMD.js} +1 -1
  64. package/browser/{chunk-NPHAQCON.js → chunk-SJ7OFVH5.js} +1 -1
  65. package/browser/{chunk-5MGHIIE6.js → chunk-SKFIRYCU.js} +2 -2
  66. package/browser/{chunk-HNBLWEAJ.js → chunk-TYIDA4YO.js} +1 -1
  67. package/browser/{chunk-VJWRLXE4.js → chunk-W2TSDYEA.js} +1 -1
  68. package/browser/{chunk-4YAMWP7V.js → chunk-W7HVLC6V.js} +1 -1
  69. package/browser/{chunk-O7H6QE5A.js → chunk-XEKUUP6Y.js} +1 -1
  70. package/browser/{chunk-X4VB4DKS.js → chunk-YCPSIUQ3.js} +1 -1
  71. package/browser/{chunk-7VKHUEU6.js → chunk-YGUNDEOT.js} +1 -1
  72. package/browser/{chunk-LYGTJSME.js → chunk-ZFMK7BOT.js} +1 -1
  73. package/browser/index.html +2 -2
  74. package/browser/{main-WYOICQDK.js → main-XQZCWN5T.js} +2 -2
  75. package/package.json +1 -1
  76. package/browser/chunk-INDKSR3O.js +0 -3
  77. package/browser/chunk-LI3MYO4W.js +0 -1
  78. package/browser/chunk-PDHJSRKI.js +0 -1
  79. package/browser/chunk-R3IC3THI.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as ro}from"./chunk-Q76KX5JJ.js";import{b as oa,c as ra}from"./chunk-HRXM4W6Y.js";import{a as Kr}from"./chunk-TPXSXDZD.js";import{b as Yr,e as Xr,f as Zr,g as ea}from"./chunk-SJIEANJU.js";import{a as pa}from"./chunk-GSLPZSSX.js";import{A as Br,B as Gi,C as Jt,D as zi,E as Wr,F as Qr,G as Yi,H as Gr,I as zr,a as xr,b as dt,c as Or,d as Oe,e as V,f as B,g as Pr,h as me,i as Mr,j as Dr,k as ee,l as wr,m as kr,n as Pe,o as Tr,p as Ze,q as Me,r as $t,s as Bi,t as Fi,u as ji,v as Hi,w as oo,x as Ui,y as j,z as Lr}from"./chunk-V4OYKDE2.js";import"./chunk-NPJ272AZ.js";import"./chunk-UX2MPDGZ.js";import"./chunk-TK5H65DN.js";import"./chunk-6L6CIH5M.js";import{a as sa,b as ca}from"./chunk-CGTCYQPU.js";import{a as ia,b as na}from"./chunk-R5W6OHJL.js";import{a as Rr,b as Nr,c as Vr,d as qi}from"./chunk-QMPKHU2W.js";import{b as la}from"./chunk-3USDNSPA.js";import{a as Sr}from"./chunk-HBNFET4C.js";import"./chunk-3PXI2XBC.js";import{b as Fe}from"./chunk-THRGCK26.js";import"./chunk-2IT6TVBI.js";import{a as yr}from"./chunk-DYCGOJEI.js";import{a as Ti}from"./chunk-SRISQ4G6.js";import{a as aa,b as Zi}from"./chunk-JFAIF63Q.js";import{a as Fr,b as jr}from"./chunk-KVPIGIZJ.js";import{c as $i,d as Ji}from"./chunk-5VFKAJV6.js";import"./chunk-W2UCLTBY.js";import"./chunk-NJSJDYUI.js";import{a as cr}from"./chunk-UBUC3CPO.js";import{a as Rt}from"./chunk-OGUGTEB3.js";import"./chunk-UU5RJKWG.js";import{a as Qe,b as ut}from"./chunk-GE53XQ2Q.js";import"./chunk-7BU64MD2.js";import{a as ta}from"./chunk-P5PNY2PR.js";import{a as Xi}from"./chunk-7HI7DCIJ.js";import"./chunk-5JZJ4OL3.js";import"./chunk-SE7OFLAL.js";import"./chunk-NOLQHNIQ.js";import"./chunk-WLRXTHLM.js";import{a as Ir,b as Hr,c as Ur}from"./chunk-SZKR6UME.js";import{a as Li}from"./chunk-QLFKPTZA.js";import{a as Jr}from"./chunk-5VAXIJEW.js";import"./chunk-YOKPVEGO.js";import"./chunk-BYXBJQAS.js";import"./chunk-4L4E5MG3.js";import"./chunk-34GJS34C.js";import"./chunk-NHVOGEOO.js";import"./chunk-AYBLEFQB.js";import"./chunk-LCUJHXDF.js";import{d as br,e as vr}from"./chunk-3VKLFFAF.js";import"./chunk-NI6KAEXM.js";import"./chunk-3RK6DDJD.js";import"./chunk-L2EDFSBR.js";import"./chunk-BYXBJQAS.js";import{a as gi}from"./chunk-37ZQRASR.js";import{a as xe,c as Ai}from"./chunk-H2VTVYZY.js";import{a as no}from"./chunk-B5FODXLM.js";import"./chunk-6365PJN3.js";import{c as fi}from"./chunk-VOU4625O.js";import{a as Ei}from"./chunk-I4MJUIXL.js";import{a as Ni,b as Vi}from"./chunk-MUCQWTKH.js";import"./chunk-O7MCO2N7.js";import{a as io}from"./chunk-UZKYLAUE.js";import{a as Ki,b as qr,c as $r}from"./chunk-47MDCKEY.js";import{a as Er,b as Qi}from"./chunk-FIS6Q5OG.js";import{a as Ot,b as Wi}from"./chunk-33A5UPQJ.js";import"./chunk-GEWY5VWO.js";import"./chunk-TEFNN3TY.js";import"./chunk-GOQ3ZCDK.js";import{b as Mi,c as yt,d as xt,e as Wt}from"./chunk-XY7FDLSK.js";import"./chunk-JKYTSC2D.js";import{a as Ar}from"./chunk-TGAOY65D.js";import"./chunk-IVP3GL2V.js";import{b as Ri,c as rt}from"./chunk-HT35KHLT.js";import"./chunk-BYXBJQAS.js";import{d as wi,e as ki}from"./chunk-ZR4YNJBZ.js";import{a as pr}from"./chunk-XX6Z7QPA.js";import"./chunk-VQ7WKMGF.js";import{a as ir,b as nr,c as or}from"./chunk-YQCR57JN.js";import"./chunk-MHBOKOSN.js";import"./chunk-S6TMUVGC.js";import"./chunk-PPWHSAY6.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import{a as rr,d as ar,f as lr}from"./chunk-6ZOGADBZ.js";import{a as gt,b as mt}from"./chunk-7ENHJR7R.js";import{a as hr}from"./chunk-ETHIPTBJ.js";import{a as sr,b as mr}from"./chunk-M7KP6PSY.js";import"./chunk-AZT6QE56.js";import{a as Xo}from"./chunk-5UL73W4S.js";import{C as Cr,D as Xe,F as qt,G as It,u as U,v as W,w as Ae}from"./chunk-677WPFLK.js";import{b as se,c as Ye}from"./chunk-CIBQBSM6.js";import{G as _r,O as Qt,P as de,a as dr,b as ur,n as Di,v as fr,y as gr}from"./chunk-L2RZWAX3.js";import{a as Uo}from"./chunk-ZT4RBJMM.js";import"./chunk-GIKR6Y2K.js";import{e as ot}from"./chunk-VMY3JQDA.js";import{a as Yo,e as F,f as Ve,g as oe}from"./chunk-D35OBUDE.js";import{M as Zo,Z as er,_ as tr}from"./chunk-567HXZXC.js";import"./chunk-WEJYVCCX.js";import"./chunk-AAJJTF33.js";import{a as Be}from"./chunk-2FWFPV5I.js";import"./chunk-3PYW74LR.js";import{B as zo,D as Ce,E as Ke,a as Wo,b as bt,c as ie,d as Qo,e as ui,g as qo,h as G,j as $o,l as vt,m as Jo,o as ne,r as Go,s as St,y as jt}from"./chunk-P7HKWFZT.js";import{a as Ft,c as Ut}from"./chunk-HV7GI3KE.js";import{a as Ko}from"./chunk-LYOMQKFY.js";import{a as S,d as Ht}from"./chunk-AHCRE4GP.js";import"./chunk-4YAMWP7V.js";import{$a as s,$b as ye,Ab as to,Ac as x,Ba as Oo,Bc as pe,Cc as ze,Db as R,E as ce,Eb as si,Fa as He,Fc as K,Gb as ci,Hb as pi,I as li,Ia as Po,Ib as r,Ja as lt,Jb as a,Ka as Mo,Kb as h,Kc as Vo,Lb as I,M as yo,Ma as z,Mb as O,Md as jo,N as Vt,Nb as mi,Ob as v,Od as Ho,Qb as _,Qd as pt,Rb as c,Rd as Lt,Sc as Ao,Td as Bt,Ub as di,Va as xi,Vb as Eo,Vd as Z,Wa as it,Wc as H,Y as At,Yc as _e,Yd as Ne,Za as nt,Zb as ve,Zc as Q,_b as Se,aa as Te,ad as Lo,bc as Ro,bd as Pi,c as bo,cb as Do,cc as No,cd as Re,d as J,da as k,db as d,dc as $,e as Xn,ec as m,ed as We,fa as Ee,fc as T,gb as wo,gc as y,gd as X,hc as Ue,ia as xo,id as Bo,ja as Ge,jc as M,jd as te,k as vo,ka as Ct,kb as P,kc as D,lb as ht,lc as w,ma as L,mb as Ii,md as Fo,na as Y,o as Zn,ob as Oi,pc as st,qb as g,qc as ct,rc as E,sc as ge,t as tt,tc as Et,u as yi,ua as Io,ub as ko,va as u,vb as p,wa as f,wb as eo,xb as To,z as So,zb as be,zc as b}from"./chunk-DZT5XHBQ.js";import{j as ho}from"./chunk-7DCB7DB2.js";var en=class{ID;Code;Name;Title;Field;Address;ContactInfo;Logo;FooterLeft;FooterRight;FooterNote;PrintMode;PrintLX300;DeliveryNote;AppendQR;ItemRenderMode;CssClass;RemoveImage;DisplayName;DisplayNameCode};var Gt=class{ParkLabel;Note;NumberOfPerson;ID;Alias;Created;CustomerDisplay;Number;Duration};var tn=class n{constructor(t,e,i,o,l,C){this.dialogRef=t;this._orderProcessorService=e;this._posService=i;this.salesOrderService=o;this.parkService=l;this.data=C;this.initModalDialog(),this.initConfig(),this.parkLabel=C.ParkLabel,this.form.ParkLabel=C.ParkLabel,this.form.Note=o.Data.Order.Note}modalConfig=new U;labelPlaceholder;form=new Gt;parkLabel;initConfig(){let t=this._posService.Data.AppConfigJSON;this.labelPlaceholder=t.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkLabelPlaceholder}initModalDialog(){this.modalConfig.title=this.data.title,this.modalConfig.customWidth="600px"}onOk(){this.setParkTitle(),this.parkService.park(this.form).subscribe(t=>{this.dialogRef.close(!0)})}setParkTitle(){let t=this._orderProcessorService.Data.posState,e=this.salesOrderService.Data.Order.Number;t==5?this.salesOrderService.Data.SplitParkLabel=S.IsEmpty(this.parkLabel)?e:this.parkLabel:S.IsEmpty(this.parkLabel)?this.form.ParkLabel=e:this.form.ParkLabel=this.parkLabel}static \u0275fac=function(e){return new(e||n)(d(F),d(j),d(B),d(V),d(we),d(Ve))};static \u0275cmp=P({type:n,selectors:[["POS-modal-park-input"]],standalone:!1,decls:17,vars:3,consts:[[3,"onCancel","onOk","onClose","config"],[1,"ods-info-box"],[1,"fas","fa-info-circle",2,"font-size","1.2rem","margin-top","2px"],["href","https://ods.dealpos.app","target","_blank",2,"color","#0d6efd","font-weight","600","text-decoration","underline"],[1,"w-100","mt-4"],[1,"mb-3"],["type","text","required","","placeholder","E.g. Mr. John Doe","matTooltip","Same as Order Number when blank",1,"form-control","w-100","height-input",3,"ngModelChange","ngModel"],["placeholder","ex: Customer will return tommorow",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(r(0,"modal-material",0),_("onCancel",function(){return i.dialogRef.close()})("onOk",function(){return i.onOk()})("onClose",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1),h(3,"i",2),r(4,"div"),m(5," Use our "),r(6,"a",3),m(7," Order Display Fulfillment System "),a(),m(8," to view the Parked Orders from your warehouse area. "),a()(),r(9,"div",4)(10,"strong",5),m(11,"Label"),a(),r(12,"input",6),w("ngModelChange",function(l){return D(i.parkLabel,l)||(i.parkLabel=l),l}),a()(),r(13,"div",4)(14,"strong",5),m(15,"Note"),a(),r(16,"POS-tinymce-editor",7),w("ngModelChange",function(l){return D(i.form.Note,l)||(i.form.Note=l),l}),a()()()()),e&2&&(p("config",i.modalConfig),s(12),M("ngModel",i.parkLabel),s(4),M("ngModel",i.form.Note))},dependencies:[ie,G,jt,ne,W,se,Ot],styles:[".height-input[_ngcontent-%COMP%]{height:36px} ng-select.park-detail>div.ng-select-container{border-radius:0!important}.deposit[_ngcontent-%COMP%] .ng-select{width:auto!important}.ods-info-box[_ngcontent-%COMP%]{background-color:#e8f4fd;border-left:4px solid #0dcaf0;padding:16px 20px;border-radius:8px;font-family:Roboto Slab,sans-serif;color:#055160;display:flex;align-items:flex-start;gap:10px;font-size:14px;max-width:600px;margin:0 auto}"]})};var nn=class n{constructor(t){this._dialogRef=t;this.modalConfig=new U,this.modalConfig.title="Select Print Type",this.modalConfig.hideFooter=!0}modalConfig;onPrintOrder(){this._dialogRef.close("ORDER")}onPrintBill(){this._dialogRef.close("BILL")}static \u0275fac=function(e){return new(e||n)(d(F))};static \u0275cmp=P({type:n,selectors:[["POS-modal-print"]],standalone:!1,decls:17,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"d-flex"],[1,"btn","btn-gray","btn-lg","me-1",3,"click"],["src","//res.cloudinary.com/pos/image/upload/v1650423915/icons/order.png"],[1,"mt-1"],[1,"mt-0"],[1,"btn","btn-gray","btn-lg","ms-1",3,"click"],["src","//res.cloudinary.com/pos/image/upload/v1650423915/icons/bill.png",2,"width","23px"]],template:function(e,i){e&1&&(r(0,"modal-material",0),_("onCancel",function(){return i._dialogRef.close()})("onClose",function(){return i._dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),_("click",function(){return i.onPrintOrder()}),h(4,"img",3),r(5,"h4",4),m(6,"Order"),a(),r(7,"div",5),m(8,"For order for the kitchen"),a()(),r(9,"a",6),_("click",function(){return i.onPrintBill()}),h(10,"img",7),r(11,"h4",4),m(12,"Bill"),a(),r(13,"div",5),m(14,"To see amount of the bill"),a(),r(15,"div",5),m(16,"(Pre-settlement bill)"),a()()()()()),e&2&&p("config",i.modalConfig)},dependencies:[W],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}.btn[_ngcontent-%COMP%]{padding:8px 0;width:190px;margin-right:10px}.btn[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase}.btn[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{font-size:.75rem;font-style:italic;color:#868686;margin-top:10px}"]})};var Na=(n,t,e)=>({"unselect-card":n,"card-select":t,"card-available":e}),Va=n=>({"text-secondary":n}),Aa=(n,t)=>({"bg-danger-subtle text-inactive":n,"bg-success text-white":t}),La=(n,t)=>({"text-secondary":n,"text-success":t});function Ba(n,t){if(n&1&&h(0,"i",7),n&2){let e=c();be(e.icon()),p("ngClass",ge(3,La,e.isOccupied(),!e.isOccupied()))}}var on=class n{title=lt("Park Order");isOccupied=lt(!0);alias=lt("A1");icon=lt("fa-solid fa-star");selected=lt(!1);onEventSelect=Po({alias:"onSelect"});onSelect(){this.isOccupied()==!1&&this.onEventSelect.emit(this.title())}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=P({type:n,selectors:[["park-card"]],inputs:{title:[1,"title"],isOccupied:[1,"isOccupied"],alias:[1,"alias"],icon:[1,"icon"],selected:[1,"selected"]},outputs:{onEventSelect:"onSelect"},decls:9,vars:15,consts:[[1,"card","m-0","bg-light","border","border-2","bg-opacity-25","rounded",3,"click","ngClass"],[1,"card-body"],[1,"d-flex","align-items-center","justify-content-between","flex-column"],[1,"d-flex","align-items-center","gap-3"],[1,"fa-xl","text-success",3,"ngClass","class"],[3,"ngClass"],[1,"py-2","px-5","rounded-pill","mt-7","fw-normal","border",3,"ngClass"],[1,"fa-xl","text-success",3,"ngClass"]],template:function(e,i){e&1&&(r(0,"div",0),_("click",function(){return i.onSelect()}),r(1,"div",1)(2,"div",2)(3,"div",3),g(4,Ba,1,6,"i",4),r(5,"h4",5),m(6),a()(),r(7,"div",6),m(8),a()()()()),e&2&&(p("ngClass",Et(6,Na,!i.selected(),i.selected()&&!i.isOccupied(),!i.isOccupied())),s(4),R(i.icon()?4:-1),s(),p("ngClass",E(10,Va,i.isOccupied())),s(),y(" ",i.title()," "),s(),p("ngClass",ge(12,Aa,i.isOccupied(),!i.isOccupied())),s(),y(" ",i.isOccupied()?"Occupied":"Available"," "))},dependencies:[te,H],styles:[".text-inactive[_ngcontent-%COMP%]{color:#b98181}.card-available[_ngcontent-%COMP%]{cursor:pointer;transition:all .3s ease;transform:translateY(0)}.card-available[_ngcontent-%COMP%]:hover{transform:translateY(-6px);box-shadow:0 2px 4px #00000026,0 0 2px 1px #c0f4cb;border-color:#81c784!important;background-color:#fff!important}.card-select[_ngcontent-%COMP%]{background-color:#ffffe1!important;border-color:#89b03e!important}.unselect-card[_ngcontent-%COMP%]{border-color:transparent!important}"]})};var Fa=n=>({"mat-tab-group-height":n});function ja(n,t){if(n&1){let e=v();r(0,"div",2)(1,"div",6)(2,"span",7),h(3,"i",8),a(),r(4,"input",9),w("ngModelChange",function(o){u(e);let l=c();return D(l.filter,o)||(l.filter=o),f(o)}),a()()()}if(n&2){let e=c();s(4),M("ngModel",e.filter)}}function Ha(n,t){if(n&1&&(r(0,"h5",14),h(1,"i"),r(2,"span"),m(3),a()()),n&2){let e=c().$implicit;s(),be(e.Icon),s(2),T(e.Name)}}function Ua(n,t){if(n&1){let e=v();r(0,"div",13)(1,"park-card",15),_("onSelect",function(){let o=u(e).$implicit,l=c(2);return f(l.onSelect(o))}),a()()}if(n&2){let e,i=t.$implicit,o=c().$implicit,l=c();s(),p("title",l.replaceWithAlias()&&i.Alias?i.Alias:i.Name)("alias",i.Alias)("isOccupied",i.IsOccupied)("icon",o.Icon)("selected",((e=l.parkOptionSelected())==null?null:e.Name)===i.Name)}}function Wa(n,t){if(n&1&&(r(0,"mat-tab",4),g(1,Ha,4,3,"ng-template",10),r(2,"div",11)(3,"div",12),ci(4,Ua,2,5,"div",13,si),b(6,"Filter"),a()()()),n&2){let e=t.$implicit,i=c();p("label",e.Name),s(4),pi(ze(6,1,e.Options,i.filter(),"Name"))}}function Qa(n,t){if(n&1){let e=v();r(0,"div",5)(1,"POS-tinymce-editor",16),w("ngModelChange",function(o){u(e);let l=c();return D(l.parkNote,o)||(l.parkNote=o),f(o)}),a()()}if(n&2){let e=c();s(),M("ngModel",e.parkNote)}}var Kt=class n{constructor(t){this.data=t;this.parkLayout.set(t.parkLayoutPack),this.replaceWithAlias.set(t.replaceWithAlias),this.initModalConfig(),this.showInputNote.set(this.posService.Data?.AppConfigJSON?.ApplicationParkAndRetrieve?.NumberOfPerson)}dialog=Y(oe);dialogRef=Y(F);orderProcessorService=Y(j);salesOrderService=Y(V);posService=Y(B);modalConfig=new U;filter=z("");parkLayout=z(null);parkOptionSelected=z(null);replaceWithAlias=z(!1);showInputNote=z(!1);parkNote=z("");initModalConfig(){this.modalConfig.title=this.data.title||"Park Order",this.modalConfig.customWidth="700px",this.modalConfig.bodyScrollable=!0,this.modalConfig.okText=" Park "}onSelect(t){this.parkOptionSelected.set(t)}onOk(){this.showInputNote()&&(this.parkOptionSelected().Note=this.parkNote()),this.dialogRef.close(this.parkOptionSelected())}onCancel(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||n)(d(Ve))};static \u0275cmp=P({type:n,selectors:[["app-modal-park"]],decls:8,vars:6,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container",2,"max-height","395px","min-height","395px"],[1,"search-container"],["mat-stretch-tabs","false",1,"mt-2",3,"ngClass"],[3,"label"],[1,"mt-4"],[1,"input-group","w-100"],[1,"input-group-text","txtFilter","rounded-start-1"],["aria-hidden","true",1,"fa","fa-magnifying-glass"],["type","text","placeholder","Search by number or note","aria-label","Search",1,"txtFilter","form-control","border-start-0","rounded","rounded-start-0",3,"ngModelChange","ngModel"],["mat-tab-label",""],[1,"container","mt-5"],[1,"row"],[1,"col-3","mb-4","px-2"],[1,"d-flex","align-items-center","gap-3"],[3,"onSelect","title","alias","isOccupied","icon","selected"],["height","180px","placeholder","Input the park note (E.g. this is for Mr. John)",3,"ngModelChange","ngModel"]],template:function(e,i){if(e&1&&(r(0,"modal-material",0),_("keydown.F2",function(){return i.onOk()})("onOk",function(){return i.onOk()})("onCancel",function(){return i.onCancel()})("onClose",function(){return i.onCancel()}),r(1,"content")(2,"div",1),g(3,ja,5,1,"div",2),r(4,"mat-tab-group",3),ci(5,Wa,7,5,"mat-tab",4,si),a(),g(7,Qa,2,1,"div",5),a()()()),e&2){let o,l,C;p("config",i.modalConfig),s(3),R(((o=i.parkLayout().Layout)==null?null:o.length)>0?3:-1),s(),p("ngClass",E(4,Fa,i.showInputNote()&&((l=i.parkOptionSelected())==null?null:l.Name))),s(),pi(i.parkLayout().Layout),s(2),R(i.showInputNote()&&((C=i.parkOptionSelected())!=null&&C.Name)?7:-1)}},dependencies:[te,H,Ae,W,on,Qt,fr,Ce,ie,G,ne,Wt,Mi,yt,xt,Wi,Ot],styles:["[_nghost-%COMP%] .mat-mdc-tab-group[_ngcontent-%COMP%]{--mdc-tab-indicator-active-indicator-color: #89b03e;--mat-tab-header-focus-indicator-color: #89b03e;--mat-tab-header-focus-label-text-color: var(--bs-body-color);--mat-tab-header-active-label-text-color: var(--bs-body-color);--mat-tab-header-active-focus-label-text-color: var(--bs-body-color);--mat-tab-header-active-hover-label-text-color: var(--bs-body-color);--mat-tab-header-active-focus-indicator-color: #89b03e;--mat-tab-header-active-hover-indicator-color: #89b03e}[_nghost-%COMP%] .mat-mdc-tab-header{border-bottom:1px solid var(--bs-border-color)}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%]{transition:all .3s ease}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{position:relative;transition:all .3s ease;height:2.3rem}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e4d,0 0 8px 4px #89b03e33;border-radius:4px}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]{transition:all .3s ease;border-left:none!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]:focus{box-shadow:none!important;border-color:#ced4da!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .input-group-text[_ngcontent-%COMP%]{transition:all .3s ease;background-color:#fff;border-right:none!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .input-group-text[_ngcontent-%COMP%], [_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .input-group-text[_ngcontent-%COMP%]{background-color:#89b03e1a;border-color:#84cc16!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .fa-magnifying-glass[_ngcontent-%COMP%]{transition:all .3s ease}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .fa-magnifying-glass[_ngcontent-%COMP%], [_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .fa-magnifying-glass[_ngcontent-%COMP%]{color:#84cc16!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e66,0 0 12px 6px #89b03e40!important}[_nghost-%COMP%] .mat-tab-group-height[_ngcontent-%COMP%]{height:165px}"]})};var an=class n{constructor(t,e,i,o,l,C,N,re,ke){this.dialogRef=t;this.parkOrderRetrieve=e;this._orderDataService=i;this._posHttpResponseService=o;this._orderProcessorService=l;this._orderHttpService=C;this._dialog=N;this._outletRegisterService=re;this.parkService=ke;this.salesOrderData=this._orderDataService.Data,this.appConfig=this._posHttpResponseService.Data.AppConfigJSON,this.parkLayoutPack=this._outletRegisterService.Data.ParkLayoutPack}modalConfig=new U;salesOrderData;appConfig;parkLayoutPack;ngOnInit(){this.modalConfig.title="Re-Park Order?",this.modalConfig.hideFooter=!0}onRepark(){this.parkService.park(this.parkOrderRetrieve).subscribe(t=>{this.dialogRef.close()})}onMove(){this.dialogRef.close(),this.showParkSelectModal()}showParkSelectModal(){this._orderHttpService.getVacant(this.salesOrderData.Order.EntityID).subscribe(t=>{this._dialog.open(Kt,{data:{title:this.title,parkLayoutPack:this.parkLayoutPack,replaceWithAlias:this.appConfig.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias}})})}get title(){return this._orderProcessorService.Data.posState==5?"Split Order":this.appConfig.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkDialogTitle}static \u0275fac=function(e){return new(e||n)(d(F),d(Ve),d(V),d(B),d(j),d(Oe),d(oe),d(ee),d(we))};static \u0275cmp=P({type:n,selectors:[["POS-modal-repark"]],standalone:!1,decls:13,vars:2,consts:[[3,"onClose","onCancel","title","config"],[1,"d-flex"],[1,"btn","btn-gray","btn-lg",3,"click"]],template:function(e,i){e&1&&(r(0,"modal-material",0),_("onClose",function(){return i.dialogRef.close()})("onCancel",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),_("click",function(){return i.onRepark()}),r(4,"h4"),m(5,"Re-Park"),a(),r(6,"span"),m(7,"Store order to same location"),a()(),r(8,"a",2),_("click",function(){return i.onMove()}),r(9,"h4"),m(10,"Move"),a(),r(11,"span"),m(12,"Shift order to Different location"),a()()()()()),e&2&&p("title","Re-Park Order?")("config",i.modalConfig)},dependencies:[W],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}.btn[_ngcontent-%COMP%]{padding:25px 0;width:190px;margin-right:10px}.btn[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase}.btn[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.75rem;font-style:italic;color:#868686;margin-top:10px}"]})};var Yt=class{Name;Alias;IsOccupied;Note};var ln=class{_point;get point(){return this._point}set point(t){this._point=t}_pricebookID;get pricebookID(){return this._pricebookID}set pricebookID(t){this._pricebookID=t}_discountRate;get discountRate(){return this._discountRate}set discountRate(t){this._discountRate=t}_groups;get groups(){return this._groups}set groups(t){this._groups=t}_salesID;get salesID(){return this._salesID}set salesID(t){this._salesID=t}_dueDays;get dueDays(){return this._dueDays}set dueDays(t){this._dueDays=t}_expiryDate;get expiryDate(){return this._expiryDate}set expiryDate(t){this._expiryDate=t}_debt;get debt(){return this._debt}set debt(t){this._debt=t}_expirtedString;get expirtedString(){return this._expirtedString}set expirtedString(t){this._expirtedString=t}_loyaltyDisabled;get loyaltyDisabled(){return this._loyaltyDisabled}set loyaltyDisabled(t){this._loyaltyDisabled=t}_taxTypeID;get taxTypeID(){return this._taxTypeID}set taxTypeID(t){this._taxTypeID=t}_entityID;get entityID(){return this._entityID}set entityID(t){this._entityID=t}_mobile;get mobile(){return this._mobile}set mobile(t){this._mobile=t}_email;get email(){return this._email}set email(t){this._email=t}_dueMonths;get dueMonths(){return this._dueMonths}set dueMonths(t){this._dueMonths=t}_memberIdentification;get memberIdentification(){return this._memberIdentification}set memberIdentification(t){this._memberIdentification=t}};var _i=class{OutletName;Status;AmountSummary;Coupon;Creator;CurrencySymbol;Customer;Date;Delivery;ExtraNote;FinalAmount;InvoiceNote;Items;LoyaltyPoint;Payments;PrintDate;RegisterCode;SalesOrderItemCommission;Shipping;Title;TypeName;PaymentState;ToP;Due;InvoiceID;Gopay;Number;Created;SalesName;ParkLabel;HeaderTitle;QRContent;Retur;AfterSell;constructor(){this.OutletName="",this.Status=1,this.AmountSummary=[],this.Coupon="",this.Creator="",this.CurrencySymbol="",this.Customer=new ln,this.Date="",this.Delivery={Number:""},this.ExtraNote="",this.FinalAmount=0,this.InvoiceNote="",this.Items=[],this.LoyaltyPoint="",this.Payments=[],this.PrintDate="",this.RegisterCode="",this.SalesOrderItemCommission={SalesName:""},this.Shipping=new fi,this.Title="",this.TypeName="",this.PaymentState=0,this.InvoiceID="",this.Number="",this.Created="",this.AfterSell=!0}};var Xt=class{LayoutPack;constructor(t){this.LayoutPack=t,this.GenerateLayoutOption()}GenerateLayoutOption(){this.LayoutPack!=null&&this.LayoutPack.Layout&&this.LayoutPack.Layout.forEach(t=>{t.Options=[];for(let e=1;e<=t.Size;e++){let i=new Yt;i.Name=t.Name+e,i.Alias=this.GetAlias(i.Name),t.Options.push(i)}})}GetAlias(t){if(this.LayoutPack!=null&&this.LayoutPack.Alias){let e=this.LayoutPack.Alias.filter(i=>i.Name==t);return e.length>0?e[0].Alias:t}return""}};var sn=class{ExtraNote;Title;Customer;SalesName;InvoiceNote;Date;Items;AmountSummary;Creator;NumberOfPerson;CurrencySymbol;constructor(){this.ExtraNote="",this.Title="",this.Customer="",this.SalesName="",this.InvoiceNote="",this.Date="",this.Items=[],this.AmountSummary=[],this.Creator="",this.NumberOfPerson=0,this.CurrencySymbol="Rp"}};var cn=class{AmountSummary;Contact;ContactDisplay;CurrencySymbol;FinalAmount;HeaderTitle;Invoice;IsPrice;Items;LoyaltyPoint;Order;Payments;PriceVisible;PrintPerson;PrintTime;SalesName;Shipping;TotalInWord};var Mt=class n{constructor(t,e,i,o,l,C,N,re){this._posService=t;this._orderDataService=e;this._cashierCalculatorService=i;this._outletService=o;this._OrderHttpService=l;this._receiptCalculatorService=C;this._orderProcessorService=N;this._customerHttpService=re;this.subscribeToObservableChanges()}posData;completeData;park=new Xt(null);outletInfo=new Ai;datePipe=new We("en-US");ParkTemp=Array();CartItems=[];get posStorage(){return this._posService.Data}get AppConfigJSON(){return this._posService.Data.AppConfigJSON}subscribeToObservableChanges(){this._orderDataService.Data$.subscribe(t=>{this.posData=t}),this._OrderHttpService.Data$.subscribe(t=>{this.completeData=t}),this._outletService.Data$.subscribe(t=>{this.outletInfo=t}),this._orderProcessorService.Data$.subscribe(t=>{this.ParkTemp=t.parkTemporaryItem})}generateReceiptMini(){let t=new _i;t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.OutletName=this.outletInfo.EntityName,t.ExtraNote=this.getParkLabel(),t.Customer=this.getSubmitedCustomer(),t.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.SalesOrderItemCommission={SalesName:this._outletService.getSalesname(this.posData.Order.SalesID)},t.Number=this.completeData?.InvoiceNumber,t.FinalAmount=this.completeData?.Final,t.InvoiceNote=this.posData.Order.Note,t.RegisterCode=this.outletInfo.RegisterCode==null?"":this.outletInfo.RegisterCode,t.QRContent=this.generateQrContent(),t.InvoiceID=this.completeData?.ObjectID,t.Retur=S.IsNotEmpty(this.posData?.Invoice?.ReferenceInvoiceID),t.Date=this.getSubmitedOrderDate(),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoiceCreatedTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy")),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.OrderTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm:ss")),this.posData.CartItems.forEach(i=>{i.SalesID&&(i.SalesName=this._outletService.getSalesname(i.SalesID))}),t.Items=this.posData.CartItems,t.Customer!=null&&t.Customer.Display!=null&&t.Customer.Display!=null&&t.Customer.Display!=null&&(t.Customer={ID:this.posData.Order.CustomerID,Display:this.posData.ContactName,Email:t.Customer.Email,CityName:null,Address:t.Customer.Address,Code:t.Customer.Code,Name:t.Customer.Name,Phone:t.Customer.Phone,Mobile:t.Customer.Mobile,NationalIDNumber:t.Customer.NationalIDNumber,Title:t.Customer.Title}),t.Delivery={Number:this.posData.Order.Number};let e=S.FilterByID(this.posStorage.PoTypes,this.posData.Order.TypeID);if(e!==null&&(t.TypeName=e.Name),t.Shipping=this.generateShippingData(),this.AppConfigJSON.PrintConfigInvoice.ItemsTable.ItemWithoutPriceVisible||(t.Items=t.Items.filter(i=>i.Price!=0)),t.Coupon=this.posData.Order.PromotionCoupon,t.LoyaltyPoint=this.completeData?this.completeData.LoyaltyPoint:"",t.FinalAmount=this._cashierCalculatorService.Data,t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.PaymentState=this.getPaymentState(),t.Payments=this.posData.Payments,t.Payments.forEach(i=>{i.MethodName=this.findPaymentName(i.MethodID)}),t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t.Creator=this.completeData?.Creator?this.completeData?.Creator:this.posStorage?.UserName,this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoicePaymentTermsVisible&&this.posData.Payments.length==0){let i=this.posData.Invoice.Due?new Date(this.posData.Invoice.Due):null,o=new Date(this.posData.Order.Date);o.setHours(0,0,0,0),t.ToP=this.generateTop(o,i),this.posData.Invoice.Due!==void 0&&(t.Due=this.datePipe.transform(new Date(this.posData.Invoice.Due),"dd MMMM yyyy"))}return t}generateQrContent(){let t="";if(this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.TransformTo==3){let i=this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.Content,o=this.posData?.Order?.Number,l=this.completeData.ObjectID,C=window?.location?.host;switch(i){case 2:t=l;break;case 1:t=o;break;case 3:t=`receipt.dealpos.app?Data=${btoa(`${l}_${C}`)}`;break}}return t}generateShippingData(){return{City:this.posData.Shipping!==null?this.posData.Shipping.City:null,Description:this.posData.Shipping!==null?this.posData.Shipping.Address:null,ID:null,Phone:this.posData.Shipping!==null?this.posData.Shipping.Phone:null,Recipient:this.posData.Shipping!==null?this.posData.Shipping.Name:null,SalesOrderID:null,Sender:null,SenderAddress:null,SenderCity:null,SenderPhone:null,Street:null}}generateParkReceipt(t=!0,e=!1){let i=new sn;if(i.ExtraNote=S.StringFormat("{0} #{1}",this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.NumberPrefix,this.GetSubmittedNumber()),i.Title=this.getParkLabel(),i.Customer=this.getSubmitedCustomer(),i.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),i.InvoiceNote=this.posData.Order.Note,i.Date=this.getSubmitedOrderDate(),i.CurrencySymbol=this._cashierCalculatorService.currencySymbol,this.getItemsParkReceipt(t,e),i.Items=this.CartItems,i.Creator=this.posStorage.UserName,i.NumberOfPerson=this.posData.Order.NumberOfPerson,this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.AmountVisible){let o=JSON.parse(JSON.stringify(this._receiptCalculatorService.generateAmountSummary()));i.AmountSummary=o}return i}getItemsParkReceipt(t,e){let i=rt(Fe,this.posData.CartItems);if(e){let o=this.posData.CartItems.filter(l=>S.IsNotEmpty(l.SplitQuantity)&&l.SplitQuantity>0);this.CartItems=o.map(l=>(l.Quantity=l.SplitQuantity,l))}else if(t&&this.AppConfigJSON.ApplicationParkAndRetrieve.PrintBehaviour.PrintAdditionalItemsOnlyOnRePark)if(this.CartItems=Array(),this.ParkTemp.length>0)for(let o of i){let l=this.ParkTemp.find(C=>C.ID==o.ID);l==null?this.CartItems.push(o):o.Quantity!=l.Quantity&&(o.Quantity=o.Quantity-l.Quantity,this.CartItems.push(o))}else this.CartItems=i;else this.CartItems=i}generateBillInvoice(){let t=new cn;return t.ContactDisplay=this.posData.ContactName,t.Invoice=this.posData.Invoice,t.Order=this.posData.Order,t.Payments=this.posData.Payments,t.Shipping=this.posData.Shipping,t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.FinalAmount=this._cashierCalculatorService.Data,t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t.Contact=this.getSubmitedCustomer(),t.Items=this.getItemsBillInvoice(),t.PrintTime=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm"),t.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.Invoice.Number=`#${this.posData.Order.Number}`,t.Invoice.Date=new Date,t.Invoice.PaymentStateID=1,t.Invoice.Note=this.posData.Order.Note,t.PrintPerson="",t.IsPrice=!0,t.PriceVisible=!0,t}getItemsBillInvoice(){return this.posData.CartItems.map(e=>({Name:e.Variant.Name,Quantity:e.Quantity,Code:e.Variant.Code,UnitPrice:e.Price,Discount:e.Discount,UOMName:e.Variant.UOMName,Total:e.Total,Note:e.Note}))}generateBillReceipt(){let t=new _i;t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.ParkLabel=this.posData.Order.ParkLabel,t.OutletName=this.outletInfo.EntityName,t.ExtraNote=this.getParkLabel(),t.Customer=this._customerHttpService.Data,t.SalesOrderItemCommission.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.Number=this.posData.Order.Number,t.FinalAmount=this._cashierCalculatorService.Data,t.InvoiceNote=this.posData.Order.Note,t.Date=this.datePipe.transform(this.posData.Order.Date,"dd MMM yyyy"),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoiceCreatedTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy")),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.OrderTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm:ss")),t.Items=this.posData.CartItems,t.Customer.ID=this.posData.Order.CustomerID,t.Customer.Name=this.posData.ContactName,t.Customer.Display=this.posData.ContactName,t.Customer.Mobile&&t.Customer.Mobile.length==1&&(t.Customer.Mobile=null),t.Delivery={Number:this.posData.Order.Number};let e=S.FilterByID(this.posStorage.PoTypes,this.posData.Order.TypeID);return e!==null&&(t.TypeName=e.Name),t.Shipping=this.generateShippingData(),this.AppConfigJSON.PrintConfigInvoice.ItemsTable.ItemWithoutPriceVisible||(t.Items=t.Items.filter(i=>i.Price!=0)),t.Coupon=this.posData.Order.PromotionCoupon,t.PaymentState=this.getPaymentState(),t.Payments=this.posData.Payments,t.Payments=t.Payments.map(i=>(i.MethodName=this.findPaymentName(i.MethodID),i)),t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t}getPaymentState(){let t=this.AppConfigJSON?.ModuleSell?.ToleranceAmount,e=this.posData.Payments,i=this.posData.TotalPaidAmount,o=this._cashierCalculatorService.Data,l=1;e?.length>0&&i<o&&(l=2);let C=i-o;return(Math.abs(C)<=t||C>=0)&&(l=3),l}generateTop(t,e){let i=new Date(e),o=new Date(t),l=i.getTime()-o.getTime();return Math.floor(l/(1e3*3600*24))}getSubmitedOrderDate(){let t=this.posData.Order?.Date,e=this.AppConfigJSON.PrintConfigInvoice?.DocumentVisibility?.OrderTimeVisible,i="",o=new Date;if(e){let l=new Date(t);l.setHours(o.getHours()),l.setMinutes(o.getMinutes()),i=this.datePipe.transform(l,"dd MMM yyyy HH:mm")}else i=this.datePipe.transform(t,"dd MMM yyyy");return i}getSubmitedCustomer(){return S.IsEmpty(this.completeData)?{}:this.completeData.Contact}getParkLabel(){let t=this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.LabelPrefix,e=this.AppConfigJSON.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias,i=this.posData.Order.ParkLabel;if(S.IsNotEmpty(this.posData.SplitParkLabel)&&(i=this.posData.SplitParkLabel),e&&S.IsNotEmpty(i)){let o=this.park.GetAlias(i);i=o||i}return i?S.IsEmpty(t)?i:S.StringFormat("{0} # {1}",t,i):""}GetSubmittedNumber(){return S.IsNotEmpty(this.completeData)?this.completeData.InvoiceNumber:this.posData.Invoice.Number?this.posData.Invoice.Number:this.posData.Order.Number}generateCartItemSummary(){let t=[];for(let e of this.posData.CartItems)t.push(new Fi(e.Total,this._cashierCalculatorService.currencySymbol,e.Variant.Name,1));return t}generatePaymentSummary(){let t=[],e;for(let o=0;o<this.posData.Payments.length;o++){let l="Payment"+(o+1);this.AppConfigJSON.PrintConfigInvoice.Footer.PaymentMethodVisible&&(l=this.findPaymentName(Number(this.posData.Payments[o].MethodID))),e=new Fi(this.posData.Payments[o].PaidAmount,this._cashierCalculatorService.currencySymbol,l,1),t.push(e)}let i=this.generateChangeSummary();return i!==null&&t.push(i),t}generateChangeSummary(){let t=this._cashierCalculatorService.currencySymbol,e=this._cashierCalculatorService.Data,i=this.posData.TotalPaidAmount,o=0,l=null;return o=i-e,o>0&&(l=new Fi(o,t,"Change",1)),l}findPaymentName(t){return this._outletService.Data.Payments.find(e=>e.ID==t).Name}printWindow(){return ho(this,null,function*(){return new Promise(t=>{setTimeout(()=>{window.print(),t()},500)})})}static \u0275fac=function(e){return new(e||n)(L(B),L(V),L(Pe),L(ee),L(Oe),L(ji),L(j),L(ut))};static \u0275prov=Ge({token:n,factory:n.\u0275fac,providedIn:"root"})};var we=class n{constructor(t,e,i,o,l,C,N,re,ke,$e){this.httpService=t;this.receiptService=e;this.orderProcessorService=i;this.pageInitialService=o;this.salesOrderService=l;this.toastrService=C;this.promotionEventService=N;this.outletService=re;this.orderHttpService=ke;this.dialog=$e;this._onPrint=new J,this.onPrint$=this._onPrint.asObservable(),this.subscribeToObservable()}_onPrint;onPrint$;parkOrderRetrieve;subscribeToObservable(){this.orderProcessorService.Data$.subscribe(t=>{(t.posState==3||t.posState==5)&&this.emitParkReceipt(!0,t.posState==5)})}getParkedOrder(t,e){return this.httpService.get(de.GetPark,[{key:"EntityID",value:t},{key:"RegisterID",value:e}])}removeOrder(t,e){let i={OrderID:t};return e?this.httpService.post(de.VoidPark,i):this.httpService.post(de.RemovePark,i)}mergePark(t){return this.httpService.post(de.MergePark,t)}getOutstanding(t){let e={EntityID:t};return this.httpService.post(de.GetOutStanding,e)}splitOrder(t){return this.httpService.post(de.SplitOrder,t)}park(t){let e=rt(dt,this.salesOrderService.Data);if(this.promotionEventService.selectedPromotion){this.clearPromotionAppliedInPark();return}e.Action.DeliveryEntityID=S.GuidEmpty,e.Action.Type=1,t.ParkLabel!=null&&(e.Order.ParkLabel=t.ParkLabel),e.Order.Note=t.Note,e.Order.InvoicedStateID=1,S.IsNotEmpty(t.ID)&&(e.Order.ID=t.ID),this.salesOrderService.pushNewValue(e);let i=this.orderHttpService.generatePOSDataForSubmission(e);return this.httpService.post(de.ParkOrder,i).pipe(Ee(o=>{this.orderProcessorService.updatePosState(3,o),this.orderProcessorService.createNewTransactionInSameOutletRegister()}))}clearPromotionAppliedInPark(){this.dialog.open(wr,{id:"modal-promotion-confirm",data:{message:`
1
+ import{a as ro}from"./chunk-NY4SVPPU.js";import{b as oa,c as ra}from"./chunk-HRXM4W6Y.js";import{a as Kr}from"./chunk-TPXSXDZD.js";import{b as Yr,e as Xr,f as Zr,g as ea}from"./chunk-SJIEANJU.js";import{a as pa}from"./chunk-GSLPZSSX.js";import{A as Br,B as Gi,C as Jt,D as zi,E as Wr,F as Qr,G as Yi,H as Gr,I as zr,a as xr,b as dt,c as Or,d as Oe,e as V,f as B,g as Pr,h as me,i as Mr,j as Dr,k as ee,l as wr,m as kr,n as Pe,o as Tr,p as Ze,q as Me,r as $t,s as Bi,t as Fi,u as ji,v as Hi,w as oo,x as Ui,y as j,z as Lr}from"./chunk-NHVQ6BHI.js";import"./chunk-NPJ272AZ.js";import"./chunk-UX2MPDGZ.js";import"./chunk-TK5H65DN.js";import"./chunk-6L6CIH5M.js";import{a as sa,b as ca}from"./chunk-CGTCYQPU.js";import{a as ia,b as na}from"./chunk-R5W6OHJL.js";import{a as Rr,b as Nr,c as Vr,d as qi}from"./chunk-QMPKHU2W.js";import{b as la}from"./chunk-3USDNSPA.js";import{a as Sr}from"./chunk-HBNFET4C.js";import"./chunk-3PXI2XBC.js";import{b as Fe}from"./chunk-THRGCK26.js";import"./chunk-2IT6TVBI.js";import{a as yr}from"./chunk-DYCGOJEI.js";import{a as Ti}from"./chunk-SRISQ4G6.js";import{a as aa,b as Zi}from"./chunk-JFAIF63Q.js";import{a as Fr,b as jr}from"./chunk-KVPIGIZJ.js";import{c as $i,d as Ji}from"./chunk-5VFKAJV6.js";import"./chunk-W2UCLTBY.js";import"./chunk-NJSJDYUI.js";import{a as cr}from"./chunk-UBUC3CPO.js";import{a as Rt}from"./chunk-OGUGTEB3.js";import"./chunk-UU5RJKWG.js";import{a as Qe,b as ut}from"./chunk-GE53XQ2Q.js";import"./chunk-7BU64MD2.js";import{a as ta}from"./chunk-P5PNY2PR.js";import{a as Xi}from"./chunk-7HI7DCIJ.js";import"./chunk-5JZJ4OL3.js";import"./chunk-SE7OFLAL.js";import"./chunk-NOLQHNIQ.js";import"./chunk-WLRXTHLM.js";import{a as Ir,b as Hr,c as Ur}from"./chunk-SZKR6UME.js";import{a as Li}from"./chunk-QLFKPTZA.js";import{a as Jr}from"./chunk-5VAXIJEW.js";import"./chunk-YOKPVEGO.js";import"./chunk-BYXBJQAS.js";import"./chunk-4L4E5MG3.js";import"./chunk-34GJS34C.js";import"./chunk-NHVOGEOO.js";import"./chunk-AYBLEFQB.js";import"./chunk-LCUJHXDF.js";import{d as br,e as vr}from"./chunk-3VKLFFAF.js";import"./chunk-NI6KAEXM.js";import"./chunk-3RK6DDJD.js";import"./chunk-L2EDFSBR.js";import"./chunk-BYXBJQAS.js";import{a as gi}from"./chunk-37ZQRASR.js";import{a as xe,c as Ai}from"./chunk-H2VTVYZY.js";import{a as no}from"./chunk-B5FODXLM.js";import"./chunk-6365PJN3.js";import{c as fi}from"./chunk-VOU4625O.js";import{a as Ei}from"./chunk-I4MJUIXL.js";import{a as Ni,b as Vi}from"./chunk-MUCQWTKH.js";import"./chunk-O7MCO2N7.js";import{a as io}from"./chunk-UZKYLAUE.js";import{a as Ki,b as qr,c as $r}from"./chunk-47MDCKEY.js";import{a as Er,b as Qi}from"./chunk-FIS6Q5OG.js";import{a as Ot,b as Wi}from"./chunk-33A5UPQJ.js";import"./chunk-GEWY5VWO.js";import"./chunk-TEFNN3TY.js";import"./chunk-GOQ3ZCDK.js";import{b as Mi,c as yt,d as xt,e as Wt}from"./chunk-XY7FDLSK.js";import"./chunk-JKYTSC2D.js";import{a as Ar}from"./chunk-TGAOY65D.js";import"./chunk-IVP3GL2V.js";import{b as Ri,c as rt}from"./chunk-HT35KHLT.js";import"./chunk-BYXBJQAS.js";import{d as wi,e as ki}from"./chunk-ZR4YNJBZ.js";import{a as pr}from"./chunk-XX6Z7QPA.js";import"./chunk-VQ7WKMGF.js";import{a as ir,b as nr,c as or}from"./chunk-YQCR57JN.js";import"./chunk-MHBOKOSN.js";import"./chunk-S6TMUVGC.js";import"./chunk-PPWHSAY6.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import{a as rr,d as ar,f as lr}from"./chunk-6ZOGADBZ.js";import{a as gt,b as mt}from"./chunk-7ENHJR7R.js";import{a as hr}from"./chunk-4E4L6WXO.js";import{a as sr,b as mr}from"./chunk-DHQUQTIV.js";import"./chunk-AZT6QE56.js";import{a as Xo}from"./chunk-5UL73W4S.js";import{C as Cr,D as Xe,F as qt,G as It,u as U,v as W,w as Ae}from"./chunk-677WPFLK.js";import{b as se,c as Ye}from"./chunk-CIBQBSM6.js";import{G as _r,O as Qt,P as de,a as dr,b as ur,n as Di,v as fr,y as gr}from"./chunk-L2RZWAX3.js";import{a as Uo}from"./chunk-ZT4RBJMM.js";import"./chunk-GIKR6Y2K.js";import{e as ot}from"./chunk-VMY3JQDA.js";import{a as Yo,e as F,f as Ve,g as oe}from"./chunk-D35OBUDE.js";import{M as Zo,Z as er,_ as tr}from"./chunk-567HXZXC.js";import"./chunk-WEJYVCCX.js";import"./chunk-AAJJTF33.js";import{a as Be}from"./chunk-2FWFPV5I.js";import"./chunk-3PYW74LR.js";import{B as zo,D as Ce,E as Ke,a as Wo,b as bt,c as ie,d as Qo,e as ui,g as qo,h as G,j as $o,l as vt,m as Jo,o as ne,r as Go,s as St,y as jt}from"./chunk-P7HKWFZT.js";import{a as Ft,c as Ut}from"./chunk-HSQKKFE6.js";import{a as Ko}from"./chunk-7BDVBLHM.js";import{a as S,d as Ht}from"./chunk-AHCRE4GP.js";import"./chunk-W7HVLC6V.js";import{$a as s,$b as ye,Ab as to,Ac as x,Ba as Oo,Bc as pe,Cc as ze,Db as R,E as ce,Eb as si,Fa as He,Fc as K,Gb as ci,Hb as pi,I as li,Ia as Po,Ib as r,Ja as lt,Jb as a,Ka as Mo,Kb as h,Kc as Vo,Lb as I,M as yo,Ma as z,Mb as O,Md as jo,N as Vt,Nb as mi,Ob as v,Od as Ho,Qb as _,Qd as pt,Rb as c,Rd as Lt,Sc as Ao,Td as Bt,Ub as di,Va as xi,Vb as Eo,Vd as Z,Wa as it,Wc as H,Y as At,Yc as _e,Yd as Ne,Za as nt,Zb as ve,Zc as Q,_b as Se,aa as Te,ad as Lo,bc as Ro,bd as Pi,c as bo,cb as Do,cc as No,cd as Re,d as J,da as k,db as d,dc as $,e as Xn,ec as m,ed as We,fa as Ee,fc as T,gb as wo,gc as y,gd as X,hc as Ue,ia as xo,id as Bo,ja as Ge,jc as M,jd as te,k as vo,ka as Ct,kb as P,kc as D,lb as ht,lc as w,ma as L,mb as Ii,md as Fo,na as Y,o as Zn,ob as Oi,pc as st,qb as g,qc as ct,rc as E,sc as ge,t as tt,tc as Et,u as yi,ua as Io,ub as ko,va as u,vb as p,wa as f,wb as eo,xb as To,z as So,zb as be,zc as b}from"./chunk-DZT5XHBQ.js";import{j as ho}from"./chunk-7DCB7DB2.js";var en=class{ID;Code;Name;Title;Field;Address;ContactInfo;Logo;FooterLeft;FooterRight;FooterNote;PrintMode;PrintLX300;DeliveryNote;AppendQR;ItemRenderMode;CssClass;RemoveImage;DisplayName;DisplayNameCode};var Gt=class{ParkLabel;Note;NumberOfPerson;ID;Alias;Created;CustomerDisplay;Number;Duration};var tn=class n{constructor(t,e,i,o,l,C){this.dialogRef=t;this._orderProcessorService=e;this._posService=i;this.salesOrderService=o;this.parkService=l;this.data=C;this.initModalDialog(),this.initConfig(),this.parkLabel=C.ParkLabel,this.form.ParkLabel=C.ParkLabel,this.form.Note=o.Data.Order.Note}modalConfig=new U;labelPlaceholder;form=new Gt;parkLabel;initConfig(){let t=this._posService.Data.AppConfigJSON;this.labelPlaceholder=t.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkLabelPlaceholder}initModalDialog(){this.modalConfig.title=this.data.title,this.modalConfig.customWidth="600px"}onOk(){this.setParkTitle(),this.parkService.park(this.form).subscribe(t=>{this.dialogRef.close(!0)})}setParkTitle(){let t=this._orderProcessorService.Data.posState,e=this.salesOrderService.Data.Order.Number;t==5?this.salesOrderService.Data.SplitParkLabel=S.IsEmpty(this.parkLabel)?e:this.parkLabel:S.IsEmpty(this.parkLabel)?this.form.ParkLabel=e:this.form.ParkLabel=this.parkLabel}static \u0275fac=function(e){return new(e||n)(d(F),d(j),d(B),d(V),d(we),d(Ve))};static \u0275cmp=P({type:n,selectors:[["POS-modal-park-input"]],standalone:!1,decls:17,vars:3,consts:[[3,"onCancel","onOk","onClose","config"],[1,"ods-info-box"],[1,"fas","fa-info-circle",2,"font-size","1.2rem","margin-top","2px"],["href","https://ods.dealpos.app","target","_blank",2,"color","#0d6efd","font-weight","600","text-decoration","underline"],[1,"w-100","mt-4"],[1,"mb-3"],["type","text","required","","placeholder","E.g. Mr. John Doe","matTooltip","Same as Order Number when blank",1,"form-control","w-100","height-input",3,"ngModelChange","ngModel"],["placeholder","ex: Customer will return tommorow",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(r(0,"modal-material",0),_("onCancel",function(){return i.dialogRef.close()})("onOk",function(){return i.onOk()})("onClose",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1),h(3,"i",2),r(4,"div"),m(5," Use our "),r(6,"a",3),m(7," Order Display Fulfillment System "),a(),m(8," to view the Parked Orders from your warehouse area. "),a()(),r(9,"div",4)(10,"strong",5),m(11,"Label"),a(),r(12,"input",6),w("ngModelChange",function(l){return D(i.parkLabel,l)||(i.parkLabel=l),l}),a()(),r(13,"div",4)(14,"strong",5),m(15,"Note"),a(),r(16,"POS-tinymce-editor",7),w("ngModelChange",function(l){return D(i.form.Note,l)||(i.form.Note=l),l}),a()()()()),e&2&&(p("config",i.modalConfig),s(12),M("ngModel",i.parkLabel),s(4),M("ngModel",i.form.Note))},dependencies:[ie,G,jt,ne,W,se,Ot],styles:[".height-input[_ngcontent-%COMP%]{height:36px} ng-select.park-detail>div.ng-select-container{border-radius:0!important}.deposit[_ngcontent-%COMP%] .ng-select{width:auto!important}.ods-info-box[_ngcontent-%COMP%]{background-color:#e8f4fd;border-left:4px solid #0dcaf0;padding:16px 20px;border-radius:8px;font-family:Roboto Slab,sans-serif;color:#055160;display:flex;align-items:flex-start;gap:10px;font-size:14px;max-width:600px;margin:0 auto}"]})};var nn=class n{constructor(t){this._dialogRef=t;this.modalConfig=new U,this.modalConfig.title="Select Print Type",this.modalConfig.hideFooter=!0}modalConfig;onPrintOrder(){this._dialogRef.close("ORDER")}onPrintBill(){this._dialogRef.close("BILL")}static \u0275fac=function(e){return new(e||n)(d(F))};static \u0275cmp=P({type:n,selectors:[["POS-modal-print"]],standalone:!1,decls:17,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"d-flex"],[1,"btn","btn-gray","btn-lg","me-1",3,"click"],["src","//res.cloudinary.com/pos/image/upload/v1650423915/icons/order.png"],[1,"mt-1"],[1,"mt-0"],[1,"btn","btn-gray","btn-lg","ms-1",3,"click"],["src","//res.cloudinary.com/pos/image/upload/v1650423915/icons/bill.png",2,"width","23px"]],template:function(e,i){e&1&&(r(0,"modal-material",0),_("onCancel",function(){return i._dialogRef.close()})("onClose",function(){return i._dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),_("click",function(){return i.onPrintOrder()}),h(4,"img",3),r(5,"h4",4),m(6,"Order"),a(),r(7,"div",5),m(8,"For order for the kitchen"),a()(),r(9,"a",6),_("click",function(){return i.onPrintBill()}),h(10,"img",7),r(11,"h4",4),m(12,"Bill"),a(),r(13,"div",5),m(14,"To see amount of the bill"),a(),r(15,"div",5),m(16,"(Pre-settlement bill)"),a()()()()()),e&2&&p("config",i.modalConfig)},dependencies:[W],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}.btn[_ngcontent-%COMP%]{padding:8px 0;width:190px;margin-right:10px}.btn[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase}.btn[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{font-size:.75rem;font-style:italic;color:#868686;margin-top:10px}"]})};var Na=(n,t,e)=>({"unselect-card":n,"card-select":t,"card-available":e}),Va=n=>({"text-secondary":n}),Aa=(n,t)=>({"bg-danger-subtle text-inactive":n,"bg-success text-white":t}),La=(n,t)=>({"text-secondary":n,"text-success":t});function Ba(n,t){if(n&1&&h(0,"i",7),n&2){let e=c();be(e.icon()),p("ngClass",ge(3,La,e.isOccupied(),!e.isOccupied()))}}var on=class n{title=lt("Park Order");isOccupied=lt(!0);alias=lt("A1");icon=lt("fa-solid fa-star");selected=lt(!1);onEventSelect=Po({alias:"onSelect"});onSelect(){this.isOccupied()==!1&&this.onEventSelect.emit(this.title())}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=P({type:n,selectors:[["park-card"]],inputs:{title:[1,"title"],isOccupied:[1,"isOccupied"],alias:[1,"alias"],icon:[1,"icon"],selected:[1,"selected"]},outputs:{onEventSelect:"onSelect"},decls:9,vars:15,consts:[[1,"card","m-0","bg-light","border","border-2","bg-opacity-25","rounded",3,"click","ngClass"],[1,"card-body"],[1,"d-flex","align-items-center","justify-content-between","flex-column"],[1,"d-flex","align-items-center","gap-3"],[1,"fa-xl","text-success",3,"ngClass","class"],[3,"ngClass"],[1,"py-2","px-5","rounded-pill","mt-7","fw-normal","border",3,"ngClass"],[1,"fa-xl","text-success",3,"ngClass"]],template:function(e,i){e&1&&(r(0,"div",0),_("click",function(){return i.onSelect()}),r(1,"div",1)(2,"div",2)(3,"div",3),g(4,Ba,1,6,"i",4),r(5,"h4",5),m(6),a()(),r(7,"div",6),m(8),a()()()()),e&2&&(p("ngClass",Et(6,Na,!i.selected(),i.selected()&&!i.isOccupied(),!i.isOccupied())),s(4),R(i.icon()?4:-1),s(),p("ngClass",E(10,Va,i.isOccupied())),s(),y(" ",i.title()," "),s(),p("ngClass",ge(12,Aa,i.isOccupied(),!i.isOccupied())),s(),y(" ",i.isOccupied()?"Occupied":"Available"," "))},dependencies:[te,H],styles:[".text-inactive[_ngcontent-%COMP%]{color:#b98181}.card-available[_ngcontent-%COMP%]{cursor:pointer;transition:all .3s ease;transform:translateY(0)}.card-available[_ngcontent-%COMP%]:hover{transform:translateY(-6px);box-shadow:0 2px 4px #00000026,0 0 2px 1px #c0f4cb;border-color:#81c784!important;background-color:#fff!important}.card-select[_ngcontent-%COMP%]{background-color:#ffffe1!important;border-color:#89b03e!important}.unselect-card[_ngcontent-%COMP%]{border-color:transparent!important}"]})};var Fa=n=>({"mat-tab-group-height":n});function ja(n,t){if(n&1){let e=v();r(0,"div",2)(1,"div",6)(2,"span",7),h(3,"i",8),a(),r(4,"input",9),w("ngModelChange",function(o){u(e);let l=c();return D(l.filter,o)||(l.filter=o),f(o)}),a()()()}if(n&2){let e=c();s(4),M("ngModel",e.filter)}}function Ha(n,t){if(n&1&&(r(0,"h5",14),h(1,"i"),r(2,"span"),m(3),a()()),n&2){let e=c().$implicit;s(),be(e.Icon),s(2),T(e.Name)}}function Ua(n,t){if(n&1){let e=v();r(0,"div",13)(1,"park-card",15),_("onSelect",function(){let o=u(e).$implicit,l=c(2);return f(l.onSelect(o))}),a()()}if(n&2){let e,i=t.$implicit,o=c().$implicit,l=c();s(),p("title",l.replaceWithAlias()&&i.Alias?i.Alias:i.Name)("alias",i.Alias)("isOccupied",i.IsOccupied)("icon",o.Icon)("selected",((e=l.parkOptionSelected())==null?null:e.Name)===i.Name)}}function Wa(n,t){if(n&1&&(r(0,"mat-tab",4),g(1,Ha,4,3,"ng-template",10),r(2,"div",11)(3,"div",12),ci(4,Ua,2,5,"div",13,si),b(6,"Filter"),a()()()),n&2){let e=t.$implicit,i=c();p("label",e.Name),s(4),pi(ze(6,1,e.Options,i.filter(),"Name"))}}function Qa(n,t){if(n&1){let e=v();r(0,"div",5)(1,"POS-tinymce-editor",16),w("ngModelChange",function(o){u(e);let l=c();return D(l.parkNote,o)||(l.parkNote=o),f(o)}),a()()}if(n&2){let e=c();s(),M("ngModel",e.parkNote)}}var Kt=class n{constructor(t){this.data=t;this.parkLayout.set(t.parkLayoutPack),this.replaceWithAlias.set(t.replaceWithAlias),this.initModalConfig(),this.showInputNote.set(this.posService.Data?.AppConfigJSON?.ApplicationParkAndRetrieve?.NumberOfPerson)}dialog=Y(oe);dialogRef=Y(F);orderProcessorService=Y(j);salesOrderService=Y(V);posService=Y(B);modalConfig=new U;filter=z("");parkLayout=z(null);parkOptionSelected=z(null);replaceWithAlias=z(!1);showInputNote=z(!1);parkNote=z("");initModalConfig(){this.modalConfig.title=this.data.title||"Park Order",this.modalConfig.customWidth="700px",this.modalConfig.bodyScrollable=!0,this.modalConfig.okText=" Park "}onSelect(t){this.parkOptionSelected.set(t)}onOk(){this.showInputNote()&&(this.parkOptionSelected().Note=this.parkNote()),this.dialogRef.close(this.parkOptionSelected())}onCancel(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||n)(d(Ve))};static \u0275cmp=P({type:n,selectors:[["app-modal-park"]],decls:8,vars:6,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container",2,"max-height","395px","min-height","395px"],[1,"search-container"],["mat-stretch-tabs","false",1,"mt-2",3,"ngClass"],[3,"label"],[1,"mt-4"],[1,"input-group","w-100"],[1,"input-group-text","txtFilter","rounded-start-1"],["aria-hidden","true",1,"fa","fa-magnifying-glass"],["type","text","placeholder","Search by number or note","aria-label","Search",1,"txtFilter","form-control","border-start-0","rounded","rounded-start-0",3,"ngModelChange","ngModel"],["mat-tab-label",""],[1,"container","mt-5"],[1,"row"],[1,"col-3","mb-4","px-2"],[1,"d-flex","align-items-center","gap-3"],[3,"onSelect","title","alias","isOccupied","icon","selected"],["height","180px","placeholder","Input the park note (E.g. this is for Mr. John)",3,"ngModelChange","ngModel"]],template:function(e,i){if(e&1&&(r(0,"modal-material",0),_("keydown.F2",function(){return i.onOk()})("onOk",function(){return i.onOk()})("onCancel",function(){return i.onCancel()})("onClose",function(){return i.onCancel()}),r(1,"content")(2,"div",1),g(3,ja,5,1,"div",2),r(4,"mat-tab-group",3),ci(5,Wa,7,5,"mat-tab",4,si),a(),g(7,Qa,2,1,"div",5),a()()()),e&2){let o,l,C;p("config",i.modalConfig),s(3),R(((o=i.parkLayout().Layout)==null?null:o.length)>0?3:-1),s(),p("ngClass",E(4,Fa,i.showInputNote()&&((l=i.parkOptionSelected())==null?null:l.Name))),s(),pi(i.parkLayout().Layout),s(2),R(i.showInputNote()&&((C=i.parkOptionSelected())!=null&&C.Name)?7:-1)}},dependencies:[te,H,Ae,W,on,Qt,fr,Ce,ie,G,ne,Wt,Mi,yt,xt,Wi,Ot],styles:["[_nghost-%COMP%] .mat-mdc-tab-group[_ngcontent-%COMP%]{--mdc-tab-indicator-active-indicator-color: #89b03e;--mat-tab-header-focus-indicator-color: #89b03e;--mat-tab-header-focus-label-text-color: var(--bs-body-color);--mat-tab-header-active-label-text-color: var(--bs-body-color);--mat-tab-header-active-focus-label-text-color: var(--bs-body-color);--mat-tab-header-active-hover-label-text-color: var(--bs-body-color);--mat-tab-header-active-focus-indicator-color: #89b03e;--mat-tab-header-active-hover-indicator-color: #89b03e}[_nghost-%COMP%] .mat-mdc-tab-header{border-bottom:1px solid var(--bs-border-color)}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%]{transition:all .3s ease}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{position:relative;transition:all .3s ease;height:2.3rem}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover, [_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e4d,0 0 8px 4px #89b03e33;border-radius:4px}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]{transition:all .3s ease;border-left:none!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]:focus{box-shadow:none!important;border-color:#ced4da!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .input-group-text[_ngcontent-%COMP%]{transition:all .3s ease;background-color:#fff;border-right:none!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .input-group-text[_ngcontent-%COMP%], [_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .input-group-text[_ngcontent-%COMP%]{background-color:#89b03e1a;border-color:#84cc16!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .fa-magnifying-glass[_ngcontent-%COMP%]{transition:all .3s ease}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .fa-magnifying-glass[_ngcontent-%COMP%], [_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .fa-magnifying-glass[_ngcontent-%COMP%]{color:#84cc16!important}[_nghost-%COMP%] .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e66,0 0 12px 6px #89b03e40!important}[_nghost-%COMP%] .mat-tab-group-height[_ngcontent-%COMP%]{height:165px}"]})};var an=class n{constructor(t,e,i,o,l,C,N,re,ke){this.dialogRef=t;this.parkOrderRetrieve=e;this._orderDataService=i;this._posHttpResponseService=o;this._orderProcessorService=l;this._orderHttpService=C;this._dialog=N;this._outletRegisterService=re;this.parkService=ke;this.salesOrderData=this._orderDataService.Data,this.appConfig=this._posHttpResponseService.Data.AppConfigJSON,this.parkLayoutPack=this._outletRegisterService.Data.ParkLayoutPack}modalConfig=new U;salesOrderData;appConfig;parkLayoutPack;ngOnInit(){this.modalConfig.title="Re-Park Order?",this.modalConfig.hideFooter=!0}onRepark(){this.parkService.park(this.parkOrderRetrieve).subscribe(t=>{this.dialogRef.close()})}onMove(){this.dialogRef.close(),this.showParkSelectModal()}showParkSelectModal(){this._orderHttpService.getVacant(this.salesOrderData.Order.EntityID).subscribe(t=>{this._dialog.open(Kt,{data:{title:this.title,parkLayoutPack:this.parkLayoutPack,replaceWithAlias:this.appConfig.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias}})})}get title(){return this._orderProcessorService.Data.posState==5?"Split Order":this.appConfig.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkDialogTitle}static \u0275fac=function(e){return new(e||n)(d(F),d(Ve),d(V),d(B),d(j),d(Oe),d(oe),d(ee),d(we))};static \u0275cmp=P({type:n,selectors:[["POS-modal-repark"]],standalone:!1,decls:13,vars:2,consts:[[3,"onClose","onCancel","title","config"],[1,"d-flex"],[1,"btn","btn-gray","btn-lg",3,"click"]],template:function(e,i){e&1&&(r(0,"modal-material",0),_("onClose",function(){return i.dialogRef.close()})("onCancel",function(){return i.dialogRef.close()}),r(1,"content")(2,"div",1)(3,"a",2),_("click",function(){return i.onRepark()}),r(4,"h4"),m(5,"Re-Park"),a(),r(6,"span"),m(7,"Store order to same location"),a()(),r(8,"a",2),_("click",function(){return i.onMove()}),r(9,"h4"),m(10,"Move"),a(),r(11,"span"),m(12,"Shift order to Different location"),a()()()()()),e&2&&p("title","Re-Park Order?")("config",i.modalConfig)},dependencies:[W],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-gray[_ngcontent-%COMP%]{background-color:#f4f4f4;border:1px solid #D6D6D6;font-weight:700;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}.btn[_ngcontent-%COMP%]{padding:25px 0;width:190px;margin-right:10px}.btn[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase}.btn[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.75rem;font-style:italic;color:#868686;margin-top:10px}"]})};var Yt=class{Name;Alias;IsOccupied;Note};var ln=class{_point;get point(){return this._point}set point(t){this._point=t}_pricebookID;get pricebookID(){return this._pricebookID}set pricebookID(t){this._pricebookID=t}_discountRate;get discountRate(){return this._discountRate}set discountRate(t){this._discountRate=t}_groups;get groups(){return this._groups}set groups(t){this._groups=t}_salesID;get salesID(){return this._salesID}set salesID(t){this._salesID=t}_dueDays;get dueDays(){return this._dueDays}set dueDays(t){this._dueDays=t}_expiryDate;get expiryDate(){return this._expiryDate}set expiryDate(t){this._expiryDate=t}_debt;get debt(){return this._debt}set debt(t){this._debt=t}_expirtedString;get expirtedString(){return this._expirtedString}set expirtedString(t){this._expirtedString=t}_loyaltyDisabled;get loyaltyDisabled(){return this._loyaltyDisabled}set loyaltyDisabled(t){this._loyaltyDisabled=t}_taxTypeID;get taxTypeID(){return this._taxTypeID}set taxTypeID(t){this._taxTypeID=t}_entityID;get entityID(){return this._entityID}set entityID(t){this._entityID=t}_mobile;get mobile(){return this._mobile}set mobile(t){this._mobile=t}_email;get email(){return this._email}set email(t){this._email=t}_dueMonths;get dueMonths(){return this._dueMonths}set dueMonths(t){this._dueMonths=t}_memberIdentification;get memberIdentification(){return this._memberIdentification}set memberIdentification(t){this._memberIdentification=t}};var _i=class{OutletName;Status;AmountSummary;Coupon;Creator;CurrencySymbol;Customer;Date;Delivery;ExtraNote;FinalAmount;InvoiceNote;Items;LoyaltyPoint;Payments;PrintDate;RegisterCode;SalesOrderItemCommission;Shipping;Title;TypeName;PaymentState;ToP;Due;InvoiceID;Gopay;Number;Created;SalesName;ParkLabel;HeaderTitle;QRContent;Retur;AfterSell;constructor(){this.OutletName="",this.Status=1,this.AmountSummary=[],this.Coupon="",this.Creator="",this.CurrencySymbol="",this.Customer=new ln,this.Date="",this.Delivery={Number:""},this.ExtraNote="",this.FinalAmount=0,this.InvoiceNote="",this.Items=[],this.LoyaltyPoint="",this.Payments=[],this.PrintDate="",this.RegisterCode="",this.SalesOrderItemCommission={SalesName:""},this.Shipping=new fi,this.Title="",this.TypeName="",this.PaymentState=0,this.InvoiceID="",this.Number="",this.Created="",this.AfterSell=!0}};var Xt=class{LayoutPack;constructor(t){this.LayoutPack=t,this.GenerateLayoutOption()}GenerateLayoutOption(){this.LayoutPack!=null&&this.LayoutPack.Layout&&this.LayoutPack.Layout.forEach(t=>{t.Options=[];for(let e=1;e<=t.Size;e++){let i=new Yt;i.Name=t.Name+e,i.Alias=this.GetAlias(i.Name),t.Options.push(i)}})}GetAlias(t){if(this.LayoutPack!=null&&this.LayoutPack.Alias){let e=this.LayoutPack.Alias.filter(i=>i.Name==t);return e.length>0?e[0].Alias:t}return""}};var sn=class{ExtraNote;Title;Customer;SalesName;InvoiceNote;Date;Items;AmountSummary;Creator;NumberOfPerson;CurrencySymbol;constructor(){this.ExtraNote="",this.Title="",this.Customer="",this.SalesName="",this.InvoiceNote="",this.Date="",this.Items=[],this.AmountSummary=[],this.Creator="",this.NumberOfPerson=0,this.CurrencySymbol="Rp"}};var cn=class{AmountSummary;Contact;ContactDisplay;CurrencySymbol;FinalAmount;HeaderTitle;Invoice;IsPrice;Items;LoyaltyPoint;Order;Payments;PriceVisible;PrintPerson;PrintTime;SalesName;Shipping;TotalInWord};var Mt=class n{constructor(t,e,i,o,l,C,N,re){this._posService=t;this._orderDataService=e;this._cashierCalculatorService=i;this._outletService=o;this._OrderHttpService=l;this._receiptCalculatorService=C;this._orderProcessorService=N;this._customerHttpService=re;this.subscribeToObservableChanges()}posData;completeData;park=new Xt(null);outletInfo=new Ai;datePipe=new We("en-US");ParkTemp=Array();CartItems=[];get posStorage(){return this._posService.Data}get AppConfigJSON(){return this._posService.Data.AppConfigJSON}subscribeToObservableChanges(){this._orderDataService.Data$.subscribe(t=>{this.posData=t}),this._OrderHttpService.Data$.subscribe(t=>{this.completeData=t}),this._outletService.Data$.subscribe(t=>{this.outletInfo=t}),this._orderProcessorService.Data$.subscribe(t=>{this.ParkTemp=t.parkTemporaryItem})}generateReceiptMini(){let t=new _i;t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.OutletName=this.outletInfo.EntityName,t.ExtraNote=this.getParkLabel(),t.Customer=this.getSubmitedCustomer(),t.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.SalesOrderItemCommission={SalesName:this._outletService.getSalesname(this.posData.Order.SalesID)},t.Number=this.completeData?.InvoiceNumber,t.FinalAmount=this.completeData?.Final,t.InvoiceNote=this.posData.Order.Note,t.RegisterCode=this.outletInfo.RegisterCode==null?"":this.outletInfo.RegisterCode,t.QRContent=this.generateQrContent(),t.InvoiceID=this.completeData?.ObjectID,t.Retur=S.IsNotEmpty(this.posData?.Invoice?.ReferenceInvoiceID),t.Date=this.getSubmitedOrderDate(),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoiceCreatedTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy")),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.OrderTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm:ss")),this.posData.CartItems.forEach(i=>{i.SalesID&&(i.SalesName=this._outletService.getSalesname(i.SalesID))}),t.Items=this.posData.CartItems,t.Customer!=null&&t.Customer.Display!=null&&t.Customer.Display!=null&&t.Customer.Display!=null&&(t.Customer={ID:this.posData.Order.CustomerID,Display:this.posData.ContactName,Email:t.Customer.Email,CityName:null,Address:t.Customer.Address,Code:t.Customer.Code,Name:t.Customer.Name,Phone:t.Customer.Phone,Mobile:t.Customer.Mobile,NationalIDNumber:t.Customer.NationalIDNumber,Title:t.Customer.Title}),t.Delivery={Number:this.posData.Order.Number};let e=S.FilterByID(this.posStorage.PoTypes,this.posData.Order.TypeID);if(e!==null&&(t.TypeName=e.Name),t.Shipping=this.generateShippingData(),this.AppConfigJSON.PrintConfigInvoice.ItemsTable.ItemWithoutPriceVisible||(t.Items=t.Items.filter(i=>i.Price!=0)),t.Coupon=this.posData.Order.PromotionCoupon,t.LoyaltyPoint=this.completeData?this.completeData.LoyaltyPoint:"",t.FinalAmount=this._cashierCalculatorService.Data,t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.PaymentState=this.getPaymentState(),t.Payments=this.posData.Payments,t.Payments.forEach(i=>{i.MethodName=this.findPaymentName(i.MethodID)}),t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t.Creator=this.completeData?.Creator?this.completeData?.Creator:this.posStorage?.UserName,this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoicePaymentTermsVisible&&this.posData.Payments.length==0){let i=this.posData.Invoice.Due?new Date(this.posData.Invoice.Due):null,o=new Date(this.posData.Order.Date);o.setHours(0,0,0,0),t.ToP=this.generateTop(o,i),this.posData.Invoice.Due!==void 0&&(t.Due=this.datePipe.transform(new Date(this.posData.Invoice.Due),"dd MMMM yyyy"))}return t}generateQrContent(){let t="";if(this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.TransformTo==3){let i=this.AppConfigJSON?.PrintConfigInvoice?.InvoiceQR?.Content,o=this.posData?.Order?.Number,l=this.completeData.ObjectID,C=window?.location?.host;switch(i){case 2:t=l;break;case 1:t=o;break;case 3:t=`receipt.dealpos.app?Data=${btoa(`${l}_${C}`)}`;break}}return t}generateShippingData(){return{City:this.posData.Shipping!==null?this.posData.Shipping.City:null,Description:this.posData.Shipping!==null?this.posData.Shipping.Address:null,ID:null,Phone:this.posData.Shipping!==null?this.posData.Shipping.Phone:null,Recipient:this.posData.Shipping!==null?this.posData.Shipping.Name:null,SalesOrderID:null,Sender:null,SenderAddress:null,SenderCity:null,SenderPhone:null,Street:null}}generateParkReceipt(t=!0,e=!1){let i=new sn;if(i.ExtraNote=S.StringFormat("{0} #{1}",this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.NumberPrefix,this.GetSubmittedNumber()),i.Title=this.getParkLabel(),i.Customer=this.getSubmitedCustomer(),i.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),i.InvoiceNote=this.posData.Order.Note,i.Date=this.getSubmitedOrderDate(),i.CurrencySymbol=this._cashierCalculatorService.currencySymbol,this.getItemsParkReceipt(t,e),i.Items=this.CartItems,i.Creator=this.posStorage.UserName,i.NumberOfPerson=this.posData.Order.NumberOfPerson,this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.AmountVisible){let o=JSON.parse(JSON.stringify(this._receiptCalculatorService.generateAmountSummary()));i.AmountSummary=o}return i}getItemsParkReceipt(t,e){let i=rt(Fe,this.posData.CartItems);if(e){let o=this.posData.CartItems.filter(l=>S.IsNotEmpty(l.SplitQuantity)&&l.SplitQuantity>0);this.CartItems=o.map(l=>(l.Quantity=l.SplitQuantity,l))}else if(t&&this.AppConfigJSON.ApplicationParkAndRetrieve.PrintBehaviour.PrintAdditionalItemsOnlyOnRePark)if(this.CartItems=Array(),this.ParkTemp.length>0)for(let o of i){let l=this.ParkTemp.find(C=>C.ID==o.ID);l==null?this.CartItems.push(o):o.Quantity!=l.Quantity&&(o.Quantity=o.Quantity-l.Quantity,this.CartItems.push(o))}else this.CartItems=i;else this.CartItems=i}generateBillInvoice(){let t=new cn;return t.ContactDisplay=this.posData.ContactName,t.Invoice=this.posData.Invoice,t.Order=this.posData.Order,t.Payments=this.posData.Payments,t.Shipping=this.posData.Shipping,t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.FinalAmount=this._cashierCalculatorService.Data,t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t.Contact=this.getSubmitedCustomer(),t.Items=this.getItemsBillInvoice(),t.PrintTime=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm"),t.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.Invoice.Number=`#${this.posData.Order.Number}`,t.Invoice.Date=new Date,t.Invoice.PaymentStateID=1,t.Invoice.Note=this.posData.Order.Note,t.PrintPerson="",t.IsPrice=!0,t.PriceVisible=!0,t}getItemsBillInvoice(){return this.posData.CartItems.map(e=>({Name:e.Variant.Name,Quantity:e.Quantity,Code:e.Variant.Code,UnitPrice:e.Price,Discount:e.Discount,UOMName:e.Variant.UOMName,Total:e.Total,Note:e.Note}))}generateBillReceipt(){let t=new _i;t.HeaderTitle=this.AppConfigJSON.PrintConfigInvoice.HeaderTitle,t.ParkLabel=this.posData.Order.ParkLabel,t.OutletName=this.outletInfo.EntityName,t.ExtraNote=this.getParkLabel(),t.Customer=this._customerHttpService.Data,t.SalesOrderItemCommission.SalesName=this._outletService.getSalesname(this.posData.Order.SalesID),t.Number=this.posData.Order.Number,t.FinalAmount=this._cashierCalculatorService.Data,t.InvoiceNote=this.posData.Order.Note,t.Date=this.datePipe.transform(this.posData.Order.Date,"dd MMM yyyy"),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.InvoiceCreatedTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy")),this.AppConfigJSON.PrintConfigInvoice.DocumentVisibility.OrderTimeVisible&&(t.Created=this.datePipe.transform(new Date,"dd MMM yyyy HH:mm:ss")),t.Items=this.posData.CartItems,t.Customer.ID=this.posData.Order.CustomerID,t.Customer.Name=this.posData.ContactName,t.Customer.Display=this.posData.ContactName,t.Customer.Mobile&&t.Customer.Mobile.length==1&&(t.Customer.Mobile=null),t.Delivery={Number:this.posData.Order.Number};let e=S.FilterByID(this.posStorage.PoTypes,this.posData.Order.TypeID);return e!==null&&(t.TypeName=e.Name),t.Shipping=this.generateShippingData(),this.AppConfigJSON.PrintConfigInvoice.ItemsTable.ItemWithoutPriceVisible||(t.Items=t.Items.filter(i=>i.Price!=0)),t.Coupon=this.posData.Order.PromotionCoupon,t.PaymentState=this.getPaymentState(),t.Payments=this.posData.Payments,t.Payments=t.Payments.map(i=>(i.MethodName=this.findPaymentName(i.MethodID),i)),t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t}getPaymentState(){let t=this.AppConfigJSON?.ModuleSell?.ToleranceAmount,e=this.posData.Payments,i=this.posData.TotalPaidAmount,o=this._cashierCalculatorService.Data,l=1;e?.length>0&&i<o&&(l=2);let C=i-o;return(Math.abs(C)<=t||C>=0)&&(l=3),l}generateTop(t,e){let i=new Date(e),o=new Date(t),l=i.getTime()-o.getTime();return Math.floor(l/(1e3*3600*24))}getSubmitedOrderDate(){let t=this.posData.Order?.Date,e=this.AppConfigJSON.PrintConfigInvoice?.DocumentVisibility?.OrderTimeVisible,i="",o=new Date;if(e){let l=new Date(t);l.setHours(o.getHours()),l.setMinutes(o.getMinutes()),i=this.datePipe.transform(l,"dd MMM yyyy HH:mm")}else i=this.datePipe.transform(t,"dd MMM yyyy");return i}getSubmitedCustomer(){return S.IsEmpty(this.completeData)?{}:this.completeData.Contact}getParkLabel(){let t=this.AppConfigJSON.ApplicationParkAndRetrieve.PrintOutput.LabelPrefix,e=this.AppConfigJSON.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias,i=this.posData.Order.ParkLabel;if(S.IsNotEmpty(this.posData.SplitParkLabel)&&(i=this.posData.SplitParkLabel),e&&S.IsNotEmpty(i)){let o=this.park.GetAlias(i);i=o||i}return i?S.IsEmpty(t)?i:S.StringFormat("{0} # {1}",t,i):""}GetSubmittedNumber(){return S.IsNotEmpty(this.completeData)?this.completeData.InvoiceNumber:this.posData.Invoice.Number?this.posData.Invoice.Number:this.posData.Order.Number}generateCartItemSummary(){let t=[];for(let e of this.posData.CartItems)t.push(new Fi(e.Total,this._cashierCalculatorService.currencySymbol,e.Variant.Name,1));return t}generatePaymentSummary(){let t=[],e;for(let o=0;o<this.posData.Payments.length;o++){let l="Payment"+(o+1);this.AppConfigJSON.PrintConfigInvoice.Footer.PaymentMethodVisible&&(l=this.findPaymentName(Number(this.posData.Payments[o].MethodID))),e=new Fi(this.posData.Payments[o].PaidAmount,this._cashierCalculatorService.currencySymbol,l,1),t.push(e)}let i=this.generateChangeSummary();return i!==null&&t.push(i),t}generateChangeSummary(){let t=this._cashierCalculatorService.currencySymbol,e=this._cashierCalculatorService.Data,i=this.posData.TotalPaidAmount,o=0,l=null;return o=i-e,o>0&&(l=new Fi(o,t,"Change",1)),l}findPaymentName(t){return this._outletService.Data.Payments.find(e=>e.ID==t).Name}printWindow(){return ho(this,null,function*(){return new Promise(t=>{setTimeout(()=>{window.print(),t()},500)})})}static \u0275fac=function(e){return new(e||n)(L(B),L(V),L(Pe),L(ee),L(Oe),L(ji),L(j),L(ut))};static \u0275prov=Ge({token:n,factory:n.\u0275fac,providedIn:"root"})};var we=class n{constructor(t,e,i,o,l,C,N,re,ke,$e){this.httpService=t;this.receiptService=e;this.orderProcessorService=i;this.pageInitialService=o;this.salesOrderService=l;this.toastrService=C;this.promotionEventService=N;this.outletService=re;this.orderHttpService=ke;this.dialog=$e;this._onPrint=new J,this.onPrint$=this._onPrint.asObservable(),this.subscribeToObservable()}_onPrint;onPrint$;parkOrderRetrieve;subscribeToObservable(){this.orderProcessorService.Data$.subscribe(t=>{(t.posState==3||t.posState==5)&&this.emitParkReceipt(!0,t.posState==5)})}getParkedOrder(t,e){return this.httpService.get(de.GetPark,[{key:"EntityID",value:t},{key:"RegisterID",value:e}])}removeOrder(t,e){let i={OrderID:t};return e?this.httpService.post(de.VoidPark,i):this.httpService.post(de.RemovePark,i)}mergePark(t){return this.httpService.post(de.MergePark,t)}getOutstanding(t){let e={EntityID:t};return this.httpService.post(de.GetOutStanding,e)}splitOrder(t){return this.httpService.post(de.SplitOrder,t)}park(t){let e=rt(dt,this.salesOrderService.Data);if(this.promotionEventService.selectedPromotion){this.clearPromotionAppliedInPark();return}e.Action.DeliveryEntityID=S.GuidEmpty,e.Action.Type=1,t.ParkLabel!=null&&(e.Order.ParkLabel=t.ParkLabel),e.Order.Note=t.Note,e.Order.InvoicedStateID=1,S.IsNotEmpty(t.ID)&&(e.Order.ID=t.ID),this.salesOrderService.pushNewValue(e);let i=this.orderHttpService.generatePOSDataForSubmission(e);return this.httpService.post(de.ParkOrder,i).pipe(Ee(o=>{this.orderProcessorService.updatePosState(3,o),this.orderProcessorService.createNewTransactionInSameOutletRegister()}))}clearPromotionAppliedInPark(){this.dialog.open(wr,{id:"modal-promotion-confirm",data:{message:`
2
2
  Promotion cannot be applied when Park,
3
3
  Order will be restored to before the promotion is applied
4
4
  `},disableClose:!0})}parkOrder(){let t=this.salesOrderService.Data,e=this.pageInitialService.Data.AppConfigJSON;if(t.CartItems.length==0){this.toastrService.warning("You must have at least one item","No Item in Cart!");return}if(!(!this.validateCustomerRequired(e,t)||!this.validateUsedPromotion(t))){if(S.IsEmpty(t.Order.RegisterID)){this.toastrService.warning(Cr.emptyEntity,Be.Warning);return}this.validateShowParkModal()}}validateCustomerRequired(t,e){return t.ModuleSell.Header.CustomerRequired&&e.Order.CustomerID==null?(this.toastrService.warning("Customer is needed before parking orders!","Missing customer!"),!1):!0}validateUsedPromotion(t){let e=this.promotionEventService.selectedPromotion;return S.IsNotEmpty(e)||S.IsNotEmpty(t.Order.PromotionCoupon)?(this.toastrService.warning("Orders with applied promotions or coupons cannot be parked!","Park Not Allowed!"),!1):!0}validateShowParkModal(){let t=this.outletService.Data.ParkLayoutPack,e=this.pageInitialService.Data.AppConfigJSON,i=this.salesOrderService.Data;if(t&&S.IsNotEmpty(t.ID))this.orderProcessorService.Data.posState==4?this.showReparkModal():this.showParkSelectModal(e,i);else{if(!this.validateRetrieveMode(e))return;this.setDefaultParkNote(e),this.showParkInputModal()}}showParkSelectModal(t,e){let i=this.orderProcessorService.Data,o=this.outletService.Data.ParkLayoutPack;this.orderHttpService.getVacant(e.Order.EntityID).subscribe(l=>{let C=t.ApplicationParkAndRetrieve.UserInterfaceLabel.ParkDialogTitle,N=i.posState==5,re=t.ApplicationParkAndRetrieve.ParkLayoutTemplate.EnableAlias,ke=N?"Split Order":C;this.dialog.open(Kt,{data:{title:ke,parkLayoutPack:this.generateParkLayoutOptions(o,l.Orders),replaceWithAlias:re}}).afterClosed().pipe(ce($e=>S.IsNotEmpty($e)),Te($e=>{let je=new Gt;return je.ParkLabel=$e.Name,je.Note=$e.Note,this.park(je)})).subscribe()})}showReparkModal(){this.dialog.open(an,{data:this.parkOrderRetrieve})}validateRetrieveMode(t){return t.ApplicationParkAndRetrieve.Advance.retreiveMode==1?(this.toastrService.error("Your retrieve config is in Group mode, to enable park please setting your Park layout at Outlet page","Error!"),!1):!0}setDefaultParkNote(t){let e=t.ApplicationParkAndRetrieve.UserInterfaceLabel.DefaultParkNoteValue,i=this.orderProcessorService.Data.posState==2,o=this.salesOrderService.Data;!i&&S.IsNotEmpty(e)&&S.IsEmpty(o.Order.Note)&&(this.salesOrderService.Data.Order.Note=e)}showParkInputModal(){let t="Park this order?",e=this.orderProcessorService.Data.posState==5,i=this.outletService.Data?.ParkLayoutPack;e&&(t="Split Detail"),this.dialog.open(tn,{id:"park-form-modal",data:{title:t,labelDisable:i&&S.IsNotEmpty(i?.ID)||this.orderProcessorService.Data.posState==5,ParkLabel:this.salesOrderService.Data.Order.ParkLabel}})}onPrintRetrieve(){this.dialog.open(nn).afterClosed().pipe(ce(t=>S.IsNotEmpty(t))).subscribe(t=>{t=="ORDER"?this.emitParkReceipt(!1,!1,!0):this.emitBillReceipt()})}emitParkReceipt(t,e=!1,i=!1){let o=this.receiptService.generateParkReceipt(t,e);(this.pageInitialService.Data.AppConfigJSON.ApplicationParkAndRetrieve?.PrintBehaviour?.PrintAfterPark||i)&&this._onPrint.next({type:"PARK",template:o})}emitBillReceipt(){let t=this.outletService.Data,e;1==t.PrintTemplate.PrintMode?(e=this.receiptService.generateBillInvoice(),this._onPrint.next({type:"BILL_A4",template:e})):(e=this.receiptService.generateBillReceipt(),this._onPrint.next({type:"BILL_MINI",template:e}))}generateParkLayoutOptions(t,e=[]){return t.Layout=t.Layout.map(i=>{i.Options=[];for(let o=1;o<=i.Size;o++){let l=new Yt;l.Name=i.Name+o,l.Alias=this.generateAlias(t,l.Name),l.IsOccupied=this.IsOccupied(l.Name,e),i.Options.push(l)}return i}),t}generateAlias(t,e){let i="";if(t.Alias){let o=t.Alias.filter(l=>l.Name==e);o.length>0&&(i=`${o[0]?.Alias}`)}return i}IsOccupied(t,e){let i=e.filter(l=>l.ParkLabel==t),o=!1;return i.length>0&&(o=!0),o}static \u0275fac=function(e){return new(e||n)(L(Ne),L(Mt),L(j),L(B),L(V),L(Z),L($t),L(ee),L(Oe),L(oe))};static \u0275prov=Ge({token:n,factory:n.\u0275fac,providedIn:"root"})};var pn=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=ht({type:n});static \u0275inj=Ct({imports:[te,Ce,Vi,It,Er,Wt,Bt,Qt,Ye,Qi]})};var da=n=>({"opacity-50":n});function Ja(n,t){if(n&1){let e=v();r(0,"div",5)(1,"h6",6),m(2,"Verify Via"),a(),r(3,"div",7)(4,"button",8),_("click",function(){u(e);let o=c();return f(o.onChooseVerifyType("phone"))}),r(5,"div",9)(6,"div"),h(7,"i",10),a(),r(8,"div",11),m(9),a()()()(),r(10,"div",12)(11,"button",8),_("click",function(){u(e);let o=c();return f(o.onChooseVerifyType("email"))}),r(12,"div",9),h(13,"i",13),r(14,"div",11),m(15),a()()()(),r(16,"div",12)(17,"button",14),_("click",function(o){return u(e),c().onChooseVerifyType("pin"),f(o.preventDefault())}),r(18,"div",9),h(19,"i",15),r(20,"div",16),m(21,"Use PIN"),a()()()()()}if(n&2){let e=c();s(4),p("disabled",!e.phone||(e.phone==null?null:e.phone.length)<6),s(4),p("ngClass",E(6,da,!e.phone||(e.phone==null?null:e.phone.length)<6)),s(),y(" ",e.phone&&(e.phone==null?null:e.phone.length)>6?e.phone:"Mobile Phone is not registered"," "),s(2),p("disabled",!e.email),s(3),p("ngClass",E(8,da,!e.email)),s(),y(" ",e.email?e.email:"Email is not registered"," ")}}function Ga(n,t){if(n&1){let e=v();r(0,"div",17)(1,"div",18)(2,"div"),m(3,"OTP Verification is turned "),r(4,"span",19),m(5,"OFF"),a(),m(6,","),a(),r(7,"div"),m(8," Please read this "),r(9,"a",20),m(10,"article"),a(),m(11," to turn on "),a()()(),r(12,"div")(13,"div",21)(14,"button",22),_("click",function(){u(e);let o=c();return f(o.onRedeem())}),m(15,"Redeem"),a()()()}}var mn=class n{toastrService=Y(Z);onVerify=new He;pointUsedChange=new He;redeemEvent=new He;isVerifyEnabled=!1;phone;email;pointUsed;pointBalance;onPointUsedChange(){this.pointUsedChange.emit(this.pointUsed)}ngAfterViewInit(){this.setFocusInput()}setFocusInput(){setTimeout(()=>{document.getElementById("pointInput")?.focus()},300)}onChooseVerifyType(t){this.checkPointUsed()&&this.onVerify.emit(t)}onRedeem(){this.checkPointUsed()&&this.redeemEvent.emit()}checkPointUsed(){return S.IsEmpty(this.pointUsed)||this.pointUsed<=0?(this.toastrService.warning("Please enter the points before redeeming!","Field Input Required!"),this.setFocusInput(),!1):!0}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=P({type:n,selectors:[["point-step"]],inputs:{isVerifyEnabled:"isVerifyEnabled",phone:"phone",email:"email",pointUsed:"pointUsed",pointBalance:"pointBalance"},outputs:{onVerify:"onVerify",pointUsedChange:"pointUsedChange",redeemEvent:"onRedeem"},decls:13,vars:6,consts:[[1,"d-flex","align-items-center","justify-content-center"],[1,"me-3"],["type","text","autoNum","","id","pointInput",1,"form-control","input-point",3,"ngModelChange","ngModel","max"],[1,"me-3","d-flex","align-items-center","justify-content-center"],[1,"fs-1"],[1,"mt-8"],[1,"mb-6","text-center"],[1,"text-center"],["type","button",1,"btn","btn-light","btn-sm","p-3","w-75",3,"click","disabled"],[1,"d-flex","align-items-center"],[1,"fa-brands","fa-whatsapp","fs-2","ps-2",2,"color","#25d366"],[1,"fs-5","w-100",3,"ngClass"],[1,"mt-4","text-center"],[1,"ps-2","fa-solid","fa-envelope","fs-3",2,"color","#c71610"],["type","button","matTooltip","Inform the customer to download the Brand Loyalty App and setup PIN in Profile Menu to authorize Point Redemption","matTooltipPosition","right","matTooltipClass","primary-tooltip",1,"btn","btn-light","btn-sm","p-3","w-75",3,"click"],[1,"ps-2","fa-solid","fa-key","fs-3"],[1,"fs-5","w-100"],[1,"mt-8","d-flex","justify-content-center"],[1,"text-center","alert","alert-warning","py-4","px-8","mb-0"],[1,"fw-bold","text-danger",2,"font-size","13px"],["href","https://support.dealpos.com/en/articles/9158486-redeem-loyalty-point-authorization-using-otp","target","_blank"],[1,"d-flex","justify-content-center","mt-12"],[1,"btn","btn-success",3,"click"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"div",1)(2,"input",2),w("ngModelChange",function(l){return D(i.pointUsed,l)||(i.pointUsed=l),l}),_("ngModelChange",function(){return i.onPointUsedChange()}),a()(),r(3,"div",3)(4,"span",1),m(5,"Of"),a(),r(6,"span",4),m(7),b(8,"number"),a()(),r(9,"div"),m(10,"Points"),a()(),g(11,Ja,22,10,"div",5)(12,Ga,16,0)),e&2&&(s(2),M("ngModel",i.pointUsed),p("max",i.pointBalance),s(5),T(x(8,4,i.pointBalance)),s(4),R(i.isVerifyEnabled?11:12))},dependencies:[te,H,X,gt,mt,Ce,ie,G,ne,Ye,se],styles:[".input-point[_ngcontent-%COMP%]{width:120px;height:44px;font-size:1.375rem;text-align:center}"]})};var za=n=>({"error-input":n});function Ka(n,t){if(n&1&&(r(0,"span"),m(1),a()),n&2){let e=c(3);s(),y(" ",e.config.separator," ")}}function Ya(n,t){if(n&1){let e=v();I(0),r(1,"input",5,0),_("paste",function(o){u(e);let l=c(2);return f(l.handlePaste(o))})("keyup",function(o){let l=u(e).index,C=c(2);return f(C.onKeyUp(o,l))})("input",function(o){let l=u(e).index,C=c(2);return f(C.onInput(o,l))})("keydown",function(o){let l=u(e).index,C=c(2);return f(C.onKeyDown(o,l))}),a(),g(3,Ka,2,1,"span",6),O()}if(n&2){let e=t.$implicit,i=t.index,o=t.last,l=c(2);s(),to("otp-input ",l.config.inputClass,""),p("pattern",l.config.allowNumbersOnly?"\\d*":"")("type",l.inputType)("placeholder",(l.config==null?null:l.config.placeholder)||"")("ngStyle",l.config.inputStyles)("formControl",l.otpForm.controls[e])("id",l.getBoxId(i))("ngClass",E(11,za,(l.config==null?null:l.config.showError)&&(l.formControl==null?null:l.formControl.invalid)&&((l.formControl==null?null:l.formControl.dirty)||(l.formControl==null?null:l.formControl.touched)))),s(2),p("ngIf",l.config.separator&&!o)}}function Xa(n,t){if(n&1){let e=v();r(0,"div",2),_("focusin",function(){u(e);let o=c();return f(o.onFocusIn())})("focusout",function(){u(e);let o=c();return f(o.onFocusOut())}),r(1,"div",3),g(2,Ya,4,13,"ng-container",4),a()()}if(n&2){let e=c();to("ng-otp-input-wrapper wrapper ",e.config.containerClass,""),Eo("id","c_",e.componentKey,""),p("ngStyle",e.config.containerStyles),s(2),p("ngForOf",e.controlKeys)}}var _t=class{static ifTab(t){return this.ifKey(t,"Tab")}static ifDelete(t){return this.ifKey(t,"Delete;Del")}static ifBackspace(t){return this.ifKey(t,"Backspace")}static ifRightArrow(t){return this.ifKey(t,"ArrowRight;Right")}static ifLeftArrow(t){return this.ifKey(t,"ArrowLeft;Left")}static ifSpacebar(t){return this.ifKey(t,"Spacebar; ")}static ifKey(t,e){return e.split(";").some(o=>o===t.key)}},Ci=class{static keys(t){return t?Object.keys(t):[]}},po=(()=>{class n{set disabled(e){this.setDisabledState(e)}get inputType(){return this.config?.isPasswordInput?"password":this.config?.allowNumbersOnly?"tel":"text"}get controlKeys(){return Ci.keys(this.otpForm?.controls)}get formControl(){return this.formCtrl??this.inj?.get(qo)}constructor(e,i){this.document=e,this.inj=i,this.config={length:4},this.onBlur=new J,this.onInputChange=new J,this.inputControls=new Array(this.config.length),this.componentKey=Math.random().toString(36).substring(2)+new Date().getTime().toString(36),this.destroy$=new J,this.activeFocusCount=0,this.onChange=()=>{},this.onTouched=()=>{},this._isDisabled=!1}ngOnInit(){this.otpForm=new $o({});for(let e=0;e<this.config.length;e++)this.otpForm.addControl(this.getControlName(e),new vt);this.otpForm.valueChanges.pipe(k(this.destroy$)).subscribe(e=>{Ci.keys(this.otpForm.controls).forEach(i=>{var o=this.otpForm.controls[i].value;o&&o.length>1&&(o.length>=this.config.length?this.setValue(o):this.rebuildValue())})})}setDisabledState(e){this._isDisabled=e,this.otpForm&&(e?this.otpForm.disable({emitEvent:!1}):this.otpForm.enable({emitEvent:!1}))}writeValue(e){this.currentVal=this.hasVal(e)?e:null,this.setValue(this.currentVal)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}onFocusIn(){this.onTouched(),this.activeFocusCount++}onFocusOut(){setTimeout(()=>{this.activeFocusCount--,this.activeFocusCount===0&&(this.onTouched(),this.onBlur.next())},0)}ngAfterViewInit(){if(!this.config.disableAutoFocus){let e=this.document.getElementById(`c_${this.componentKey}`);if(e){let i=e.getElementsByClassName("otp-input")[0];i&&i.focus&&i.focus()}}}getControlName(e){return`ctrl_${e}`}onKeyDown(e,i){let o=this.getBoxId(i-1),l=this.getBoxId(i);if(_t.ifKey(e,"Enter")){let N=this.document.getElementById(l)?.closest("form");if(N){e.preventDefault(),N.dispatchEvent(new Event("submit"));return}}if(_t.ifSpacebar(e))return e.preventDefault(),!1;if(_t.ifBackspace(e)){e.target.value?this.clearInput(l,i):(this.clearInput(o,i-1),this.setSelected(o)),this.rebuildValue();return}if(_t.ifDelete(e)){e.target.value?this.clearInput(l,i):(this.clearInput(o,i-1),this.setSelected(o)),this.rebuildValue();return}}hasVal(e){return e!=null&&e!=null&&(!e?.trim||e.trim()!="")}onInput(e,i){let o=this.hasVal(this.currentVal)?`${this.currentVal}${e.target.value}`:e.target.value;if(this.config.allowNumbersOnly&&!this.validateNumber(o)){e.target.value=null,e.stopPropagation(),e.preventDefault(),this.clearInput(null,i);return}if(this.ifValidKeyCode(null,e.target.value)){let l=this.getBoxId(i+1);this.setSelected(l),this.rebuildValue()}else{e.target.value=null;let l=this.getControlName(i);this.otpForm.controls[l]?.setValue(null),this.rebuildValue()}}onKeyUp(e,i){_t.ifTab(e)&&(i-=1);let o=this.getBoxId(i+1),l=this.getBoxId(i-1);if(_t.ifRightArrow(e)){e.preventDefault(),this.setSelected(o);return}if(_t.ifLeftArrow(e)){e.preventDefault(),this.setSelected(l);return}}validateNumber(e){return e&&/^[0-9]+$/.test(e)}getBoxId(e){return`otp_${e}_${this.componentKey}`}clearInput(e,i){let o=this.getControlName(i);if(this.otpForm.controls[o]?.setValue(null),e){let l=this.document.getElementById(e);l&&l instanceof HTMLInputElement&&(l.value=null)}}setSelected(e){this.focusTo(e);let i=this.document.getElementById(e);i&&i.setSelectionRange&&setTimeout(()=>{i.setSelectionRange(0,1)},0)}ifValidKeyCode(e,i){let o=i??e.key;return this.config?.allowNumbersOnly?this.validateNumber(o):/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)||/^[a-zA-Z0-9%*_\-@#$!]$/.test(o)&&o.length==1}focusTo(e){let i=this.document.getElementById(e);i&&i.focus()}setValue(e){if(!(this.config.allowNumbersOnly&&isNaN(e))){if(this.otpForm?.reset(),!this.hasVal(e)){this.rebuildValue();return}e=e.toString().replace(/\s/g,""),Array.from(e).forEach((i,o)=>{this.otpForm.get(this.getControlName(o))&&this.otpForm.get(this.getControlName(o)).setValue(i)}),this.config.disableAutoFocus||setTimeout(()=>{let i=this.document.getElementById(`c_${this.componentKey}`);var o=e.length<this.config.length?e.length:this.config.length-1;let l=i.getElementsByClassName("otp-input")[o];l&&l.focus&&setTimeout(()=>{l.focus()},1)},0),this.rebuildValue()}}rebuildValue(){let e=null;Ci.keys(this.otpForm.controls).forEach(i=>{let o=this.otpForm.controls[i].value;if(o){let l=o.length>1,C=!this.config.allowNumbersOnly&&this.config.letterCase&&(this.config.letterCase.toLocaleLowerCase()=="upper"||this.config.letterCase.toLocaleLowerCase()=="lower");o=o[0];let N=C?this.config.letterCase.toLocaleLowerCase()=="upper"?o.toUpperCase():o.toLowerCase():o;C&&N==o?C=!1:o=N,e==null?e=o:e+=o,(l||C)&&this.otpForm.controls[i].setValue(o)}}),this.currentVal!=e&&(this.currentVal=e,this.onChange(e),this.formCtrl?.setValue&&this.formCtrl.setValue(e),this.onInputChange.next(e))}handlePaste(e){let i=e.clipboardData||window.clipboardData;if(i)var o=i.getData("Text");e.stopPropagation(),e.preventDefault(),!(!o||this.config.allowNumbersOnly&&!this.validateNumber(o))&&this.setValue(o)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||n)(d(Ao),d(Oo))}}static{this.\u0275cmp=P({type:n,selectors:[["ng-otp-input"],["ngx-otp-input"]],inputs:{config:"config",formCtrl:"formCtrl",disabled:"disabled"},outputs:{onBlur:"onBlur",onInputChange:"onInputChange"},features:[st([{provide:Wo,useExisting:xo(()=>n),multi:!0}])],decls:1,vars:1,consts:[["inp",""],["tabindex","0",3,"class","id","ngStyle","focusin","focusout",4,"ngIf"],["tabindex","0",3,"focusin","focusout","id","ngStyle"],[1,"n-o-c"],[4,"ngFor","ngForOf"],["autocomplete","one-time-code",3,"paste","keyup","input","keydown","pattern","type","placeholder","ngStyle","formControl","id","ngClass"],[4,"ngIf"]],template:function(i,o){i&1&&g(0,Xa,3,7,"div",1),i&2&&p("ngIf",o.otpForm==null?null:o.otpForm.controls)},dependencies:[Ke,ie,G,zo,St,Q,_e,Lo,H],styles:[".otp-input[_ngcontent-%COMP%]{width:50px;height:50px;border-radius:4px;border:solid 1px #c5c5c5;text-align:center;font-size:32px}.ng-otp-input-wrapper[_ngcontent-%COMP%] .otp-input[_ngcontent-%COMP%]{margin:0 .51rem}.ng-otp-input-wrapper[_ngcontent-%COMP%] .otp-input[_ngcontent-%COMP%]:first-child{margin-left:0}.ng-otp-input-wrapper[_ngcontent-%COMP%] .otp-input[_ngcontent-%COMP%]:last-child{margin-right:0}.n-o-c[_ngcontent-%COMP%]{display:flex;align-items:center}.error-input[_ngcontent-%COMP%]{border-color:red}@media screen and (max-width: 767px){.otp-input[_ngcontent-%COMP%]{width:40px;font-size:24px;height:40px}}@media screen and (max-width: 420px){.otp-input[_ngcontent-%COMP%]{width:30px;font-size:18px;height:30px}}"]})}}return n})(),un=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=ht({type:n})}static{this.\u0275inj=Ct({imports:[po]})}}return n})();function el(n,t){if(n&1&&(r(0,"div"),m(1," OTP has been sent to "),r(2,"span",5),m(3),a()()),n&2){let e=c();s(3),T(e.contact)}}function tl(n,t){if(n&1&&h(0,"ng-otp-input",3),n&2){let e=c(2);p("formCtrl",e.otpCtrl)("config",e.otpConfig)}}function il(n,t){if(n&1&&g(0,tl,1,2,"ng-otp-input",3),n&2){let e=c();R(e.showPinInput()?0:-1)}}function nl(n,t){if(n&1&&h(0,"ng-otp-input",3),n&2){let e=c();p("formCtrl",e.otpCtrl)("config",e.otpConfig)}}function ol(n,t){if(n&1){let e=v();r(0,"div",4)(1,"span"),m(2,"Didn`t get a code? "),a(),r(3,"a",6),_("click",function(){u(e);let o=c();return f(o.onResendCode())}),m(4,"Click to resend"),a()()}}var fn=class n{type;contact;clearPin=!1;onVerify=new He;resendCode=new He;showPinInput=z(!0);otpCtrl=new vt;otpConfig={length:6,inputStyles:{width:"3rem",height:"3rem"},isPasswordInput:!1,placeholder:"-"};constructor(){this.listenOtpChange()}ngOnChanges(t){let{clearPin:e}=t;e?.currentValue&&(this.showPinInput.set(!1),setTimeout(()=>{this.showPinInput.set(!0)},0)),this.type&&(this.otpConfig.isPasswordInput=this.type==="pin")}onResendCode(){this.resendCode.emit()}listenOtpChange(){this.otpCtrl.valueChanges.pipe(yo(300),ce(t=>t.length===6)).subscribe(t=>{this.onVerify.emit(t)})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=P({type:n,selectors:[["verify-step"]],inputs:{type:"type",contact:"contact",clearPin:"clearPin"},outputs:{onVerify:"onVerify",resendCode:"resendCode"},features:[Io],decls:8,vars:4,consts:[[1,"text-center","mb-10"],[1,"mb-3","fw-normal"],[1,"d-flex","justify-content-center"],[3,"formCtrl","config"],[1,"mt-4","text-start"],[1,"fw-bold"],[1,"link-primary","cursor-pointer",3,"click"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"h4",1),m(2),a(),g(3,el,4,1,"div"),a(),r(4,"div",2),g(5,il,1,1)(6,nl,1,2,"ng-otp-input",3),a(),g(7,ol,5,0,"div",4)),e&2&&(s(2),y(" Confirm Your ",i.type=="pin"?"PIN":"OTP"," "),s(),R(i.type!="pin"?3:-1),s(2),R(i.type=="pin"?5:6),s(2),R(i.type!="pin"?7:-1))},dependencies:[te,un,po,Ke],encapsulation:2})};function rl(n,t){if(n&1){let e=v();r(0,"button",7),_("click",function(){u(e);let o=c();return f(o.onCancel())}),m(1,"Cancel"),a()}}function al(n,t){if(n&1){let e=v();r(0,"button",8),_("click",function(){u(e);let o=c();return f(o.onConfirm())}),m(1,"Confirm"),a()}}var gn=class n{pointUsed=lt(0);redeemPointValue=lt(0);showCancelBtn=lt(!1);confirmEvent=new He;cancelEvent=new He;onConfirm(){this.confirmEvent.emit()}onCancel(){this.cancelEvent.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=P({type:n,selectors:[["confirm-step"]],inputs:{pointUsed:[1,"pointUsed"],redeemPointValue:[1,"redeemPointValue"],showCancelBtn:[1,"showCancelBtn"]},outputs:{confirmEvent:"onConfirm",cancelEvent:"onCancel"},decls:19,vars:7,consts:[[1,"text-center"],[1,"fs-5"],[1,"d-flex","justify-content-center","text-success","align-items-center"],[1,"me-3",2,"font-size","1.5rem"],[1,"d-flex","justify-content-center","text-danger","align-items-center"],[1,"btn","btn-danger","mt-12"],[1,"btn","btn-success","mt-12"],[1,"btn","btn-danger","mt-12",3,"click"],[1,"btn","btn-success","mt-12",3,"click"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"div",1),m(2,"Redeem"),a(),r(3,"div",2)(4,"span",3),m(5),b(6,"number"),a(),r(7,"small"),m(8,"Point"),a()(),r(9,"div",1),m(10,"~"),a(),r(11,"div",4)(12,"span",3),m(13),b(14,"number"),a(),r(15,"small"),m(16,"Discount"),a()(),g(17,rl,2,0,"button",5)(18,al,2,0,"button",6),a()),e&2&&(s(5),T(x(6,3,i.pointUsed())),s(8),T(x(14,5,i.pointUsed()*i.redeemPointValue())),s(4),R(i.showCancelBtn()?17:18))},dependencies:[te,X],encapsulation:2})};var ei=class n{constructor(t,e,i,o,l,C,N,re,ke){this.customerHttpService=t;this.salesOrderService=e;this.pageInitialService=i;this.shoppingCartService=o;this.invoiceCalculatorService=l;this.orderProcessorService=C;this.toastr=N;this.promotionCouponService=re;this.httpService=ke}customerId;customerData;_isCustomerVerfiedOtp=!1;get isCustomerVerfiedOtp(){return this._isCustomerVerfiedOtp}addCustomerById(t){return new bo(e=>{this.customerId=JSON.parse(JSON.stringify(this.salesOrderService.Data.Order.CustomerID)),this.resetCartOnChangeCustomer(t),S.IsNotEmpty(t)&&this.salesOrderService.updateCustomerID(t).then(i=>{this.applyCustomerPricebook(i),this.updateTaxCustomer(i.TaxTypeId),this.setSalesOrderCustomerId(i),this.setCustomerData(i),this.customerData.DiscountRate==null&&(this.customerData.DiscountRate=0),this._isCustomerVerfiedOtp=!1,this.applyConfigFullPriceOnly(),this.salesOrderService.pushNewValue();let o=this.checkResetRedeemPoint();this.orderProcessorService.reedemPointToDiscount(o),e.next(i)})})}addCustomerByCode(t){return this.salesOrderService.Data.ContactName=null,this.customerHttpService.findCustomerByCode(t).pipe(Te(e=>(this.salesOrderService.Data.ContactName=e.Display,this.addCustomerById(e.ID))))}setSalesOrderCustomerId(t){let e=this.salesOrderService.Data;S.IsNotEmpty(t.SalesID)&&(e.Order.SalesID=t.SalesID)}setCustomerData(t){let e=this.salesOrderService.Data;if(t.EntityID==S.GuidEmpty)this.customerData=t;else if(t.EntityID!=e.Order.EntityID){e.Order.CustomerID=null,e.ContactName=null;let i=`${t?.Name} is exclusive to ${t?.EntityName} Outlet and cannot be used in other outlets!`;alert(i)}else this.customerData=t}checkResetRedeemPoint(){let t=!1;return S.IsNotEmpty(this.customerId)&&(t=!0),t}applyCustomerPricebook(t){let e=this.salesOrderService.Data;if(S.IsNotEmpty(t.PricebookID)){let i=e.CartItems.map(o=>(o.Variant.PriceBook&&o.Variant.PriceBook.length!==0&&o.Variant.PriceBook.forEach(l=>{l.ID===t.PricebookID&&o.Quantity>=l.MinimumQuantity&&(o=this.shoppingCartService.applyPricebookToItem(o,l))}),o));e.CartItems=i}}updateTaxCustomer(t){let i=this.pageInitialService.Data.Taxes.find(o=>o.ID==t);i&&(this.salesOrderService.Data.Order.TaxTypeID=i.ID,this.invoiceCalculatorService.tax=i)}resetCartOnChangeCustomer(t){let e=this.pageInitialService.Data.AppConfigJSON;this.customerId!=t&&e.ModuleSell.Customer.ClearCartOnChange&&(this.salesOrderService.Data.CartItems=[]),this.customerId=t}updateDiscountRate(t=0){if(t>0){let e=this.promotionCouponService.coupon,i=this.salesOrderService.Data.Order.Discount;e&&e.Requirement?.Type==1?i==e.Amount?t>e.Amount&&(this.toastr.warning("Member discount is applied because member discount is greater than Coupon Discount","Warning"),this.promotionCouponService.removeAppliedDiscountOnCustomerChange(),this.salesOrderService.Data.Order.Discount=t):(this.salesOrderService.Data.Order.Discount=t,this.salesOrderService.Data.Order.CustomerDiscountRate=t):(this.salesOrderService.Data.Order.Discount=t,this.salesOrderService.Data.Order.CustomerDiscountRate=t)}}applyConfigFullPriceOnly(){let t=this.filterGroupByDiscountRate(),e=this.salesOrderService.Data.CartItems;t?.OrderDiscountFullPriceProductOnly?this.filterItemWithDisc(e).length>0?e=this.applyItemsDisc(e,this.customerData.DiscountRate):this.updateDiscountRate(this.customerData.DiscountRate):this.updateDiscountRate(this.customerData.DiscountRate)}filterGroupByDiscountRate(){let e=(this.customerData?.Groups?this.customerData?.Groups:[]).filter(o=>o.OrderDiscountPercentage==this.customerData.DiscountRate),i;return e.length>1?(i=e.find(o=>o.OrderDiscountFullPriceProductOnly==!0),i||(i=e[0])):i=e[0],i}applyItemsDisc(t,e){return t=t.map(i=>(i.Discount==0&&i.DiscountAmount==0&&i.PriceTypeID!=3&&i.Price==i.UnitPrice&&S.IsEmpty(i.PriceBookID)&&(i.Discount=e,i.HasCustomerDiscount=!0),i)),t}filterItemWithDisc(t){return t.filter(i=>i.Discount>0||i.DiscountAmount>0||i.PriceTypeID==3||i.Price!=i.UnitPrice||S.IsNotEmpty(i.PriceBookID))}onEmptyInputCustomer(){S.IsNotEmpty(this.customerId)&&(this.promotionCouponService.removeAppliedDiscountOnCustomerChange(),this.resetAppliedPoint(),this.resetCustomerPricebook(),this.removeCustomerDiscountRate()),this.orderProcessorService.Data.InputTextValue="",this.customerId=JSON.parse(JSON.stringify(this.salesOrderService.Data.Order.CustomerID)),this._isCustomerVerfiedOtp=!1,this.customerData=null,this.salesOrderService.Data.ContactName=null,this.salesOrderService.Data.Order.CustomerID=null,this.customerHttpService.Data=new io,this.customerData=new io,this.salesOrderService.pushNewValue()}removeCustomerDiscountRate(){let t=this.filterGroupByDiscountRate(),e=this.salesOrderService.Data.CartItems;t?.OrderDiscountFullPriceProductOnly?this.filterItemWithDisc(e).length>0?this.salesOrderService.Data.CartItems=e.map(o=>(o.HasCustomerDiscount&&(o.Discount=0,o.HasCustomerDiscount=!1),o)):(this.salesOrderService.Data.Order.Discount=0,this.salesOrderService.Data.Order.CustomerDiscountRate=0):(this.salesOrderService.Data.Order.Discount=0,this.salesOrderService.Data.Order.CustomerDiscountRate=0)}resetCustomerPricebook(){if(this.customerData){let t=this.customerData.PricebookID;if(S.IsNotEmpty(t)){let e=this.salesOrderService.Data.CartItems;this.salesOrderService.Data.CartItems=e.map(i=>(i.PriceBookID==t&&(i.Discount=i.Variant.PriceDiscount,i.Note=i.Variant.PriceNote,i.PriceNote=i.Variant.PriceNote,i.PriceBookID=S.GuidEmpty,i.Price=i.Variant.UnitPrice,i.UnitPrice=i.Variant.UnitPrice),i))}}}resetAppliedPoint(){let t=this.salesOrderService.Data;t.Order.PointUsed>0&&(t.Order.PointUsed=0,t.Order.DiscountAmount=0)}redeemPoint(t){let e=this.pageInitialService.Data.AppConfigJSON,i=this.salesOrderService.Data,o=e.ApplicationLoyalty.LoyaltyPoint.RedeemPointValue,l=t*o,C=i.RedeemableAmount;l>C&&(o>0?(t=Math.ceil(C/o),l=C):(t=0,l=0),this.toastr.warning("You enter the number of points more than the total amount","Points Adjusted")),i.Order.PointUsed=t||0,i.Order.DiscountAmount=l,this.salesOrderService.pushNewValue(i)}sendOtpViaEmail(t){return this.httpService.post("/API/otp/email",{Email:t})}sendOtpViaWhatsApp(t){return this.httpService.post("/API/otp/WhatsApp",{Number:t})}verifyEmailOtp(t,e){return this.httpService.post("/API/otp/verifyemail",{Email:t,OTP:e}).pipe(Ee(()=>this._isCustomerVerfiedOtp=!0))}verifyPin(t,e){return this.httpService.post("/API/pos/VerifyPin",{PIN:t,CustomerID:e}).pipe(Ee(()=>this._isCustomerVerfiedOtp=!0))}verifyWhatsAppOtp(t,e){return this.httpService.post("/API/otp/verifywhatsapp",{Number:t,OTP:e}).pipe(Ee(()=>this._isCustomerVerfiedOtp=!0))}get pointBalanced(){let t=this.customerHttpService.Data.Point,e=this.customerHttpService.Data.PointUsed;return(t||0)-(e||0)}static \u0275fac=function(e){return new(e||n)(L(ut),L(V),L(B),L(Me),L(Pe),L(j),L(Z),L(Ze),L(Ne))};static \u0275prov=Ge({token:n,factory:n.\u0275fac,providedIn:"root"})};var cl=["stepper"];function pl(n,t){n&1&&m(0,"Points")}function ml(n,t){n&1&&m(0,"Verify")}function dl(n,t){n&1&&m(0,"Confirm")}var ti=class n{dialogRef=Y(F);outletRegisterService=Y(ee);pageInitialService=Y(B);customerHttpService=Y(ut);customerService=Y(ei);orderService=Y(V);toastr=Y(Z);modalConfig;enabledLoyaltyPoint=z(!1);stepper;pointUsed=0;pointBalance=z(0);redeemPointValue=z(0);email=z(null);phone=z(null);contactToResend=z(null);verifyType=z(null);clearPin=z(!1);selectedTab=z(0);constructor(){this.initModalConfig();let t=this.pageInitialService.Data.AppConfigJSON;this.redeemPointValue.set(t?.ApplicationLoyalty?.LoyaltyPoint?.RedeemPointValue),this.email.set(this.customerHttpService.Data?.Email),this.phone.set(this.customerHttpService.Data?.Mobile),this.initAvailablePoint(),this.initConfigEnabledVerify(),this.initPointUsed()}initModalConfig(){this.modalConfig=new U,this.modalConfig.title="Redeem Point",this.modalConfig.customWidth="500px",this.modalConfig.hideFooter=!0}initConfigEnabledVerify(){let t=this.pageInitialService.Data.AppConfigJSON,e=t?.ApplicationLoyalty?.VerifyRedemption,i=t?.ApplicationLoyalty?.Enabled,o=this.outletRegisterService.Data?.MemberPoint;this.enabledLoyaltyPoint.set(e&&i&&o)}initPointUsed(){let t=this.orderService.Data?.Order?.PointUsed;this.pointUsed=t||0,this.pointUsed>0&&this.selectedTab.set(2)}initAvailablePoint(){let t=this.customerHttpService.Data.Point,e=this.customerHttpService.Data.PointUsed,i=(t||0)-(e||0);this.pointBalance.set(i)}onClose(){this.dialogRef.close()}onCancelRedeem(){let t=this.orderService.Data;t.Order.PointUsed=0,t.Order.DiscountAmount=0,this.orderService.pushNewValue(t),this.toastr.info("Redeem point has been canceled","Canceled"),this.onClose()}onRedeem(){this.stepper.next(),this.stepper.next()}onVerify(t){switch(t){case"phone":this.contactToResend.set(this.phone()),this.handlingSentOtpViaPhone();break;case"email":this.contactToResend.set(this.email()),this.handlingSentOtpViaEmail();break;case"pin":this.stepper.next();break}this.verifyType.set(t)}handlingSentOtpViaPhone(){this.customerService.sendOtpViaWhatsApp(this.phone()).subscribe(t=>{this.stepper.selectedIndex==0&&this.stepper.next(),this.toastr.success(`OTP has been sent to ${this.phone()}`,"OTP Sent")})}handlingSentOtpViaEmail(){this.customerService.sendOtpViaEmail(this.email()).subscribe(t=>{this.stepper.selectedIndex==0&&this.stepper.next(),this.toastr.success(`OTP has been sent to ${this.email()}`,"Email Sent")})}onVerifyCode(t){switch(this.verifyType()){case"phone":this.verifyPhoneOtp(t);break;case"email":this.verifyEmailOtp(t);break;case"pin":this.verifyCustomerPin(t);break}}verifyEmailOtp(t){this.customerService.verifyEmailOtp(this.email(),t).subscribe(e=>{this.toastr.success(e.Message,"Successfully verified"),this.stepper.next()})}verifyPhoneOtp(t){this.customerService.verifyWhatsAppOtp(this.phone(),t).subscribe(e=>{this.toastr.success(e.Message,"Successfully verified"),this.stepper.next()})}verifyCustomerPin(t){let e=this.orderService.Data?.Order?.CustomerID;this.clearPin.set(!1),this.customerService.verifyPin(t,e).subscribe({next:i=>{this.toastr.success(i.Message,"Successfully verified"),this.stepper.next()},error:i=>{this.clearPin.set(!0)}})}onResendCode(){this.onVerify(this.verifyType())}onConfirm(){this.calculatePointToDiscount()}calculatePointToDiscount(){let t=this.pageInitialService.Data.AppConfigJSON,e=this.orderService.Data,i=e.RedeemableAmount,o=this.pointUsed,l=t.ApplicationLoyalty.LoyaltyPoint.RedeemPointValue,C=this.pointUsed*l;C>i&&(o=Math.ceil(i/l),C=i),(S.IsNotEmpty(e.Order.PointUsed)?e.Order.PointUsed:0)!=o&&(e.Order.PointUsed=o||0,e.Order.DiscountAmount=C,this.orderService.pushNewValue(e),this.toastr.success("Point has been redeemed","Success")),this.dialogRef.close()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=P({type:n,selectors:[["modal-redeem-point"]],viewQuery:function(e,i){if(e&1&&ve(cl,5),e&2){let o;Se(o=ye())&&(i.stepper=o.first)}},decls:18,vars:18,consts:[["stepper",""],[3,"onClose","preventEnterEvent","config"],[1,"container"],[1,"d-flex","justify-content-center"],[1,"sell-stepper-redeem",3,"linear","selectedIndex"],[3,"editable","aria-labelledby"],["matStepLabel",""],[1,"mt-10"],[3,"onVerify","pointUsedChange","onRedeem","isVerifyEnabled","pointUsed","pointBalance","email","phone"],["aria-labelledby","stepDisabled",3,"editable"],[3,"resendCode","onVerify","type","contact","clearPin"],["aria-labelledby","stepDisabled"],[3,"onConfirm","onCancel","pointUsed","redeemPointValue","showCancelBtn"]],template:function(e,i){if(e&1){let o=v();r(0,"modal-material",1),_("onClose",function(){return u(o),f(i.onClose())}),r(1,"content")(2,"div",2)(3,"div",3)(4,"mat-stepper",4,0)(6,"mat-step",5),g(7,pl,1,0,"ng-template",6),r(8,"div",7)(9,"point-step",8),_("onVerify",function(C){return u(o),f(i.onVerify(C))}),w("pointUsedChange",function(C){return u(o),D(i.pointUsed,C)||(i.pointUsed=C),f(C)}),_("onRedeem",function(){return u(o),f(i.onRedeem())}),a()()(),r(10,"mat-step",9),g(11,ml,1,0,"ng-template",6),r(12,"div",7)(13,"verify-step",10),_("resendCode",function(){return u(o),f(i.onResendCode())})("onVerify",function(C){return u(o),f(i.onVerifyCode(C))}),a()()(),r(14,"mat-step",11),g(15,dl,1,0,"ng-template",6),r(16,"div",7)(17,"confirm-step",12),_("onConfirm",function(){return u(o),f(i.onConfirm())})("onCancel",function(){return u(o),f(i.onCancelRedeem())}),a()()()()()()()()}e&2&&(p("preventEnterEvent",!0)("config",i.modalConfig),s(4),p("linear",!0)("selectedIndex",i.selectedTab()),s(2),p("editable",!0)("aria-labelledby",i.selectedTab()==2?"stepDisabled":""),s(3),p("isVerifyEnabled",i.enabledLoyaltyPoint()),M("pointUsed",i.pointUsed),p("pointBalance",i.pointBalance())("email",i.email())("phone",i.phone()),s(),p("editable",!1),s(3),p("type",i.verifyType())("contact",i.contactToResend())("clearPin",i.clearPin()),s(4),p("pointUsed",i.pointUsed)("redeemPointValue",i.redeemPointValue())("showCancelBtn",i.selectedTab()==2))},dependencies:[te,Ae,W,Ce,ea,Xr,Yr,Zr,mn,fn,gn],styles:['@import"https://fonts.googleapis.com/icon?family=Material+Icons"; mat-stepper.sell-stepper-redeem .mat-horizontal-stepper-header{height:50px!important} mat-stepper.sell-stepper-redeem .mat-horizontal-stepper-header .mat-step-label{min-width:0px!important} mat-stepper.sell-stepper-redeem .mat-horizontal-stepper-header[aria-labelledby=stepDisabled]{pointer-events:none!important}']})};function ul(n,t){if(n&1){let e=v();I(0),r(1,"div",16),_("click",function(){u(e);let o=c(2);return f(o.onShowModalRedeem())}),r(2,"span"),h(3,"i",17),a(),r(4,"span"),m(5),b(6,"number"),a()(),O()}if(n&2){let e=c(2);s(5),y(" ",x(6,1,e.pointUsed)," Points redeemed ")}}function fl(n,t){if(n&1){let e=v();I(0),r(1,"tab",4)(2,"div",5)(3,"div",6)(4,"label",7),m(5,"Discount %"),a()(),r(6,"div",8)(7,"input",9),w("ngModelChange",function(o){u(e);let l=c();return D(l.discount1,o)||(l.discount1=o),f(o)}),a(),r(8,"span",10),m(9,"%"),a(),r(10,"span",11),m(11,"+"),a(),r(12,"input",12),w("ngModelChange",function(o){u(e);let l=c();return D(l.discount2,o)||(l.discount2=o),f(o)}),a(),r(13,"span",10),m(14,"%"),a()()(),r(15,"div",13)(16,"div",6)(17,"label",7),m(18),a()(),r(19,"div",14)(20,"input",15),w("ngModelChange",function(o){u(e);let l=c();return D(l.discountAmount,o)||(l.discountAmount=o),f(o)}),a(),g(21,ul,7,3,"ng-container",3),a()()(),O()}if(n&2){let e=c();s(),p("active",e.tabActive=="Discount"),s(6),M("ngModel",e.discount1),s(5),M("ngModel",e.discount2),s(6),y("Discount ",e.currencySymbol,""),s(2),p("disabled",e.pointUsed&&e.pointUsed>0),M("ngModel",e.discountAmount),s(),p("ngIf",e.pointUsed&&e.pointUsed>0)}}function gl(n,t){if(n&1){let e=v();I(0),r(1,"tab",18)(2,"div",5)(3,"div",6)(4,"label",7),m(5,"Tax"),a()(),r(6,"div",8)(7,"ng-select",19),_("change",function(o){u(e);let l=c();return f(l.updateTax(o))}),a()()(),r(8,"div",13)(9,"div",6)(10,"label",7),m(11,"Surcharge"),a()(),r(12,"div",8)(13,"input",20),w("ngModelChange",function(o){u(e);let l=c();return D(l.surcharge,o)||(l.surcharge=o),f(o)}),a(),r(14,"span",10),m(15,"%"),a()()()(),O()}if(n&2){let e=c();s(7),p("clearable",!1)("ngModel",e.salesOrder.Order.TaxTypeID)("items",e.taxes),s(6),M("ngModel",e.surcharge),p("max",100)("min",-100)}}function _l(n,t){if(n&1){let e=v();I(0),r(1,"tab",21)(2,"div",5)(3,"div",22)(4,"strong"),m(5,"Discount After Tax"),a()(),r(6,"div",23)(7,"input",24),w("ngModelChange",function(o){u(e);let l=c();return D(l.discountAfterTax,o)||(l.discountAfterTax=o),f(o)}),_("ngModelChange",function(){u(e);let o=c();return f(o.onDiscountAfterTaxChange())}),a()()(),r(8,"div",25)(9,"div",22)(10,"label",7),m(11,"Discount Calculator"),a()(),r(12,"div",26)(13,"input",27),w("ngModelChange",function(o){u(e);let l=c();return D(l.discounts[0],o)||(l.discounts[0]=o),f(o)}),_("ngModelChange",function(){u(e);let o=c();return f(o.calculateDiscountCalculator())}),a(),r(14,"span"),m(15," %"),a(),r(16,"span",11),m(17,"+"),a(),r(18,"input",28),w("ngModelChange",function(o){u(e);let l=c();return D(l.discounts[1],o)||(l.discounts[1]=o),f(o)}),_("ngModelChange",function(){u(e);let o=c();return f(o.calculateDiscountCalculator())}),a(),r(19,"span"),m(20," %"),a(),r(21,"span",11),m(22,"+"),a(),r(23,"input",29),w("ngModelChange",function(o){u(e);let l=c();return D(l.discounts[2],o)||(l.discounts[2]=o),f(o)}),_("ngModelChange",function(){u(e);let o=c();return f(o.calculateDiscountCalculator())}),a(),r(24,"span"),m(25," %"),a()()()(),O()}if(n&2){let e=c();s(7),M("ngModel",e.discountAfterTax),s(6),M("ngModel",e.discounts[0]),s(5),M("ngModel",e.discounts[1]),s(5),M("ngModel",e.discounts[2])}}var ii=class n{constructor(t,e,i,o,l,C,N,re,ke,$e){this.dialogRef=t;this.orderService=e;this.invoiceCalculatorService=i;this.pageInitialService=o;this.roleService=l;this.customerHttpService=C;this.orderProcessorService=N;this.promotionCouponService=re;this.dialog=ke;this.data=$e;let je=this.pageInitialService?.Data?.AppConfigJSON;this.modalConfig.title="Discount and Tax",this.modalConfig.customWidth="480px",this.salesOrder=this.orderService.Data,this.userRole=this.roleService.Data,this.isPreferedPayment=je?.ApplicationLoyalty?.PreferedPayment,this.tabActive=this.data?.tabIndexActive,this.isEditOrder=this.orderProcessorService.Data.posState==2,this.customer=C.Data,this.initDiscountAndTax(),this.initAvailablePoint(),this.initTabLoyaltyTitle()}modalConfig=new U;discount1;discount2;discountAmount;surcharge;discountAfterTax;currencySymbol;salesOrder;discounts=[];taxes;selectedTax;userRole;tabActive;isEditOrder;isPreferedPayment;customerPoint;customer;tabLoyaltyTitle;pointUsed;availablePoint;initAvailablePoint(){let t=this.customerHttpService.Data.Point,e=this.customerHttpService.Data.PointUsed;this.customerPoint=t,this.availablePoint=(t||0)-(e||0)}initTabLoyaltyTitle(){let e=this.pageInitialService?.Data?.AppConfigJSON?.ApplicationLoyalty?.Label;this.tabLoyaltyTitle=S.IsNotEmpty(e)?e:"Loyalty"}initDiscountAndTax(){this.discount1=this.salesOrder.Order.Discount,this.discount2=this.salesOrder.Order.Discount2,this.discountAmount=this.salesOrder.Order.DiscountAmount,this.surcharge=this.salesOrder.Invoice.SurchargePcg,this.discountAfterTax=this.invoiceCalculatorService.discountAfterTax,this.currencySymbol=this.invoiceCalculatorService.currencySymbol,this.taxes=this.pageInitialService.Data.Taxes,this.selectedTax=this.invoiceCalculatorService.tax,this.pointUsed=this.salesOrder.Order.PointUsed}updateTax(t){this.selectedTax=t}onOk(){this.resetAppliedCoupon(),this.applyChangesDiscountAmount(),this.salesOrder.Order.Discount=this.discount1,this.salesOrder.Order.Discount2=this.discount2,this.salesOrder.Invoice.SurchargePcg=this.surcharge,this.salesOrder.Invoice.TempSurchargePcg=this.surcharge,this.invoiceCalculatorService.discountAfterTax=this.discountAfterTax,this.salesOrder.Order.TaxTypeID=this.selectedTax.ID,this.invoiceCalculatorService.tax=this.selectedTax,this.orderService.pushNewValue(this.salesOrder),this.onClose()}onClose(){this.dialogRef.close()}calculateDiscountCalculator(){var t=100;this.discounts.forEach(e=>{t=t*(100-e)/100}),this.discount1=100-t}onDiscountAfterTaxChange(){this.discountAmount=this.discountAfterTax;let e=this.invoiceCalculatorService.TotalBeforeTax-this.discountAmount,i=this.orderService.Data.Order.TaxTypeID,o=this.pageInitialService.Data.Taxes,l=S.FilterByID(o,i);if(S.IsNotEmpty(l)&&l.CalculationTypeID==0){let C=1+l.Rate/100,N=e*C;this.discountAmount=(N-(N-this.discountAfterTax))/C}}applyChangesDiscountAmount(){let t=this.salesOrder.Order.DiscountAmount;this.discountAmount!=t&&(this.salesOrder.Order.DiscountAmount=this.discountAmount)}onTabChange(t){this.tabActive=t}resetAppliedCoupon(){let t=this.promotionCouponService.coupon,e=this.salesOrder.Order.DiscountAmount;t&&t.Requirement?.Type==2&&e!=this.discountAmount&&(this.salesOrder.Order.PromotionCoupon=null,this.salesOrder.Order.PromotionNote=null)}onShowModalRedeem(){this.onClose(),this.dialog.open(ti)}static \u0275fac=function(e){return new(e||n)(d(F),d(V),d(Pe),d(B),d(me),d(ut),d(j),d(Ze),d(oe),d(Ve))};static \u0275cmp=P({type:n,selectors:[["POS-modal-discount"]],decls:7,vars:4,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container"],[3,"onTabChange"],[4,"ngIf"],["tabTitle","Discount",3,"active"],[1,"row","d-flex","align-items-center","justify-content-start"],[1,"col-3"],[1,"fw-bold","d-block"],[1,"col-9"],["type","text","data-cy","discount1","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],[1,"ms-1"],[1,"mx-2"],["type","text","data-cy","discount2","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],[1,"row","d-flex","align-items-center","justify-content-start","mt-6"],[1,"col-9","d-flex","align-items-center"],["type","text","data-cy","discountamount","autoNum","","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","100px",3,"ngModelChange","disabled","ngModel"],["role","button",3,"click"],[1,"fa-solid","fa-info-circle","ms-2"],["matTooltipPosition","above","tabTitle","Tax"],["bindLabel","Label","appendTo","body","bindValue","ID","placeholder","Tax","data-cy","select-tax",2,"width","150px",3,"change","clearable","ngModel","items"],["type","text","data-cy","surcharge","autoNum","","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","85px",3,"ngModelChange","ngModel","max","min"],["tabTitle","Calculator"],[1,"col-4"],[1,"col-8","ps-6"],["type","text","num-neg","false","autoNum","","emptyInputBehavior","zero",1,"txtPrice","form-control",2,"width","100px",3,"ngModelChange","ngModel"],[1,"row","mt-6","g-0","d-flex","align-items-center","justify-content-start"],[1,"col-8","ps-4"],["type","text","data-cy","discountCal1","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],["type","text","data-cy","discountCal2","autoNum","","decimalPlaces","2","percentage","","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],["type","text","data-cy","discountCal3","autoNum","","percentage","","decimalPlaces","2","emptyInputBehavior","zero",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(r(0,"modal-material",0),_("keydown.F2",function(){return i.onOk()})("onOk",function(){return i.onOk()})("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),r(1,"content")(2,"div",1)(3,"custom-tabs",2),_("onTabChange",function(l){return i.onTabChange(l)}),g(4,fl,22,7,"ng-container",3)(5,gl,16,6,"ng-container",3)(6,_l,26,4,"ng-container",3),a()()()()),e&2&&(p("config",i.modalConfig),s(4),p("ngIf",i.userRole.Discount),s(),p("ngIf",i.userRole.Tax),s(),p("ngIf",i.userRole.Discount))},dependencies:[te,Q,X,Ce,ie,G,ne,Ki,$r,qr,Ae,W,ot,gt,mt,Ye],encapsulation:2})};var Cn=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=ht({type:n});static \u0275inj=Ct({imports:[te,Ce]})};var hn=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=ht({type:n});static \u0275inj=Ct({imports:[te,Ce,Ke,Ae,Qt,ot,Kr,gt,Ki,Ye,un,Wi,vr,Wt,gt,Bt,ta,or,Ti,Cn,na,It,Vi,ra,Xi,ot,ii,Rt,ki]})};var bn=class n{constructor(t,e,i,o,l,C,N){this.orderProcessorService=t;this.posDataService=e;this.signalBroadCast=i;this.calculatorService=o;this.OrderHttpService=l;this.localDataService=C;this.posService=N;this.newSale=new He}newSale;retrySubmit(){let t=this.posService.Data.AppConfigJSON,e=this.posDataService.Data;this.posDataService.submitOrder(t).then(i=>{i.Success?(this.broadcastToCustomerDisplay(i),this.posDataService.pushNewValue(e),this.orderProcessorService.updatePosState(1,i)):(this.posDataService.pushNewValue(e),this.orderProcessorService.updatePosState(1,i))}).catch(i=>{console.log(i)})}broadcastToCustomerDisplay(t){let i=this.posDataService.Data.TotalPaidAmount-this.calculatorService.Data;this.signalBroadCast.BroadcastStateToCustomerDisplay(1,t.ObjectID,t.LoyaltyPoint,i).subscribe()}saveOffline(){let t=this.posDataService.Data,e=this.OrderHttpService.generatePOSDataForSubmission(t,!1);this.localDataService.syncOrder(e).subscribe(()=>{this.newSale.next()})}static \u0275fac=function(e){return new(e||n)(d(j),d(V),d(Hi),d(Pe),d(Oe),d(Xe),d(B))};static \u0275cmp=P({type:n,selectors:[["app-retry"]],outputs:{newSale:"newSale"},decls:21,vars:0,consts:[[1,"card"],[1,"card-header","bg-gradient-danger"],[1,"d-flex","justify-content-between"],[1,"fa-solid","fa-times-circle","me-1","text-danger"],[1,"card-body"],[1,"row","justify-content-center","g-0","mt-8"],[1,"col-8","text-center"],[1,"text-danger","fs-5"],[1,"row","mt-4","justify-content-center","g-0","mb-9"],[1,"col-5","text-center"],["type","button","matTooltipPosition","above","matTooltip","Upload your local / offline order to the cloud",1,"btn","btn-success","btn-lg","fs-3",3,"click"],[1,"card-footer","bg-light-gray"],[1,"row","justify-content-between","py-6"],[1,"col-auto"],["type","button","matTooltipPosition","above","matTooltip","Temporarily save data locally until connection to the server is restored",1,"btn","btn-light-gray",3,"click"],[1,"fa-solid","fa-save","me-2",2,"font-size","14px"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),h(4,"i",3),m(5," Order Upload Fail! "),a()()(),r(6,"div",4)(7,"div",5)(8,"div",6)(9,"p",7),m(10," Slow Connection Detected, Check the customer invoice list first. If the transaction isn't there, click the 'Retry' button. "),a()()(),r(11,"div",8)(12,"div",9)(13,"button",10),_("click",function(){return i.retrySubmit()}),m(14," Retry Upload "),a()()()(),r(15,"div",11)(16,"div",12)(17,"div",13)(18,"button",14),_("click",function(){return i.saveOffline()}),h(19,"i",15),m(20,"Save Offline "),a()()()()())},dependencies:[te,Ye,se],encapsulation:2})};var fa=(()=>{class n{constructor(){this.emailRegex=S.emailRegex,this.phoneNumberRegex=S.phoneNumberRegex}validate(e){let i=this.emailRegex,o=this.phoneNumberRegex,l=i.test(e.value),C=o.test(e.value);if(l||C||e.value=="")return null;{let N="Please input a valid email or phone number";return C?N="Please input a valid email":l&&(N="Please input a valid phone number"),{invalidEmailOrPhoneNumber:{value:e.value,errMessage:N}}}}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275dir=Ii({type:n,selectors:[["","pOSIsInvalidEmailOrPhoneNumber",""]],features:[st([{provide:Qo,useExisting:n,multi:!0}])]})}}return n})();function hl(n,t){n&1&&(I(0),r(1,"div",3)(2,"h4",4),m(3," For use this feature you must register first!"),h(4,"br"),m(5," Click the link below "),a()(),r(6,"a",5),m(7,"more information"),a(),m(8," > "),O())}function bl(n,t){if(n&1){let e=v();r(0,"div",6)(1,"div",7)(2,"span",8),h(3,"i",9),a(),h(4,"input",10),r(5,"button",11),m(6,"Copy to Clipboard"),a()()(),r(7,"div",12)(8,"div",13)(9,"span",14),h(10,"i",15),a(),h(11,"input",16),r(12,"button",17),_("click",function(){u(e);let o=c();return f(o.onSendViaWhatsApp())}),m(13,"Send via WhatsApp"),a()()()}if(n&2){let e=c();s(4),p("value",e.data.link),s(),p("cdkCopyToClipboard",e.data.link),s(6),p("formControl",e.whatsAppNumberCtrl),s(),p("disabled",e.whatsAppNumberCtrl.invalid)}}var bi=class n{constructor(t,e,i){this._dialogRef=t;this._toast=e;this.data=i}modalConfig=new U;whatsAppNumberCtrl;ngOnInit(){this.modalConfig.title="Midtrans Payment Link",this.modalConfig.hideFooter=!0,this.modalConfig.customWidth="500px",this.initWaNumberCtrl()}initWaNumberCtrl(){this.whatsAppNumberCtrl=new Jo(null,[ui.pattern("^[0-9]*$"),ui.required])}close(){this._dialogRef.close()}onSendViaWhatsApp(){let t=this.whatsAppNumberCtrl.value;if(t){let e="https://wa.me/"+t+"?text="+this.data.link;window.open(e,"_blank")}else this._toast.error("Phone Number must be insert")}static \u0275fac=function(e){return new(e||n)(d(F),d(Z),d(Ve))};static \u0275cmp=P({type:n,selectors:[["POS-modal-generate-link"]],standalone:!1,decls:5,vars:3,consts:[["hasLink",""],[3,"onOk","onCancel","onClose","config"],[4,"ngIf","ngIfElse"],[1,"input-group","mb-2",2,"width","350px"],[1,"fw-normal","d-block"],["href","https://midtrans.com/id/product/payment-link","target","_blank"],[1,"col-sm-12"],[1,"input-group"],["id","inputGroup-sizing-lg p-6",1,"input-group-text"],[1,"fa-solid","fa-link","fs-5"],["readonly","","type","text","aria-label","Link href",1,"form-control",3,"value"],["id","btnCopyLink","type","button",1,"btn","btn-outline-secondary",2,"width","150px",3,"cdkCopyToClipboard"],[1,"col-sm-12","mt-6"],[1,"input-group",2,"width","29.4rem"],["id","inputGroup-sizing-lg",1,"input-group-text","p-7"],[1,"fa-solid","fa-mobile-screen-button","fs-3"],["type","text","placeholder","Mobile Number (e.g. 6281500000000)","aria-label","Mobile Number (e.g. 6281500000000)",1,"form-control",3,"formControl"],["id","btnSend","type","button",1,"btn","btn-outline-secondary",3,"click","disabled"]],template:function(e,i){if(e&1){let o=v();r(0,"modal-material",1),_("onOk",function(){return u(o),f(i.close())})("onCancel",function(){return u(o),f(i.close())})("onClose",function(){return u(o),f(i.close())}),r(1,"content"),g(2,hl,9,0,"ng-container",2)(3,bl,14,4,"ng-template",null,0,K),a()()}if(e&2){let o=$(4);p("config",i.modalConfig),s(2),p("ngIf",i.data.link==null||i.data.link=="")("ngIfElse",o)}},dependencies:[Q,ie,G,St,W,oa],encapsulation:2})};var yl=n=>({"rounded-0 rounded-start-2":n}),xl=(n,t)=>({"bg-gradient-warning":n,"bg-gradient-danger":t}),Il=n=>({offline:n}),Ol=n=>({"ms-2":n}),Pl=(n,t)=>({ID:n,Template:t}),Ml=(n,t,e)=>({InvoiceID:n,OutID:t,Template:e}),Dl=n=>({ID:n,Print:1,Printer:"Normal"}),wl=n=>({ID:n});function kl(n,t){if(n&1&&(r(0,"a",47),m(1,"Delivery Order"),a()),n&2){let e=c(3);p("queryParams",ge(1,Pl,e.completeData.OutDeliveryID,e.outletRegister.PrintTemplate.ID))}}function Tl(n,t){if(n&1&&(r(0,"a",48),m(1,"Invoice & Delivery Order"),a()),n&2){let e=c(3);p("queryParams",Et(1,Ml,e.completeData.ObjectID,e.completeData.OutDeliveryID,e.outletRegister.PrintTemplate.ID))}}function El(n,t){if(n&1&&(r(0,"a",49),m(1,"Invoice (No Price)"),a()),n&2){let e=c(3);p("href",e.getInvoicePrintURL(!0),it)}}function Rl(n,t){if(n&1&&(r(0,"a",50),m(1,"Packing Slip"),a()),n&2){let e=c(3);p("queryParams",E(1,Dl,e.completeData.OutDeliveryID))}}function Nl(n,t){if(n&1&&(r(0,"div",30),h(1,"button",41),r(2,"div",42),g(3,kl,2,4,"a",43)(4,Tl,2,5,"a",44)(5,El,2,1,"a",45)(6,Rl,2,3,"a",46),a()()),n&2){let e=c(2);s(3),p("ngIf",e.completeData.OutDeliveryID),s(),p("ngIf",e.completeData.OutDeliveryID),s(),p("ngIf",e.completeData),s(),p("ngIf",e.completeData.OutDeliveryID)}}function Vl(n,t){n&1&&(r(0,"div",32)(1,"div",36)(2,"p",51),m(3," Transaction saved to your browser's local storage. Please upload when connection is restored! "),a()()())}function Al(n,t){if(n&1){let e=v();r(0,"div",33)(1,"div",52)(2,"div",53),_("click",function(){u(e);let o=c(2);return f(o.changeReceiptContact())}),h(3,"i"),a(),r(4,"input",54),_("ngModelChange",function(o){u(e);let l=c(2);return f(l.isPhoneOrEmail(o))}),a()(),r(5,"div",55)(6,"button",56),_("click",function(){u(e);let o=c(2);return f(o.sendReceiptToContact())}),m(7," Send Receipt "),a()()()}if(n&2){let e=c(2);s(3),be(e.receiptIcon+" fs-4"),s(),p("formControl",e.customerContact),s(2),p("disabled",e.customerContact.invalid)}}function Ll(n,t){if(n&1&&(r(0,"small",34),m(1),a()),n&2){let e=c(2);s(),y(" ",e.customerContact.errors==null||e.customerContact.errors.invalidEmailOrPhoneNumber==null?null:e.customerContact.errors.invalidEmailOrPhoneNumber.errMessage," ")}}function Bl(n,t){if(n&1){let e=v();r(0,"button",57),_("click",function(){u(e);let o=c(2);return f(o.onRetry())}),m(1," Retry Upload "),a()}}function Fl(n,t){if(n&1){let e=v();r(0,"div",60)(1,"button",61),_("click",function(){u(e);let o=c(3);return f(o.generateLink())}),h(2,"i",62),m(3,"Generate Payment Link "),a()()}}function jl(n,t){if(n&1){let e=v();r(0,"div",60)(1,"button",63),_("click",function(){u(e);let o=c(3);return f(o.verifyPaymentSettlement())}),h(2,"i",64),m(3,"Verify Payment Settlement "),a()()}}function Hl(n,t){if(n&1&&(r(0,"div",40)(1,"div",58),g(2,Fl,4,0,"div",59)(3,jl,4,0,"div",59),a()()),n&2){let e=c(2);s(2),p("ngIf",e.completeData.PaymentStateID==1),s(),p("ngIf",e.isNotEmpty(e.paymentGatewayService.getTransactionId()))}}function Ul(n,t){if(n&1){let e=v();r(0,"div",9)(1,"div",26)(2,"div",27)(3,"h2"),h(4,"i",28),m(5," Sell Complete "),r(6,"small",29),m(7),a()(),r(8,"div"),g(9,Nl,7,4,"div",30),a()()(),r(10,"div",14)(11,"div",31),g(12,Vl,4,0,"div",32)(13,Al,8,5,"div",33)(14,Ll,2,1,"small",34),r(15,"div",35)(16,"div",36)(17,"div",37),g(18,Bl,2,0,"button",38),r(19,"button",39),_("click",function(){u(e);let o=c();return f(o.newSale())}),m(20," New Sale (F8) "),a()()()()()(),g(21,Hl,4,2,"div",40),a()}if(n&2){let e=c();s(),p("ngClass",ge(9,xl,(!e.isOrderDateNow||e.completeData.PaymentStateID<3)&&e.completeData.PaymentStateLabel!="Offline",e.completeData.PaymentStateLabel=="Offline")),s(6),y(" (",e.completeData.PaymentStateLabel,")"),s(2),R(e.completeData.PaymentStateLabel=="Offline"?9:-1),s(2),p("ngClass",E(12,Il,e.completeData.PaymentStateLabel=="Offline")),s(),R(e.completeData.PaymentStateLabel=="Offline"?12:13),s(2),R(e.customerContact!=null&&e.customerContact.invalid&&(e.customerContact!=null&&e.customerContact.dirty||e.customerContact!=null&&e.customerContact.touched)?14:-1),s(4),R(e.completeData.PaymentStateLabel=="Offline"&&!e.isSuccessRetrySubmit()?18:-1),s(),p("ngClass",E(14,Ol,e.completeData.PaymentStateLabel=="Offline")),s(2),R(e.isOnline&&(e.completeData==null?null:e.completeData.PaymentStateID)==1||e.isNotEmpty(e.paymentGatewayService.getTransactionId())?21:-1)}}function Wl(n,t){if(n&1){let e=v();r(0,"app-retry",65),_("newSale",function(){u(e);let o=c();return f(o.newSale())}),a()}}function Ql(n,t){if(n&1&&(I(0),r(1,"a",66),m(2),a(),O()),n&2){let e=c();s(),p("queryParams",E(2,wl,e.completeData.ObjectID)),s(),y(" Invoice #",e.completeData==null?null:e.completeData.InvoiceNumber," ")}}function ql(n,t){if(n&1&&(r(0,"span",67),m(1),a()),n&2){let e=c();s(),y(" Invoice #",e.completeData==null?null:e.completeData.InvoiceNumber," ")}}function $l(n,t){if(n&1&&(I(0),m(1),b(2,"number"),O()),n&2){let e=c().$implicit;s(),Ue(" ",e.CurrencySymbol," ",x(2,2,e.Amount)," ")}}function Jl(n,t){n&1&&m(0," - ")}function Gl(n,t){if(n&1&&(r(0,"div",69)(1,"div",70),m(2),a(),r(3,"div",71),g(4,$l,3,4,"ng-container",13)(5,Jl,1,0,"ng-template",null,1,K),a()()),n&2){let e=t.$implicit,i=$(6),o=c(2);s(2),T(e.Label),s(2),p("ngIf",o.role.PriceVisible)("ngIfElse",i)}}function zl(n,t){if(n&1&&(r(0,"div",14),g(1,Gl,7,3,"div",68),a()),n&2){let e=c();s(),p("ngForOf",e.itemSummary)}}function Kl(n,t){if(n&1&&(r(0,"div",75)(1,"div",76),m(2),a(),r(3,"div",77),m(4),b(5,"number"),a()()),n&2){let e=t.$implicit,i=t.index,o=c(2);s(),p("hidden",!o.role.PriceVisible),s(),Ue(" ",e.Label,": ",e.CurrencySymbol," "),s(),p("hidden",!o.role.PriceVisible)("ngClass",i+1===o.amountSummary.length?"amount":""),s(),y(" ",x(5,6,e.Amount)," ")}}function Yl(n,t){if(n&1&&(r(0,"div",75)(1,"div",76),m(2),a(),r(3,"div",79),m(4),b(5,"number"),a()()),n&2){let e=t.$implicit,i=c(3);s(),p("hidden",!i.role.PriceVisible),s(),Ue(" ",e.Label,": ",e.CurrencySymbol," "),s(),p("hidden",!i.role.PriceVisible),s(),y(" ",x(5,5,e.Amount)," ")}}function Xl(n,t){if(n&1&&(I(0),r(1,"div",78),g(2,Yl,6,7,"div",73),a(),O()),n&2){let e=c(2);s(2),p("ngForOf",e.paymentSummary)}}function Zl(n,t){if(n&1&&(r(0,"div",72),g(1,Kl,6,8,"div",73)(2,Xl,3,1,"ng-container",74),a()),n&2){let e=c();s(),p("ngForOf",e.amountSummary),s(),p("ngIf",(e.paymentSummary==null?null:e.paymentSummary.length)>0)}}function es(n,t){if(n&1&&(r(0,"div",16)(1,"div",80)(2,"p",81),m(3,"INVALID AMOUNT CHARGE, CORRECT AMOUNT"),a(),r(4,"P",82),m(5),b(6,"number"),a()()()),n&2){let e=c();s(5),y("",x(6,1,e.completeData==null?null:e.completeData.Final)," ")}}function ts(n,t){if(n&1&&(r(0,"a",22),h(1,"i",83),a()),n&2){let e=c();p("href",e.getInvoicePrintURL(!1),it)}}function is(n,t){if(n&1&&(r(0,"div",9)(1,"div",11)(2,"h3",12),m(3,"Point Balance"),a()(),h(4,"div",84),a()),n&2){let e=c();s(4),p("innerHtml",e.completeData.LoyaltyPoint,xi)}}function ns(n,t){if(n&1&&h(0,"pos-receipt",85),n&2){let e=c(2);p("data",e.receiptTemplate)("printTemplate",e.outletRegister.PrintTemplate)("config",e.posStorage.AppConfigJSON)("priceVisibleRestriction",!e.role.PriceVisible)("outletInfo",e.outletRegister)("isUnknownError",e.currentSellState==e.sellState.UploadOrderFail)("isOffline",e.isOnline==!1)("stylesheet",e.posStorage.StylesSheet)}}function os(n,t){if(n&1&&h(0,"pos-receipt-a4",86),n&2){let e=c(3);p("data",t)("printTemplate",e.outletRegister.PrintTemplate)("config",e.posStorage.AppConfigJSON)("workOrderMode",!1)("stylesheet",e.posStorage.StylesSheet)}}function rs(n,t){if(n&1&&(g(0,os,1,5,"pos-receipt-a4",86),b(1,"async")),n&2){let e,i=c(2);R((e=x(1,1,i.receiptTemplateA4$))?0:-1,e)}}function as(n,t){if(n&1&&g(0,ns,1,8,"pos-receipt",85)(1,rs,2,3),n&2){let e=c();R(e.receiptTemplate&&e.printMode==2?0:-1),s(),R(e.printMode==1?1:-1)}}function ls(n,t){n&1&&(r(0,"div",25)(1,"h1"),m(2," Cannot generate print preview because of client-server amount Mismatch "),a()())}var vn=class n{constructor(t,e,i,o,l,C,N,re,ke,$e,je,ri,Tt,Kn,Yn,ai,Ea,_o,Co,Ra){this._posDataService=t;this._posService=e;this._orderProcessorService=i;this._OrderHttpService=o;this._PaymentHttpService=l;this._receiptService=C;this._outletService=N;this._toastr=re;this._onlineStatusService=ke;this._matDialog=$e;this._signalBroadCast=je;this._calculatorService=ri;this._userRoleService=Tt;this._router=Kn;this._receiptCalculatorService=Yn;this.datePipe=ai;this.decimalPipe=Ea;this.paymentGatewayService=_o;this.paymentHttpService=Co;this.shoppingCartService=Ra}whatsappSendReceiptService=Y(ro);handleF8(){this.newSale()}salesOrder=new dt;receiptTemplate=null;receiptTemplateA4$;completeData=new Or;printMode=2;outletRegister=new Ai;role;finalAmountDifferent=!1;amountSummary=[];itemSummary=[];paymentSummary=[];isOnline=!1;destroy$=new J;get posStorage(){return this._posService.Data}currentSellState;isOrderDateNow;sellState=xe;receiptIcon="fa-brands fa-whatsapp";customerContact=new vt;printOnPayment=z(!0);isSuccessRetrySubmit=z(!1);ngOnInit(){this.resetUrlAfterRedirect(),this.subscribeToObservableChanges()}subscribeToObservableChanges(){this._onlineStatusService.getOnlineStatus$().pipe(k(this.destroy$)).subscribe(t=>{this.isOnline=t}),this._userRoleService.Data$.pipe(k(this.destroy$)).subscribe(t=>{this.role=t}),this._posDataService.Data$.pipe(k(this.destroy$)).subscribe(t=>{this.salesOrder=t}),this._outletService.Data$.pipe(k(this.destroy$)).subscribe(t=>{this.outletRegister=t;let e=this.outletRegister?.PrintTemplate?.PrintMode;this.initPrintMode(e)}),this._orderProcessorService.Data$.pipe(ce(t=>t.posState===1||t.posState===9),k(this.destroy$)).subscribe(t=>{if(this.currentSellState=t.posState,this.generateCompleteSummary(),this._OrderHttpService.Data){let e=this.posStorage?.AppConfigJSON?.ModuleSell?.OrderComplete?.PrintOnPayment;this.printOnPayment.set(e),this.completeData=this._OrderHttpService.Data,this.checkFinalAmountDifferent(),this.setLoyaltyLabelConfig(),this.InitPrintInvoice(),this.initCustomerContact(),this.sendEmailOnComplete(),this.checkOrderDateIsNow(),this.clearShoppingCartInLocalStorage()}})}clearShoppingCartInLocalStorage(){this.shoppingCartService.clearCartItemsInLocalStorage()}generateCompleteSummary(){this.itemSummary=this._receiptService.generateCartItemSummary(),this.amountSummary=this._receiptCalculatorService.generateAmountSummary(),this.paymentSummary=this._receiptService.generatePaymentSummary()}initPrintMode(t){this.isOnline?this.printMode=t:this.printMode=2}sendEmailOnComplete(){let t=this.posStorage?.AppConfigJSON?.ModuleSell?.OrderComplete?.EmailReceipt,e=this.completeData?.Contact?.Email;t&&S.IsNotEmpty(e)&&this.sendEmail()}resetUrlAfterRedirect(){this._router.events.pipe(k(this.destroy$)).subscribe(t=>{t instanceof jo&&(t?.url?.includes("Sell")||(this._orderProcessorService.createNewTransactionInSameOutletRegister(),this._signalBroadCast.BroadcastStateToCustomerDisplay(0).subscribe()))})}InitPrintInvoice(){this.currentSellState==1&&(this.checkOrderNumber(),this.print())}initCustomerContact(){if(this.posStorage?.AppConfigJSON.ModuleSell.OrderComplete.DefaultReceiptChannel==0){this.receiptIcon="fa-solid fa-envelope";let t=this.completeData?.Contact?.Email;this.customerContact.setValue(t)}else if(this.posStorage?.AppConfigJSON.ModuleSell.OrderComplete.DefaultReceiptChannel==1){this.receiptIcon="fa-brands fa-whatsapp";let t=this.completeData?.Contact?.Mobile;this.customerContact.setValue(t)}}isPhoneOrEmail(t){let e=S.emailRegex,i=S.phoneNumberRegex,o=e,l=i,C=o.test(t),N=l.test(t);if(C)return this.receiptIcon="fa-solid fa-envelope","Email";if(N)return this.receiptIcon="fa-brands fa-whatsapp","Mobile"}changeReceiptContact(){this.receiptIcon=="fa-solid fa-envelope"?(this.receiptIcon="fa-brands fa-whatsapp",this.customerContact.setValue(this.completeData?.Contact?.Mobile)):(this.receiptIcon="fa-solid fa-envelope",this.customerContact.setValue(this.completeData?.Contact?.Email))}checkOrderDateIsNow(){let t=this.completeData.OrderTimeString,e=this.datePipe.transform(this.salesOrder.Order.Date,"dd MMM yyyy");this.isOrderDateNow=t.includes(e)}checkFinalAmountDifferent(){if(this.currentSellState==1){let t=this.posStorage.AppConfigJSON,e=this.completeData.Final,i=this._calculatorService.Data,o=t.ModuleSell.ToleranceAmount,l=e-i;if(l!=o&&l!=0){this.finalAmountDifferent=!0;let C=this.decimalPipe.transform(e);setTimeout(()=>{this._toastr.warning(`Final Amount should be ${C}! Use Print Receipt to print the correct Receipt!`,"Invalid Amount charged",{timeOut:1e4})},500)}else this.finalAmountDifferent=!1}}checkOrderNumber(){this.completeData.InvoiceNumber!=this.salesOrder.Order.Number&&(this._toastr.warning("Your transaction number is changed to "+this.completeData.InvoiceNumber,"Transaction Number Changed!"),this.salesOrder.Order.Number=this.completeData.InvoiceNumber)}generateLink(){this.posStorage.AppConfigJSON.PaymentConfigLink==!0&&this._matDialog.open(bi);let t={InvoiceID:this.completeData.ObjectID};this._PaymentHttpService.generateLink(t).subscribe({next:e=>{this._matDialog.open(bi,{data:{link:e.token.redirect_url}})},error:e=>{this._toastr.error(e.Message,"Couldn't generate link!")}})}newSale(){try{this._orderProcessorService.createNewTransactionInSameOutletRegister(),this._signalBroadCast.BroadcastStateToCustomerDisplay(0).subscribe(),this.paymentGatewayService.resetPaymentMethod(),this._router.navigate([],{queryParams:{ID:null}})}catch(t){console.error(t),this._toastr.error(t,"Error redirecting to NEW mode")}}onRetry(){this._onlineStatusService.isOnline?this._posDataService.uploadOfflineOrder().subscribe(e=>{e.Success?(this.isSuccessRetrySubmit.set(!0),this.broadcastToCustomerDisplay(e),this._orderProcessorService.updatePosState(1,e)):this._orderProcessorService.updatePosState(1,e)}):this._toastr.error("Please check your internet connection and try again.","Connection Required")}broadcastToCustomerDisplay(t){let i=this._posDataService.Data.TotalPaidAmount-this._calculatorService.Data;this._signalBroadCast.BroadcastStateToCustomerDisplay(1,t.ObjectID,t.LoyaltyPoint,i).subscribe()}getInvoicePrintURL(t){let e="/print/Invoice"+(this.outletRegister.PrintTemplate.PrintMode===2?"Mini":""),i="";return t&&(i="&Print=1&Price=0"),S.StringFormat("{0}?ID={1}&Template={2}{3}",e,this.completeData.ObjectID,this.outletRegister?.PrintTemplate?.ID?.toString(),i)}sendEmail(){if(!this.role.Email){this._toastr.info("You do not have required Role",Be.Info);return}this._OrderHttpService.sendEmail(this.customerContact.value,this.completeData.ObjectID).then(t=>{this._toastr.success(t.Message,"Email sent!")})}sendReceiptByWhatsaap(){let t=this.customerContact.value;this.whatsappSendReceiptService.createCustomerFromNewNumberAndSendReceipt(t,this._calculatorService.currencySymbol,this.posStorage?.AppConfigJSON.ModuleSell.OrderComplete.WhatsappReceipt,{Final:this.completeData.Final,InvoiceNumber:this.completeData.InvoiceNumber,ObjectID:this.completeData.ObjectID},this._posService.Data?.WhatsAppConfigJSON?.TextReceipt)}print(){this.printMode==2?(this.printReceiptMini(),this.printOnPayment()&&this.printWindow()):this.printMode==1&&this.printReceiptA4()}printReceiptMini(){this.receiptTemplate=this._receiptService.generateReceiptMini()}setLoyaltyLabelConfig(){let t=this.posStorage?.AppConfigJSON;t.LoyaltyLabel=t.ApplicationLoyalty.Label,this.posStorage.AppConfigJSON=t}printReceiptA4(){this.receiptTemplateA4$==null?this.receiptTemplateA4$=this._OrderHttpService.generateReceiptA4(this.completeData.ObjectID).pipe(k(this.destroy$),tt(t=>(t.Data.AfterSell=!0,t.Data)),li(t=>{throw this._toastr.error(`Could not print in A4 format!
@@ -53,4 +53,4 @@ Printing in 8mm format instead!`,"Error!"),this.printReceiptMini(),t}),Ee(()=>{t
53
53
  Please add the tag <a href="/menu/Setup/Tag/Sales_Order">here</a> to continue.
54
54
  </p>
55
55
  `,headerType:Be.Error},width:"28rem"})}initializeRole(){let e=new xr(this.roleService);this.userRoleService.pushNewValue(e)}subscribeToObservable(){this.orderProcessorService.Data$.pipe(k(this.destroy$)).subscribe(e=>{this.currentState=e.posState}),this.signalRClientService.OnPaymentReceived.pipe(k(this.destroy$)).subscribe(e=>{this.onQRPaymentComplete(e)}),this.outletService.Data$.pipe(k(this.destroy$)).subscribe(e=>{this.outletRegister=e,this.onOpenDialogOfflineOrder()}),this.userRoleService.Data$.pipe(k(this.destroy$)).subscribe(e=>{this.userRole=e}),this.parkOrderService.onPrint$.pipe(k(this.destroy$)).subscribe(e=>{switch(this.isPrintBillA4=!1,this.isPrintBillMini=!1,this.isPrintPark=!1,this.receiptTemplate=e.template,e.type){case"BILL_A4":this.isPrintBillA4=!0;break;case"BILL_MINI":this.isPrintBillMini=!0;break;case"PARK":this.isPrintPark=!0;break}this.receiptService.printWindow().finally(()=>{this.receiptTemplate=null})})}onQRPaymentComplete(e){if(!S.IsEmpty(e)){let i=JSON.parse(e);this.paymentServiceGateway.onQRPaymentComplete(i,this.posHttpResponse.AppConfigJSON).then(o=>{this.dialog.getDialogById("ModalPayment").close();let N=`IDR ${this.decimalPipe.transform(i.gross_amount)} received. Please verify in customer mobile app!`;this.toastr.success(N," QR Settlement"),this.paymentServiceGateway.clearTransactionID(),this.orderProcessorService.updatePosState(1,o)}).catch(o=>{this.toastr.error(o.message,o.header?o.header:"Error")})}}editInvoice(e){this.orderProcessorService.updatePosState(2),this.orderHttpService.GetInvoiceBySoID(e).pipe(k(this.destroy$)).subscribe(i=>{this.invoiceNumberEdit=i.Invoice.Number,i.Invoice.Number=null,this.orderProcessorService.plainToClass(i),this.loadCouponDataForEdit(i)})}loadCouponDataForEdit(e){let i=e.Order.PromotionCoupon,o=e.Order.CouponProvider||"Internal";i&&i.trim()!==""&&this.httpService.get("/API/PromotionCoupon/GetCouponData",[{key:"salesOrderID",value:e.Order.ID}]).subscribe({next:l=>{o==="Internal"&&this.loadInternalCouponForEdit(l,i,e)},error:l=>{console.error("Failed to load coupon data:",l)}})}loadInternalCouponForEdit(e,i,o){let l=e.Type||"Amount",C=e.Amount||0,N={Type:l,Amount:C,Notification:e.Notification||"",ApplyToProduct:e.ApplyToProduct||[],Requirement:{Type:e.Requirement?.Type,MaximumDiscount:e.Requirement?.MaximumDiscount||0,FullPriceProductOnly:e.Requirement?.FullPriceProductOnly||!1,RequirementDiscountType:e.Requirement?.RequirementDiscountType,Notify:e.Requirement?.Notify||"",MinimumSpendingAmount:e.Requirement?.MinimumSpendingAmount||0,StartDate:e.Requirement?.StartDate||"",ExpiryDate:e.Requirement?.ExpiryDate||"",CustomerName:e.Requirement?.CustomerName||"",CustomerCode:e.Requirement?.CustomerCode||"",CouponDeductedAmount:e.Requirement?.CouponDeductedAmount||0}};this.promotionCouponService._coupon.set(N)}initEcrSignalR(){if(this.ecrSignalRService.isConnected()){let i=this.ecrStorage.ecrUrl();this.ecrSignalRService.initConnection(i)}}ngOnDestroy(){this.intercomService.showLauncher(),this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(i){return new(i||n)(d(Xe),d(B),d(ee),d(Ho),d(Uo),d(j),d(X),d(Ui),d(oe),d(Z),d(we),d(me),d(Mt),d(Oe),d(Ht),d(Ko),d(mr),d(Ut),d(Jt),d(Gi),d(pt),d(Qe),d(Ne),d(ft),d(Ze))};static \u0275cmp=P({type:n,selectors:[["POS-sell-v3"]],features:[st([we,kt]),Oi],decls:9,vars:8,consts:[["COMPLETE",""],[1,"d-block","d-print-none"],[1,"container-fluid","sell-container",3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"print_containers"],[3,"data","printTemplate","config","stylesheet",4,"ngIf"],[3,"data","printTemplate","config","outletInfo","stylesheet",4,"ngIf"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo","stylesheet",4,"ngIf"],["class","row d-print-none",4,"ngIf"],[1,"row","d-print-none"],[1,"col-5","pe-6"],[1,"border-start","ps-6","col-7"],[1,"row"],[1,"col-12","px-0"],[3,"data","printTemplate","config","stylesheet"],[3,"data","printTemplate","config","outletInfo","stylesheet"],[3,"data","printTemplate","config","priceVisibleRestriction","outletInfo","stylesheet"]],template:function(i,o){if(i&1&&(h(0,"subscription-alert",1),r(1,"div",2),g(2,Fd,2,1,"ng-container",3)(3,jd,3,0,"ng-template",null,0,K),a(),r(5,"div",4),g(6,Hd,1,4,"park-order",5)(7,Ud,1,5,"POS-bill-receipt-A4",6)(8,Wd,1,6,"pos-receipt",7),a()),i&2){let l=$(4);s(),p("ngClass",E(6,Ld,o.currentSubsStatus==o.subscriptionStatus.OVERDUE||o.currentSubsStatus==o.subscriptionStatus.SELL_ONLY)),s(),p("ngIf",o.currentState!=o.sellState.IsComplete&&o.currentState!=o.sellState.UploadOrderFail)("ngIfElse",l),s(4),p("ngIf",o.isPrintPark&&o.receiptTemplate),s(),p("ngIf",o.receiptTemplate&&o.isPrintBillA4),s(),p("ngIf",o.receiptTemplate&&o.isPrintBillMini)}},dependencies:[te,H,Q,pn,Hn,zr,zn,hn,Ke,It,Ji,$i,Zi,jr,Fr,Br,Lr,vn,hr,sa],styles:[`.cart-background{background-color:#fcfdff}.sell-container{margin:0 auto!important;height:100%}.sell-container>.row{height:100%}.sell-container>.row>[class*=col-]{height:100%}.sell-container .quicky{overflow:hidden}.sell-subscription-overdue{height:calc(100vh - 3rem)!important;overflow-y:auto}.print_containers{display:none}@media print{.print_containers{display:block;text-align:left}.sell-subscription-overdue{height:auto!important;overflow-y:visible!important}}
56
- `],encapsulation:2})},TS=[{path:"Offline",loadChildren:()=>import("./chunk-LYGTJSME.js").then(n=>n.OfflineModule)},{path:"",loadComponent:()=>go}];export{go as SellV3Component,TS as routes};
56
+ `],encapsulation:2})},TS=[{path:"Offline",loadChildren:()=>import("./chunk-ZFMK7BOT.js").then(n=>n.OfflineModule)},{path:"",loadComponent:()=>go}];export{go as SellV3Component,TS as routes};
@@ -1,4 +1,4 @@
1
- import{a as ue}from"./chunk-ETHIPTBJ.js";import{a as me,d as he}from"./chunk-AZT6QE56.js";import{a as It}from"./chunk-5UL73W4S.js";import{F as Nt,G as zt,u as Lt,v as Kt,w as $t}from"./chunk-677WPFLK.js";import{b as Et,c as Ft}from"./chunk-CIBQBSM6.js";import{O as Rt,n as At}from"./chunk-L2RZWAX3.js";import{a as bt,e as Pt,f as Bt,g as Ot}from"./chunk-D35OBUDE.js";import{q as Dt}from"./chunk-567HXZXC.js";import{a as de,c as Tt}from"./chunk-AAJJTF33.js";import{C as Te,J as Ct,K as kt,U as wt,V as St,b as _t,ga as Vt,i as vt,ja as se,ka as A,m as xt,pa as Mt,s as yt,sa as pe}from"./chunk-3PYW74LR.js";import{D as ht,a as rt,c as lt,g as ct,h as st,i as pt,k as dt,o as ut,p as mt}from"./chunk-P7HKWFZT.js";import{a as ot,c as gt}from"./chunk-HV7GI3KE.js";import{a as ft}from"./chunk-LYOMQKFY.js";import{a as Y}from"./chunk-AHCRE4GP.js";import{$a as s,$b as I,Ac as we,Ad as et,Bc as Ze,Bd as Ve,Db as je,Dd as le,Ed as ce,Fa as _,Fc as Ge,Ga as Ae,Gd as Me,Ib as r,Ja as xe,Jb as c,Kb as h,Lb as V,Lc as Ye,Ma as Re,Mb as M,Mc as w,N as Oe,Nb as He,Nc as ae,Ob as b,Qb as f,Qc as Se,Rb as p,Rd as tt,Sb as ee,Sd as nt,Tb as R,Td as it,Ub as Q,Vd as at,Wc as U,Yb as F,Yc as Xe,Zb as Qe,Zc as Z,_a as Ne,_b as T,aa as Le,ad as Je,bc as te,bd as G,cc as We,d as Pe,db as x,dc as qe,ec as v,fc as W,gb as J,gc as ne,hc as Ue,ia as Ke,ja as z,jc as O,jd as $,ka as j,kb as y,kc as L,kd as re,lb as H,lc as K,na as P,nb as ze,ob as B,pc as ie,qb as d,qc as q,rc as k,sc as ke,t as Be,ua as $e,ub as C,va as u,vb as l,wa as m,xa as X,xb as ye,yb as Ce,za as S,zb as E,zc as oe}from"./chunk-DZT5XHBQ.js";import{a as ve,b as Fe}from"./chunk-7DCB7DB2.js";var fe=class t{_openDialog=new Pe;openDialog$=this._openDialog.asObservable();openDialog(){this._openDialog.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=z({token:t,factory:t.\u0275fac,providedIn:"root"})};var jt=(()=>{class t extends me{static \u0275fac=(()=>{let e;return function(i){return(e||(e=S(t)))(i||t)}})();static \u0275cmp=y({type:t,selectors:[["CheckIcon"]],features:[B],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z","fill","currentColor"]],template:function(n,i){n&1&&(X(),r(0,"svg",0),h(1,"path",1),c()),n&2&&(E(i.getClassNames()),C("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role))},encapsulation:2})}return t})();var Ht=(()=>{class t extends me{static \u0275fac=(()=>{let e;return function(i){return(e||(e=S(t)))(i||t)}})();static \u0275cmp=y({type:t,selectors:[["MinusIcon"]],features:[B],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M13.2222 7.77778H0.777778C0.571498 7.77778 0.373667 7.69584 0.227806 7.54998C0.0819442 7.40412 0 7.20629 0 7.00001C0 6.79373 0.0819442 6.5959 0.227806 6.45003C0.373667 6.30417 0.571498 6.22223 0.777778 6.22223H13.2222C13.4285 6.22223 13.6263 6.30417 13.7722 6.45003C13.9181 6.5959 14 6.79373 14 7.00001C14 7.20629 13.9181 7.40412 13.7722 7.54998C13.6263 7.69584 13.4285 7.77778 13.2222 7.77778Z","fill","currentColor"]],template:function(n,i){n&1&&(X(),r(0,"svg",0),h(1,"path",1),c()),n&2&&(E(i.getClassNames()),C("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role))},encapsulation:2})}return t})();var Jt=["checkboxicon"],en=["input"],tn=()=>({"p-checkbox-input":!0}),nn=t=>({checked:t,class:"p-checkbox-icon"});function on(t,o){if(t&1&&h(0,"span",8),t&2){let e=p(3);l("ngClass",e.checkboxIcon),C("data-pc-section","icon")}}function an(t,o){t&1&&h(0,"CheckIcon",9),t&2&&(l("styleClass","p-checkbox-icon"),C("data-pc-section","icon"))}function rn(t,o){if(t&1&&(V(0),d(1,on,1,2,"span",7)(2,an,1,2,"CheckIcon",6),M()),t&2){let e=p(2);s(),l("ngIf",e.checkboxIcon),s(),l("ngIf",!e.checkboxIcon)}}function ln(t,o){t&1&&h(0,"MinusIcon",9),t&2&&(l("styleClass","p-checkbox-icon"),C("data-pc-section","icon"))}function cn(t,o){if(t&1&&(V(0),d(1,rn,3,2,"ng-container",4)(2,ln,1,2,"MinusIcon",6),M()),t&2){let e=p();s(),l("ngIf",e.checked),s(),l("ngIf",e._indeterminate())}}function sn(t,o){}function pn(t,o){t&1&&d(0,sn,0,0,"ng-template")}var dn=({dt:t})=>`
1
+ import{a as ue}from"./chunk-4E4L6WXO.js";import{a as me,d as he}from"./chunk-AZT6QE56.js";import{a as It}from"./chunk-5UL73W4S.js";import{F as Nt,G as zt,u as Lt,v as Kt,w as $t}from"./chunk-677WPFLK.js";import{b as Et,c as Ft}from"./chunk-CIBQBSM6.js";import{O as Rt,n as At}from"./chunk-L2RZWAX3.js";import{a as bt,e as Pt,f as Bt,g as Ot}from"./chunk-D35OBUDE.js";import{q as Dt}from"./chunk-567HXZXC.js";import{a as de,c as Tt}from"./chunk-AAJJTF33.js";import{C as Te,J as Ct,K as kt,U as wt,V as St,b as _t,ga as Vt,i as vt,ja as se,ka as A,m as xt,pa as Mt,s as yt,sa as pe}from"./chunk-3PYW74LR.js";import{D as ht,a as rt,c as lt,g as ct,h as st,i as pt,k as dt,o as ut,p as mt}from"./chunk-P7HKWFZT.js";import{a as ot,c as gt}from"./chunk-HSQKKFE6.js";import{a as ft}from"./chunk-7BDVBLHM.js";import{a as Y}from"./chunk-AHCRE4GP.js";import{$a as s,$b as I,Ac as we,Ad as et,Bc as Ze,Bd as Ve,Db as je,Dd as le,Ed as ce,Fa as _,Fc as Ge,Ga as Ae,Gd as Me,Ib as r,Ja as xe,Jb as c,Kb as h,Lb as V,Lc as Ye,Ma as Re,Mb as M,Mc as w,N as Oe,Nb as He,Nc as ae,Ob as b,Qb as f,Qc as Se,Rb as p,Rd as tt,Sb as ee,Sd as nt,Tb as R,Td as it,Ub as Q,Vd as at,Wc as U,Yb as F,Yc as Xe,Zb as Qe,Zc as Z,_a as Ne,_b as T,aa as Le,ad as Je,bc as te,bd as G,cc as We,d as Pe,db as x,dc as qe,ec as v,fc as W,gb as J,gc as ne,hc as Ue,ia as Ke,ja as z,jc as O,jd as $,ka as j,kb as y,kc as L,kd as re,lb as H,lc as K,na as P,nb as ze,ob as B,pc as ie,qb as d,qc as q,rc as k,sc as ke,t as Be,ua as $e,ub as C,va as u,vb as l,wa as m,xa as X,xb as ye,yb as Ce,za as S,zb as E,zc as oe}from"./chunk-DZT5XHBQ.js";import{a as ve,b as Fe}from"./chunk-7DCB7DB2.js";var fe=class t{_openDialog=new Pe;openDialog$=this._openDialog.asObservable();openDialog(){this._openDialog.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=z({token:t,factory:t.\u0275fac,providedIn:"root"})};var jt=(()=>{class t extends me{static \u0275fac=(()=>{let e;return function(i){return(e||(e=S(t)))(i||t)}})();static \u0275cmp=y({type:t,selectors:[["CheckIcon"]],features:[B],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z","fill","currentColor"]],template:function(n,i){n&1&&(X(),r(0,"svg",0),h(1,"path",1),c()),n&2&&(E(i.getClassNames()),C("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role))},encapsulation:2})}return t})();var Ht=(()=>{class t extends me{static \u0275fac=(()=>{let e;return function(i){return(e||(e=S(t)))(i||t)}})();static \u0275cmp=y({type:t,selectors:[["MinusIcon"]],features:[B],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M13.2222 7.77778H0.777778C0.571498 7.77778 0.373667 7.69584 0.227806 7.54998C0.0819442 7.40412 0 7.20629 0 7.00001C0 6.79373 0.0819442 6.5959 0.227806 6.45003C0.373667 6.30417 0.571498 6.22223 0.777778 6.22223H13.2222C13.4285 6.22223 13.6263 6.30417 13.7722 6.45003C13.9181 6.5959 14 6.79373 14 7.00001C14 7.20629 13.9181 7.40412 13.7722 7.54998C13.6263 7.69584 13.4285 7.77778 13.2222 7.77778Z","fill","currentColor"]],template:function(n,i){n&1&&(X(),r(0,"svg",0),h(1,"path",1),c()),n&2&&(E(i.getClassNames()),C("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role))},encapsulation:2})}return t})();var Jt=["checkboxicon"],en=["input"],tn=()=>({"p-checkbox-input":!0}),nn=t=>({checked:t,class:"p-checkbox-icon"});function on(t,o){if(t&1&&h(0,"span",8),t&2){let e=p(3);l("ngClass",e.checkboxIcon),C("data-pc-section","icon")}}function an(t,o){t&1&&h(0,"CheckIcon",9),t&2&&(l("styleClass","p-checkbox-icon"),C("data-pc-section","icon"))}function rn(t,o){if(t&1&&(V(0),d(1,on,1,2,"span",7)(2,an,1,2,"CheckIcon",6),M()),t&2){let e=p(2);s(),l("ngIf",e.checkboxIcon),s(),l("ngIf",!e.checkboxIcon)}}function ln(t,o){t&1&&h(0,"MinusIcon",9),t&2&&(l("styleClass","p-checkbox-icon"),C("data-pc-section","icon"))}function cn(t,o){if(t&1&&(V(0),d(1,rn,3,2,"ng-container",4)(2,ln,1,2,"MinusIcon",6),M()),t&2){let e=p();s(),l("ngIf",e.checked),s(),l("ngIf",e._indeterminate())}}function sn(t,o){}function pn(t,o){t&1&&d(0,sn,0,0,"ng-template")}var dn=({dt:t})=>`
2
2
  .p-checkbox {
3
3
  position: relative;
4
4
  display: inline-flex;
@@ -1 +1 @@
1
- import{c as f}from"./chunk-HV7GI3KE.js";import{a as m}from"./chunk-4YAMWP7V.js";import{I as c,Vd as v,Yd as u,ja as s,k as n,ma as e,qd as h,td as l}from"./chunk-DZT5XHBQ.js";var d=class o{constructor(t,r,p,i){this.httpService=t;this.authService=r;this.httpClientService=p;this.toastr=i}port=window.location.href.split("localhost:")[1]?.split("/")[0];hostURL=t=>m.production?t:`https://localhost:${this.port}${t}`;configure2FA(t){return this.httpService.post("/api/Authentication/Setup_2FA",t)}validateCode(t,r){let p=this.authService.loginResponse?.Token,i=new h({"Content-Type":"application/json","Cache-Control":"no-cache"});i=i.append("Authorization","Bearer "+p);let S={ValidationCode:t,UserID:r};return this.httpClientService.post(this.hostURL("/api/Login/Validate_2FA "),S,{headers:i}).pipe(c(a=>(this.toastr.error(a?.error?.Message,"Error - "+a.status),n)))}disableTwoFactorAuthentication(){let t={enabled:!1};return this.httpService.post("/api/Authentication/Setup_2FA",t)}static \u0275fac=function(r){return new(r||o)(e(u),e(f),e(l),e(v))};static \u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"})};export{d as a};
1
+ import{c as f}from"./chunk-HSQKKFE6.js";import{a as m}from"./chunk-W7HVLC6V.js";import{I as c,Vd as v,Yd as u,ja as s,k as n,ma as e,qd as h,td as l}from"./chunk-DZT5XHBQ.js";var d=class o{constructor(t,r,p,i){this.httpService=t;this.authService=r;this.httpClientService=p;this.toastr=i}port=window.location.href.split("localhost:")[1]?.split("/")[0];hostURL=t=>m.production?t:`https://localhost:${this.port}${t}`;configure2FA(t){return this.httpService.post("/api/Authentication/Setup_2FA",t)}validateCode(t,r){let p=this.authService.loginResponse?.Token,i=new h({"Content-Type":"application/json","Cache-Control":"no-cache"});i=i.append("Authorization","Bearer "+p);let S={ValidationCode:t,UserID:r};return this.httpClientService.post(this.hostURL("/api/Login/Validate_2FA "),S,{headers:i}).pipe(c(a=>(this.toastr.error(a?.error?.Message,"Error - "+a.status),n)))}disableTwoFactorAuthentication(){let t={enabled:!1};return this.httpService.post("/api/Authentication/Setup_2FA",t)}static \u0275fac=function(r){return new(r||o)(e(u),e(f),e(l),e(v))};static \u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"})};export{d as a};
@@ -1 +1 @@
1
- import{a as ge}from"./chunk-OUDB3GIC.js";import{a as ve}from"./chunk-Z7WYC46Q.js";import{a as Ce}from"./chunk-IVP3GL2V.js";import"./chunk-BYXBJQAS.js";import{h as ce,i as fe}from"./chunk-SO3WWYN3.js";import"./chunk-ETHIPTBJ.js";import{b as se}from"./chunk-M7KP6PSY.js";import"./chunk-AZT6QE56.js";import"./chunk-5UL73W4S.js";import{u as pe,v as me,w as ue}from"./chunk-677WPFLK.js";import"./chunk-CIBQBSM6.js";import{P as F}from"./chunk-L2RZWAX3.js";import{e as ae,f as le,g as de}from"./chunk-D35OBUDE.js";import"./chunk-567HXZXC.js";import"./chunk-AAJJTF33.js";import"./chunk-2FWFPV5I.js";import"./chunk-3PYW74LR.js";import{C as oe,D as te,E as ne,c as J,e as b,h as Y,i as X,p as Q,t as Z,u as ee}from"./chunk-P7HKWFZT.js";import"./chunk-HV7GI3KE.js";import"./chunk-LYOMQKFY.js";import{a as w,d as re}from"./chunk-AHCRE4GP.js";import"./chunk-4YAMWP7V.js";import{$a as l,Db as C,E as N,Eb as A,Fc as q,Gb as O,Hb as U,Ib as i,Jb as r,Kb as s,Ma as V,Nb as H,Ob as x,Od as W,Pc as K,Qb as v,Rb as f,Vd as z,Wc as R,Yd as ie,Zc as L,bd as B,db as c,dc as $,ec as a,fc as G,gc as T,jd as M,kb as E,na as h,ob as D,qb as m,rc as _,sc as j,t as k,va as y,vb as p,wa as P}from"./chunk-DZT5XHBQ.js";import"./chunk-7DCB7DB2.js";var I=n=>({"is-invalid":n});function Pe(n,d){n&1&&(i(0,"div",16),a(1," Provider Name is required "),r())}function Ee(n,d){n&1&&(i(0,"div",20),a(1," Validate Coupon URL is required "),r())}function xe(n,d){n&1&&(i(0,"div",20),a(1," Redeem Coupon URL is required "),r())}function Ge(n,d){n&1&&(i(0,"div",20),a(1,"Key is required"),r())}var S=class n{constructor(d){this.data=d;this.config=new pe,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}dialogRef=h(ae);config;fb=h(oe);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[b.required]],validateCoupon:[this.data?.validateCoupon||"",[b.required]],redeemCoupon:[this.data?.redeemCoupon||"",[b.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[b.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||n)(c(le))};static \u0275cmp=E({type:n,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(i(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"input",9),i(11,"label",10),a(12,"Coupon Provider"),r()()(),i(13,"div",11)(14,"div",12)(15,"div",13),s(16,"app-customize-toggle",14),r(),i(17,"label",15),a(18,"Enabled"),r()()()(),m(19,Pe,2,0,"div",16),r(),i(20,"div",17),s(21,"input",18),i(22,"label",19),a(23,"Validate Coupon URL"),r(),m(24,Ee,2,0,"div",20),r(),i(25,"div",17),s(26,"input",21),i(27,"label",22),a(28,"Redeem Coupon URL"),r(),m(29,xe,2,0,"div",20),r(),i(30,"div",23),s(31,"textarea",24),i(32,"label",25),a(33,"Request Header (Key: value)"),r(),m(34,Ge,2,0,"div",20),r()()()()()()()),e&2&&(p("config",o.config),l(5),p("formGroup",o.formGroup),l(5),p("ngClass",_(10,I,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),C(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),p("ngClass",_(12,I,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),C(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),p("ngClass",_(14,I,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),C(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),p("ngClass",_(16,I,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),C(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,ne,Q,J,Y,X,Z,ee,ue,me,ge],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var Re=(n,d)=>({"bg-success-subtle text-success-emphasis":n,"bg-danger-subtle text-danger-emphasis":d});function Me(n,d){if(n&1){let e=x();i(0,"button",10),v("click",function(){y(e);let t=f();return P(t.addNewCouponProvider())}),a(1," Add "),r()}}function Ie(n,d){n&1&&s(0,"th",11)}function Ne(n,d){if(n&1){let e=x();i(0,"td",15)(1,"i",16),v("click",function(){y(e);let t=f().$index,u=f(2);return P(u.onDeleteProvider(t))}),r()()}}function Te(n,d){if(n&1){let e=x();i(0,"tr"),m(1,Ne,2,0,"td",12),i(2,"td")(3,"a",13),v("click",function(){let t=y(e),u=t.$implicit,g=t.$index,_e=f(2);return P(_e.onUpdateProvider(u,g))}),a(4),r()(),i(5,"td"),a(6),r(),i(7,"td"),a(8),r(),i(9,"td"),a(10),r(),i(11,"td")(12,"span",14),a(13),r()()()}if(n&2){let e=d.$implicit,o=f(2);l(),p("ngIf",o.role.developer.Edit),l(3),T(" ",e.Name," "),l(2),G(e.ValidateCoupon),l(2),G(e.RedeemCoupon),l(2),G(e.KeyUI),l(2),p("ngClass",j(7,Re,e.Enabled,!e.Enabled)),l(),T(" ",e.Enabled?"Enabled":"Disabled"," ")}}function we(n,d){if(n&1&&O(0,Te,14,10,"tr",null,A),n&2){let e=f();U(e.listProviders())}}function Fe(n,d){n&1&&H(0)}function ke(n,d){if(n&1&&m(0,Fe,1,0,"ng-container",17),n&2){f();let e=$(25);p("ngTemplateOutlet",e)}}function Ve(n,d){n&1&&(i(0,"tr",18)(1,"td",19),s(2,"empty-state-table"),r()())}var he=class n extends ve{constructor(e,o,t,u,g){super(e,o,F.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=u;this.dialog=g}toastr=h(z);couponProviders=V([]);listProviders=K(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(S).afterClosed().pipe(N(e=>w.IsNotEmpty(e)),k(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(S,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(N(t=>w.IsNotEmpty(t))).subscribe(t=>{let u={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(g=>(g[o]=u,[...g])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(F.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||n)(c(se),c(ie),c(W),c(re),c(de))};static \u0275cmp=E({type:n,selectors:[["app-coupon-configuration"]],features:[D],decls:26,vars:6,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button","class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],["class","text-center","style","width: 10px",4,"ngIf"],[2,"width","220px"],["type","button",1,"btn","btn-success",3,"click"],[1,"text-center",2,"width","10px"],["class","text-center",4,"ngIf"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],[1,"text-center"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1&&(i(0,"mainpanel-cmp",1)(1,"actions"),m(2,Me,2,0,"button",2),r(),i(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"table",6)(8,"thead",7)(9,"tr"),m(10,Ie,1,0,"th",8),i(11,"th",9),a(12,"Name"),r(),i(13,"th"),a(14,"Validate Coupon"),r(),i(15,"th"),a(16,"Redeem Coupon"),r(),i(17,"th"),a(18,"Value"),r(),i(19,"th"),a(20,"Status"),r()()(),i(21,"tbody"),m(22,we,2,0)(23,ke,1,1,"ng-container"),r()()()()(),m(24,Ve,3,0,"ng-template",null,0,q),r()()),o&2){let u;p("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",t.role.developer.Edit),l(8),p("ngIf",t.role.developer.Edit),l(12),C(((u=t.listProviders())==null?null:u.length)>0?22:23)}},dependencies:[M,R,L,B,fe,ce,te,Ce],encapsulation:2})};export{he as CouponConfigurationComponent};
1
+ import{a as ge}from"./chunk-OUDB3GIC.js";import{a as ve}from"./chunk-RYONOB6O.js";import{a as Ce}from"./chunk-IVP3GL2V.js";import"./chunk-BYXBJQAS.js";import{h as ce,i as fe}from"./chunk-MERQX2AF.js";import"./chunk-4E4L6WXO.js";import{b as se}from"./chunk-DHQUQTIV.js";import"./chunk-AZT6QE56.js";import"./chunk-5UL73W4S.js";import{u as pe,v as me,w as ue}from"./chunk-677WPFLK.js";import"./chunk-CIBQBSM6.js";import{P as F}from"./chunk-L2RZWAX3.js";import{e as ae,f as le,g as de}from"./chunk-D35OBUDE.js";import"./chunk-567HXZXC.js";import"./chunk-AAJJTF33.js";import"./chunk-2FWFPV5I.js";import"./chunk-3PYW74LR.js";import{C as oe,D as te,E as ne,c as J,e as b,h as Y,i as X,p as Q,t as Z,u as ee}from"./chunk-P7HKWFZT.js";import"./chunk-HSQKKFE6.js";import"./chunk-7BDVBLHM.js";import{a as w,d as re}from"./chunk-AHCRE4GP.js";import"./chunk-W7HVLC6V.js";import{$a as l,Db as C,E as N,Eb as A,Fc as q,Gb as O,Hb as U,Ib as i,Jb as r,Kb as s,Ma as V,Nb as H,Ob as x,Od as W,Pc as K,Qb as v,Rb as f,Vd as z,Wc as R,Yd as ie,Zc as L,bd as B,db as c,dc as $,ec as a,fc as G,gc as T,jd as M,kb as E,na as h,ob as D,qb as m,rc as _,sc as j,t as k,va as y,vb as p,wa as P}from"./chunk-DZT5XHBQ.js";import"./chunk-7DCB7DB2.js";var I=n=>({"is-invalid":n});function Pe(n,d){n&1&&(i(0,"div",16),a(1," Provider Name is required "),r())}function Ee(n,d){n&1&&(i(0,"div",20),a(1," Validate Coupon URL is required "),r())}function xe(n,d){n&1&&(i(0,"div",20),a(1," Redeem Coupon URL is required "),r())}function Ge(n,d){n&1&&(i(0,"div",20),a(1,"Key is required"),r())}var S=class n{constructor(d){this.data=d;this.config=new pe,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}dialogRef=h(ae);config;fb=h(oe);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[b.required]],validateCoupon:[this.data?.validateCoupon||"",[b.required]],redeemCoupon:[this.data?.redeemCoupon||"",[b.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[b.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||n)(c(le))};static \u0275cmp=E({type:n,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(i(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"input",9),i(11,"label",10),a(12,"Coupon Provider"),r()()(),i(13,"div",11)(14,"div",12)(15,"div",13),s(16,"app-customize-toggle",14),r(),i(17,"label",15),a(18,"Enabled"),r()()()(),m(19,Pe,2,0,"div",16),r(),i(20,"div",17),s(21,"input",18),i(22,"label",19),a(23,"Validate Coupon URL"),r(),m(24,Ee,2,0,"div",20),r(),i(25,"div",17),s(26,"input",21),i(27,"label",22),a(28,"Redeem Coupon URL"),r(),m(29,xe,2,0,"div",20),r(),i(30,"div",23),s(31,"textarea",24),i(32,"label",25),a(33,"Request Header (Key: value)"),r(),m(34,Ge,2,0,"div",20),r()()()()()()()),e&2&&(p("config",o.config),l(5),p("formGroup",o.formGroup),l(5),p("ngClass",_(10,I,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),C(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),p("ngClass",_(12,I,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),C(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),p("ngClass",_(14,I,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),C(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),p("ngClass",_(16,I,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),C(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,ne,Q,J,Y,X,Z,ee,ue,me,ge],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var Re=(n,d)=>({"bg-success-subtle text-success-emphasis":n,"bg-danger-subtle text-danger-emphasis":d});function Me(n,d){if(n&1){let e=x();i(0,"button",10),v("click",function(){y(e);let t=f();return P(t.addNewCouponProvider())}),a(1," Add "),r()}}function Ie(n,d){n&1&&s(0,"th",11)}function Ne(n,d){if(n&1){let e=x();i(0,"td",15)(1,"i",16),v("click",function(){y(e);let t=f().$index,u=f(2);return P(u.onDeleteProvider(t))}),r()()}}function Te(n,d){if(n&1){let e=x();i(0,"tr"),m(1,Ne,2,0,"td",12),i(2,"td")(3,"a",13),v("click",function(){let t=y(e),u=t.$implicit,g=t.$index,_e=f(2);return P(_e.onUpdateProvider(u,g))}),a(4),r()(),i(5,"td"),a(6),r(),i(7,"td"),a(8),r(),i(9,"td"),a(10),r(),i(11,"td")(12,"span",14),a(13),r()()()}if(n&2){let e=d.$implicit,o=f(2);l(),p("ngIf",o.role.developer.Edit),l(3),T(" ",e.Name," "),l(2),G(e.ValidateCoupon),l(2),G(e.RedeemCoupon),l(2),G(e.KeyUI),l(2),p("ngClass",j(7,Re,e.Enabled,!e.Enabled)),l(),T(" ",e.Enabled?"Enabled":"Disabled"," ")}}function we(n,d){if(n&1&&O(0,Te,14,10,"tr",null,A),n&2){let e=f();U(e.listProviders())}}function Fe(n,d){n&1&&H(0)}function ke(n,d){if(n&1&&m(0,Fe,1,0,"ng-container",17),n&2){f();let e=$(25);p("ngTemplateOutlet",e)}}function Ve(n,d){n&1&&(i(0,"tr",18)(1,"td",19),s(2,"empty-state-table"),r()())}var he=class n extends ve{constructor(e,o,t,u,g){super(e,o,F.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=u;this.dialog=g}toastr=h(z);couponProviders=V([]);listProviders=K(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(S).afterClosed().pipe(N(e=>w.IsNotEmpty(e)),k(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(S,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(N(t=>w.IsNotEmpty(t))).subscribe(t=>{let u={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(g=>(g[o]=u,[...g])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(F.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||n)(c(se),c(ie),c(W),c(re),c(de))};static \u0275cmp=E({type:n,selectors:[["app-coupon-configuration"]],features:[D],decls:26,vars:6,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button","class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],["class","text-center","style","width: 10px",4,"ngIf"],[2,"width","220px"],["type","button",1,"btn","btn-success",3,"click"],[1,"text-center",2,"width","10px"],["class","text-center",4,"ngIf"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],[1,"text-center"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1&&(i(0,"mainpanel-cmp",1)(1,"actions"),m(2,Me,2,0,"button",2),r(),i(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"table",6)(8,"thead",7)(9,"tr"),m(10,Ie,1,0,"th",8),i(11,"th",9),a(12,"Name"),r(),i(13,"th"),a(14,"Validate Coupon"),r(),i(15,"th"),a(16,"Redeem Coupon"),r(),i(17,"th"),a(18,"Value"),r(),i(19,"th"),a(20,"Status"),r()()(),i(21,"tbody"),m(22,we,2,0)(23,ke,1,1,"ng-container"),r()()()()(),m(24,Ve,3,0,"ng-template",null,0,q),r()()),o&2){let u;p("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",t.role.developer.Edit),l(8),p("ngIf",t.role.developer.Edit),l(12),C(((u=t.listProviders())==null?null:u.length)>0?22:23)}},dependencies:[M,R,L,B,fe,ce,te,Ce],encapsulation:2})};export{he as CouponConfigurationComponent};