dealpos 12.2.1 → 12.2.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.
- package/POS/115.9ebdcaa2f52c0708.js +1 -0
- package/POS/1853.f9088128bd32d62d.js +1 -0
- package/POS/2527.c8c1472e2583d15c.js +1 -0
- package/POS/273.ea208bf7f28a988e.js +1 -0
- package/POS/2750.4f3502081043c30b.js +1 -0
- package/POS/4006.2820f4884cf41fe7.js +1 -0
- package/POS/4020.ac80a34a4226b0f7.js +1 -0
- package/POS/4177.98ff79b4b72c8768.js +1 -0
- package/POS/4941.8c2fb6ad16dc21d1.js +1 -0
- package/POS/4970.4fd0b65a33ec215d.js +1 -0
- package/POS/500.8a2dabd11040f420.js +1 -0
- package/POS/5189.6d0b24db775d8a7c.js +1 -0
- package/POS/5418.1a6d740d7982b8d7.js +1 -0
- package/POS/5453.70fcfbaa7bfcd55b.js +1 -0
- package/POS/5510.479c025aed7612fc.js +1 -0
- package/POS/5586.6557e4bd206a28bd.js +1 -0
- package/POS/6303.bfcba36635158bb0.js +1 -0
- package/POS/6664.5a6d92ea4c288821.js +1 -0
- package/POS/6756.ac761ce454dbfce0.js +1 -0
- package/POS/6840.d0036ec626577639.js +1 -0
- package/POS/7298.19d75745aecb3523.js +1 -0
- package/POS/{8054.02bafc6a28d5d42b.js → 8054.2a0e152902f9454b.js} +1 -1
- package/POS/8105.fb4aa9713c5f8216.js +1 -0
- package/POS/8126.2a3f67a7639fa6c8.js +1 -0
- package/POS/8317.5eadaac9d81f9a5f.js +1 -0
- package/POS/8393.3639956afb96922e.js +1 -0
- package/POS/8425.8d3419e0fb226dda.js +1 -0
- package/POS/{8761.d00f5e9ef6adc05a.js → 8761.7c5539bff80a4998.js} +1 -1
- package/POS/8914.a3caac170682904c.js +1 -0
- package/POS/9042.5c52e1b1c2f26f40.js +1 -0
- package/POS/9612.6a332f69514c0983.js +1 -0
- package/POS/9757.197c3204c36bdd73.js +1 -0
- package/POS/{2527.7e671ae42215b675.js → 9841.5c1c03ebf5b7893e.js} +1 -1
- package/POS/index.html +3 -3
- package/POS/main.434c24ea7d5f6011.js +1 -0
- package/POS/runtime.7c28f5c91adf7583.js +1 -0
- package/package.json +1 -1
- package/POS/115.faf66a92ffb8e0fa.js +0 -1
- package/POS/1161.5db77f1c5890479b.js +0 -1
- package/POS/1853.a523c1c0de55b558.js +0 -1
- package/POS/2526.b4ad12c60a108246.js +0 -1
- package/POS/273.aa3430d26aaaaabf.js +0 -1
- package/POS/2750.44fa1c937c460437.js +0 -1
- package/POS/3504.2290cd02b951afbe.js +0 -1
- package/POS/4020.950c26236689df3e.js +0 -1
- package/POS/4941.55032ce40c8b7bb6.js +0 -1
- package/POS/4970.6c1f07ab273bb655.js +0 -1
- package/POS/500.fde66eaf01c350bf.js +0 -1
- package/POS/5189.e69700ab78de8e26.js +0 -1
- package/POS/5418.6d27c5d37998c0a6.js +0 -1
- package/POS/6303.5724083b307f1ed5.js +0 -1
- package/POS/6551.7ed8f31c22230139.js +0 -1
- package/POS/6664.dddddeadb8f598db.js +0 -1
- package/POS/6756.282642d092316652.js +0 -1
- package/POS/6840.e30e2e5713dee5ae.js +0 -1
- package/POS/6848.66e59561799e0033.js +0 -1
- package/POS/6911.f2e3492f65624e74.js +0 -1
- package/POS/7149.db83dd1e57b156e5.js +0 -1
- package/POS/7298.0fe1355b1c157286.js +0 -1
- package/POS/8105.cbabd7e5241cf886.js +0 -1
- package/POS/8126.15a59dd489d5c498.js +0 -1
- package/POS/8131.30f39b9419207d2b.js +0 -1
- package/POS/8317.333320ad43107150.js +0 -1
- package/POS/8914.0f5348951d0f3368.js +0 -1
- package/POS/9156.6dae28969e50648b.js +0 -1
- package/POS/9612.b33ab182c52e8a3c.js +0 -1
- package/POS/9757.31a4924c0c04f996.js +0 -1
- package/POS/main.f191cc94fc23b4f8.js +0 -1
- package/POS/runtime.e2c25e098f6dde18.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[115],{24424:(_,E,l)=>{l.d(E,{O:()=>Z});var n=l(81180),C=l(69751),y=l(94650);let Z=(()=>{class b{constructor(){(0,n.Z)(this,"csvPrefixFormat","")}convertToCSV(d,I){let S;if("string"==typeof d)S=d;else{var m="object"==typeof d?d:JSON.parse(d);S=this.transformToCSVStringFormat(m)}this.exportCSV(S,I)}isNumeric(d){return/^-?\d+$/.test(d)}parseCSV(d){return new C.y(S=>{let m=new FileReader;m.onload=()=>{let f=m.result.split(/\r\n|\n/),e=f[0].split(","),a=[];for(let t=0;t<f.length;t++){let s=f[t].split(",");if(s.length==e.length){let r=[];for(let u=0;u<e.length;u++)this.isNumeric(s[u])?r.push(parseFloat(s[u])):r.push(s[u]);a.push(r)}else{var o=f[t].split(new RegExp(',(?![^"]*"(?:(?:[^"]*"){2})*[^"]*$)'));let r=[];for(let u=0;u<o.length;u++)this.isNumeric(o[u])?r.push(parseFloat(o[u])):r.push(o[u]);a.push(r)}}S.next(a)},m.readAsBinaryString(d)})}transformToCSVStringFormat(d){if(!d||!d.length)return;const S=Object.keys(d[0]);return d.map(M=>S.map(f=>{let e=null==M[f]?"":M[f];return e=e instanceof Date?e.toLocaleString():e.toString().replace(/"/g,'""'),e.search(/("|,|\n)/g)>=0&&(e=`"${e}"`),e}).join(",")).join("\n")}exportCSV(d,I){var S=new Blob([d],{type:"text/csv;charset=utf8;"}),m=document.createElement("a");m.setAttribute("href",window.URL.createObjectURL(S)),m.setAttribute("download",I),document.body.appendChild(m),m.click(),document.body.removeChild(m)}}return(0,n.Z)(b,"\u0275fac",function(d){return new(d||b)}),(0,n.Z)(b,"\u0275prov",y.Yz7({token:b,factory:b.\u0275fac,providedIn:"root"})),b})()},4077:(_,E,l)=>{l.d(E,{s:()=>m,n:()=>M});var n=l(81180),C=l(96700),y=l(67327),Z=l(24351),b=l(41206);class A{constructor(){(0,n.Z)(this,"enabledDragItem",void 0),this.enabledDragItem=!1}drop(e,a){(0,b.bA)(a.Data,e.previousIndex,e.currentIndex)}toggleEnabledDragItem(){}onSaveDragAndDrop(e,a){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||a.postListID(e,a.data.Data)}onPutSaveDragAndDrop(e,a){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||a.putListID(e,a.data.Data)}}class d{constructor(e){(0,n.Z)(this,"httpService",void 0),this.httpService=e}exportCSV(e,a,o,t){o.pageData.Filter.Export=!0,o.pageData.Filter.FormatType=m.CSV,t=t||"export.csv",this.httpService.post(`/api/${a}`,JSON.stringify(o.pageData.Filter)).subscribe(s=>{e.convertToCSV(s,t),o.pageData.Filter.Export=!1})}convertToCSV(e,a=!1,o){let t=this.ExportDataFromUI2(a);e.convertToCSV(t,o)}ExportDataFromUI2(e=!1){const a=document.getElementById("tableGrid"),o=[];return y.gT.IsNotEmpty(a)&&a.querySelectorAll("tr").forEach(s=>{const r=new Object;let u=0;s.querySelectorAll("th, td").forEach(R=>{u++;const O=parseInt(R.getAttribute("colspan"));for(let T=1;T<O;T++)r["column"+u]="",u++;const P=R.innerText,N=P.toString().split("");if(e&&"0"===N[0]&&N.length>1){let T="'"+P.trim();r["column"+u]=T}else r["column"+u]=P.trim()}),o.push(r)}),o}}var I=l(22863);class S{constructor(){(0,n.Z)(this,"listTotal",void 0),(0,n.Z)(this,"pageSize",void 0),(0,n.Z)(this,"show",void 0),this.listTotal=0,this.pageSize=0,this.show=!1}changePaginationData(e){this.pageSize=e.pageData.Filter.RowCount,this.listTotal=e.data?.ListTotal,this.show=this.pageSize<=this.listTotal}changePage(e,a,o){a.Filter.PageNumber=e.pageIndex+1,o.getListData()}}var m=(()=>{return(f=m||(m={}))[f.CSV=0]="CSV",f[f.XLSX=1]="XLSX",m;var f})();class M extends I.M{constructor(e,a,o,t,s){super(e),(0,n.Z)(this,"_httpService",void 0),(0,n.Z)(this,"dataAPI",void 0),(0,n.Z)(this,"pageAPI",void 0),(0,n.Z)(this,"toastrService",void 0),(0,n.Z)(this,"route",void 0),(0,n.Z)(this,"pageData",{Filter:{},Options:{},Roles:{},Config:{}}),(0,n.Z)(this,"data",void 0),(0,n.Z)(this,"pagination",new S),(0,n.Z)(this,"dragDrop",new A),(0,n.Z)(this,"exportHandler",void 0),(0,n.Z)(this,"comparation",0),(0,n.Z)(this,"queryParams",{}),this._httpService=e,this.dataAPI=a,this.pageAPI=o,this.toastrService=t,this.route=s,this.exportHandler=new d(e),o?(s&&(this.queryParams=this.route.snapshot.queryParams),this.preInitLoader(),this.menuData$.pipe((0,Z.b)(()=>this._httpService.post("/api/"+this.pageAPI,JSON.stringify(this.queryParams)))).subscribe(r=>{this.pageData=r,this.pageData.Filter||(this.pageData.Filter={}),this.pageData.Filter.PageNumber=1,this.pageData.Filter.ID=this.queryParams.ID,this.preInitList(),this.getListData()})):(this.pageData.Filter.RowCount=20,this.pageData.Filter.PageNumber=1,this.preInitList(),this.menuData$.subscribe(()=>{this.getListData()}))}preInitLoader(){}preInitList(){}getListData(e){this.preGetList(),this.dataAPI&&this._httpService.post("/api/"+this.dataAPI,JSON.stringify(this.pageData.Filter)).subscribe(a=>{this.data=a,this.postInit(a),this.pagination.changePaginationData(this),e&&(this.pageData.HideStoreApiCount=!1)})}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData.Filter.PageNumber=1,this.getListData("filterMode")}postInit(e){null!=e.PageTitle&&(this.menuData.H=e.PageTitle)}preGetList(){null==this.pageData.Filter.From&&(this.pageData.Filter.From=y.gT.MinDate),null==this.pageData.Filter.To&&(this.pageData.Filter.To=y.gT.MinDate)}preSearchFromPageOne(){}onPaginationChange(e){this.pagination.changePage(e,this.pageData,this)}onSelectAllData(e){this.data.Data=this.data.Data.map(a=>(a.selected=e,a))}getSelectedData(){let e=[];return this.data&&(e=this.data.Data.filter(a=>a.selected)),e}httpPostListID(e,a,o){if(a||(a="Are you sure you want to selected record/s?"),0==confirm(a))return;let t=this.getSelectedData();t.length>0&&this.postListID(e,t,o)}httpPutListID(e,a,o){if(a||(a="Are you sure you want to selected record/s?"),0==confirm(a))return;let t=this.getSelectedData();t.length>0&&this.putListID(e,t,o)}httpDeleteListID(e,a,o){if(a||(a="Are you sure you want to delete selected record/s?"),0==confirm(a))return;let t=this.getSelectedData();t.length>0&&this.DeleteListID(e,t,o)}onSaveDragAndDrop(e){this.dragDrop.onSaveDragAndDrop(e,this)}onPutSaveDragAndDrop(e){this.dragDrop.onPutSaveDragAndDrop(e,this)}postListID(e,a,o){const t=a.map(s=>o?s[o]:s.ID);this._httpService.post(`/api/${e}`,t).subscribe(s=>{this.toastrService.success(s.Message?s.Message:s,C.n.Success),this.getListData()})}putListID(e,a,o){const t=a.map(s=>o?s[o]:s.ID);this._httpService.put(`/api/${e}`,t).subscribe(s=>{this.toastrService.success(s.Message?s.Message:s,C.n.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(e,a,o){const t=a.map(s=>o?s[o]:s.ID);this._httpService.delete(`/api/${e}`,t).subscribe(s=>{this.toastrService.success(s.Message?s.Message:s,C.n.Success),this.getListData()})}postData(e,a){this._httpService.post("/API/"+e,JSON.stringify(a)).subscribe(o=>{this.getListData(),this.toastrService.success(o.Message?o.Message:o,C.n.Success)})}compare(e,a,o){return(e<a?-1:1)*(o?1:-1)}exportCSV(e,a,o){this.exportHandler.exportCSV(e,a,this,o)}s2ab(e){for(var a=new ArrayBuffer(e.length),o=new Uint8Array(a),t=0;t!=e.length;++t)o[t]=255&e.charCodeAt(t);return a}exportXlsx(e,a){this.pageData.Filter.FormatType=1,this.pageData.Filter.Export=!0,this.httpService.post(`/api/${e}`,JSON.stringify(this.pageData.Filter)).subscribe(o=>{a=decodeURI(a);const t=window.URL.createObjectURL(new Blob([this.s2ab(atob(o))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),s=document.createElement("a");s.href=t,s.setAttribute("download",a),document.body.appendChild(s),s.click(),window.URL.revokeObjectURL(t),s.remove()})}convertToCSV(e,a=!1,o){let t=this.exportHandler.ExportDataFromUI2(a);e.convertToCSV(t,o)}OnCompare(e){const a=e?this.data[e]:this.data;if(a.length<1)return;const o=Object.assign({},this.pageData.Filter);o.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),o.To=new Date(new Date(this.pageData.Filter.To).getFullYear(),new Date(this.pageData.Filter.To).getMonth(),0).toDateString(),this._httpService.post("/API/"+this.dataAPI,JSON.stringify(o)).subscribe(t=>{const s=e?t[e]:t;this.comparation=0,a.forEach(r=>{r.PrevIndex="-",r.CurrentIndex="-",r.Increase="-";const u=s.filter(D=>D.EntityID==r.EntityID);if(r.CurrentIndex=r.Rank,u.length>0){const D=u[0];r.PrevIndex=D.Rank,D.SalesNet?r.Increase=(r.SalesNet-D.SalesNet)/D.SalesNet*100:D.Sales&&(r.Increase=(r.Sales-D.Sales)/D.Sales*100),r.IsPositive=r.Increase>0,r.IsNegative=r.Increase<0,this.comparation+=r.Increase}})})}}},17554:(_,E,l)=>{l.d(E,{H:()=>T});var n=l(81180),C=l(36895),y=l(24006),Z=l(90811),b=l(65412),A=l(88796),d=l(65131),I=l(42046),S=l(63165),m=l(77579),M=l(63900),f=l(54004),e=l(18505),a=l(34782),o=l(95698),t=l(94650),s=l(89156),r=l(4077);let u=(()=>{class g{constructor(i){(0,n.Z)(this,"http",void 0),this.http=i}exportCSV(i,h,p){const c={...h,Export:!0,FormatType:r.s.CSV};this.http.post(`/api/${i}`,JSON.stringify(c)).subscribe(x=>this.convertToCSV(x,p+".csv"))}convertToCSV(i,h){let p;if("string"==typeof i)p=i;else{var c="object"==typeof i?i:JSON.parse(i);p=this.transformToCSVStringFormat(c)}this.downloadCSV(p,h)}transformToCSVStringFormat(i){if(!i||!i.length)return;const p=Object.keys(i[0]);return i.map(x=>p.map(F=>{let v=null==x[F]?"":x[F];return v=v instanceof Date?v.toLocaleString():v.toString().replace(/"/g,'""'),v.search(/("|,|\n)/g)>=0&&(v=`"${v}"`),v}).join(",")).join("\n")}downloadCSV(i,h){var p=new Blob([i],{type:"text/csv;charset=utf8;"}),c=document.createElement("a");c.setAttribute("href",window.URL.createObjectURL(p)),c.setAttribute("download",h),document.body.appendChild(c),c.click(),document.body.removeChild(c)}exportXlsx(i,h,p){const c={...h,FormatType:r.s.XLSX};this.http.post(`/api/${i}`,JSON.stringify(c)).subscribe(x=>{p=decodeURI(p+".xlsx");const F=window.URL.createObjectURL(new Blob([this.s2ab(atob(x))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),v=document.createElement("a");v.href=F,v.setAttribute("download",p),document.body.appendChild(v),v.click(),window.URL.revokeObjectURL(F),v.remove()})}s2ab(i){const h=new ArrayBuffer(i.length),p=new Uint8Array(h);for(let c=0;c!=i.length;++c)p[c]=255&i.charCodeAt(c);return h}}return(0,n.Z)(g,"\u0275fac",function(i){return new(i||g)(t.LFG(s.O))}),(0,n.Z)(g,"\u0275prov",t.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"})),g})();var D=l(83902);function R(g,L){if(1&g){const i=t.EpF();t.ynx(0),t.TgZ(1,"div",11),t._uU(2,"Columns"),t.qZA(),t.TgZ(3,"div",12)(4,"ng-select",13),t.NdJ("ngModelChange",function(p){t.CHM(i);const c=t.oxw();return t.KtG(c.exportType=p)})("change",function(p){t.CHM(i);const c=t.oxw();return t.KtG(c.onChangeExportType(p))}),t.qZA()(),t.BQk()}if(2&g){const i=t.oxw();t.xp6(4),t.Q6J("items",i.exportTypes)("ngModel",i.exportType)}}function O(g,L){if(1&g){const i=t.EpF();t.TgZ(0,"i",21),t.NdJ("click",function(){t.CHM(i);const p=t.oxw(3);return t.KtG(p.onGetAllDataLength())}),t.qZA()}}function P(g,L){if(1&g&&(t.TgZ(0,"span"),t._uU(1,"of "),t.YNc(2,O,1,0,"i",19),t.ALo(3,"async"),t.TgZ(4,"span",20),t._uU(5),t.ALo(6,"async"),t.qZA(),t._uU(7," page(s)"),t.qZA()),2&g){const i=t.oxw(2);t.xp6(2),t.Q6J("ngIf",!t.lcZ(3,2,i.allDataLength$)),t.xp6(3),t.Oqu(t.lcZ(6,4,i.allDataLength$))}}function N(g,L){if(1&g){const i=t.EpF();t.ynx(0),t.TgZ(1,"div",4),t._uU(2,"Page"),t.qZA(),t.TgZ(3,"div",14)(4,"input",15),t.NdJ("ngModelChange",function(p){t.CHM(i);const c=t.oxw();return c.pageNumber=p,t.KtG(c.onChangePageNumber())}),t.qZA(),t.YNc(5,P,8,6,"span",3),t.qZA(),t.TgZ(6,"div",16)(7,"div",17),t._UZ(8,"i",18),t._uU(9),t.ALo(10,"number"),t.ALo(11,"number"),t.qZA()(),t.BQk()}if(2&g){const i=t.oxw();t.xp6(4),t.Q6J("ngModel",i.pageNumber),t.xp6(1),t.Q6J("ngIf",i.getAllDataLengthAPI),t.xp6(4),t.AsE(" Exporting data from ",t.lcZ(10,4,i.displayedMinRangeRow)," - ",t.lcZ(11,6,i.displayedMaxRangeRow)," ")}}let T=(()=>{class g{constructor(i,h,p,c){(0,n.Z)(this,"dialogRef",void 0),(0,n.Z)(this,"exportHandler",void 0),(0,n.Z)(this,"pageNumber",1),(0,n.Z)(this,"pageSize",1e4),(0,n.Z)(this,"config",new I.O),(0,n.Z)(this,"exportTypes",[]),(0,n.Z)(this,"exportType",void 0),(0,n.Z)(this,"exportFormat","CSV"),(0,n.Z)(this,"exportFormats",[{ID:"CSV"},{ID:"XLSX"}]),(0,n.Z)(this,"_onGetAllDataLength",new m.x),(0,n.Z)(this,"onGetAllDataLength$",this._onGetAllDataLength.asObservable()),(0,n.Z)(this,"allDataLength$",void 0),(0,n.Z)(this,"filterExport",void 0),(0,n.Z)(this,"displayedMaxRangeRow",this.pageSize),(0,n.Z)(this,"displayedMinRangeRow",this.pageNumber),(0,n.Z)(this,"fileName",void 0),(0,n.Z)(this,"pagination",void 0),(0,n.Z)(this,"getAllDataLengthAPI",""),this.dialogRef=h,this.exportHandler=c,this.config.title=`Export ${i.title}`,this.config.hideCancel=!0,this.config.customWidth="450px",this.exportTypes=i.exportTypes,this.exportType=this.exportTypes[0].ID,this.fileName=this.exportTypes[0].FileName,this.filterExport=i.filterExport,this.pagination=i.pagination,this.getAllDataLengthAPI=i.getAllDataLengthAPI,this.allDataLength$=this.onGetAllDataLength$.pipe((0,M.w)(()=>p.post("/API/"+i.getAllDataLengthAPI,this.filterExport)),(0,f.U)(x=>"number"==typeof x?x:x.Count),(0,e.b)(x=>{x<this.displayedMaxRangeRow&&this.setMinMaxRangeDisplayedRow(x)}),(0,f.U)(x=>Math.floor(x/this.pageSize)+(x%this.pageSize>0?1:0)),(0,a.d)(1),(0,o.q)(1))}onOk(){this.filterExport={...this.filterExport,Export:!0},this.pagination&&(this.filterExport={...this.filterExport,ExportPageNumber:this.pageNumber,ExportRowCount:this.pageSize}),"CSV"==this.exportFormat?this.exportHandler.exportCSV(this.exportType,this.filterExport,this.fileName):"XLSX"==this.exportFormat&&this.exportHandler.exportXlsx(this.exportType,this.filterExport,this.fileName),this.dialogRef.close()}onGetAllDataLength(){this._onGetAllDataLength.next()}onChangePageNumber(){this.setDisplayedMinMaxRangeRow()}setMinMaxRangeDisplayedRow(i){for(;this.displayedMaxRangeRow>i&&this.pageNumber>1;)this.pageNumber-=1,this.setDisplayedMinMaxRangeRow();this.displayedMaxRangeRow=i}onChangeExportType(i){this.fileName=i.FileName}setDisplayedMinMaxRangeRow(){this.displayedMinRangeRow=this.pageNumber*this.pageSize-this.pageSize+1,this.displayedMaxRangeRow=this.pageNumber*this.pageSize}}return(0,n.Z)(g,"\u0275fac",function(i){return new(i||g)(t.Y36(b.WI),t.Y36(b.so),t.Y36(s.O),t.Y36(u))}),(0,n.Z)(g,"\u0275cmp",t.Xpm({type:g,selectors:[["POS-modal-complex-export"]],standalone:!0,features:[t.jDz],decls:16,vars:4,consts:[[3,"config","onCancel","onClose","onOk"],[1,"container-fluid"],[1,"row"],[4,"ngIf"],[1,"col-3","fw-bold","mt-8",2,"display","flex","align-items","center"],[1,"col-9","mt-8"],[3,"ngModel","ngModelChange"],["value","CSV"],[1,"fa-solid","fa-file-csv","me-3","mb-1"],["value","XLSX"],[1,"fa-solid","fa-file-excel","me-3","mb-1"],[1,"col-3","fw-bold",2,"display","flex","align-items","center"],[1,"col-9"],["appendTo","body","bindLabel","Value","bindValue","ID",3,"items","ngModel","ngModelChange","change"],[1,"col-9","mt-8",2,"display","flex","align-items","center","column-gap","10px"],["type","text","autoNum","","name","pageNumber","id","pageNumber",1,"form-control","text-center",2,"width","50px",3,"ngModel","ngModelChange"],[1,"col-12","mt-8"],[1,"p-3",2,"background-color","#ADD8E6","border-radius","4px"],[1,"fa-solid","fa-circle-exclamation","mx-3"],["class","fa-solid fa-circle-question mx-3",3,"click",4,"ngIf"],[1,"fw-bold"],[1,"fa-solid","fa-circle-question","mx-3",3,"click"]],template:function(i,h){1&i&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return h.dialogRef.close()})("onClose",function(){return h.dialogRef.close()})("onOk",function(){return h.onOk()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2),t.YNc(4,R,5,2,"ng-container",3),t.TgZ(5,"div",4),t._uU(6,"Format"),t.qZA(),t.TgZ(7,"div",5)(8,"mat-button-toggle-group",6),t.NdJ("ngModelChange",function(c){return h.exportFormat=c}),t.TgZ(9,"mat-button-toggle",7),t._UZ(10,"i",8),t._uU(11,"CSV"),t.qZA(),t.TgZ(12,"mat-button-toggle",9),t._UZ(13,"i",10),t._uU(14,"XLSX"),t.qZA()()(),t.YNc(15,N,12,8,"ng-container",3),t.qZA()()()()),2&i&&(t.Q6J("config",h.config),t.xp6(4),t.Q6J("ngIf",h.exportTypes.length>1),t.xp6(4),t.Q6J("ngModel",h.exportFormat),t.xp6(7),t.Q6J("ngIf",h.pagination))},dependencies:[S.d,S.M,A.A0,A.w9,y.u5,y.Fj,y.JJ,y.On,C.ez,C.O5,C.Ov,C.JJ,d.X,D.b,Z.vV,Z.A9,Z.Yi],styles:[".general[_ngcontent-%COMP%], .page[_ngcontent-%COMP%]{border:1px solid #dcdcdc;border-radius:3px;padding:10px 8px;position:relative}.general[_ngcontent-%COMP%]{margin-bottom:15px}.floating-title[_ngcontent-%COMP%]{position:absolute;top:-10.5px;background:white;color:gray;font-size:14px}.select-header[_ngcontent-%COMP%]{line-height:36px}.input-header[_ngcontent-%COMP%]{line-height:36.6px}.form-control[_ngcontent-%COMP%]{height:max-content!important;padding:.375rem .75rem!important}"]})),g})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[1853],{88651:(L,U,_)=>{_.d(U,{U:()=>A});var a=_(81180),g=_(24351),l=_(22863);class A extends l.M{get formData(){return this.data.Form}get options(){return this.data.Options?this.data.Options:{}}get Roles(){return this.data.Roles?this.data.Roles:{}}constructor(v,t,Z){super(v),(0,a.Z)(this,"formDataAPI",void 0),(0,a.Z)(this,"route",void 0),(0,a.Z)(this,"data",{}),this.formDataAPI=t,this.route=Z;let x=this.route.snapshot.queryParams;this.menuData$.pipe((0,g.b)(()=>this.httpService.post(`/api/${this.formDataAPI}`,JSON.stringify(x)))).subscribe(f=>{this.data=f,this.postBindForm(f)})}postBindForm(v){}onSubmit(v,t=!1){this.preSubmitForm(),this.httpService.post(`/api/${v}`,JSON.stringify(this.formData)).subscribe({next:Z=>{this.onSubmitSuccess(Z)},error:Z=>{this.onSubmitError(Z)}})}compare(v,t,Z){return(v<t?-1:1)*(Z?1:-1)}preSubmitForm(){}onSubmitSuccess(v){}onSubmitError(v){}}},4077:(L,U,_)=>{_.d(U,{s:()=>f,n:()=>b});var a=_(81180),g=_(96700),l=_(67327),A=_(24351),P=_(41206);class v{constructor(){(0,a.Z)(this,"enabledDragItem",void 0),this.enabledDragItem=!1}drop(d,s){(0,P.bA)(s.Data,d.previousIndex,d.currentIndex)}toggleEnabledDragItem(){}onSaveDragAndDrop(d,s){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||s.postListID(d,s.data.Data)}onPutSaveDragAndDrop(d,s){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||s.putListID(d,s.data.Data)}}class t{constructor(d){(0,a.Z)(this,"httpService",void 0),this.httpService=d}exportCSV(d,s,u,p){u.pageData.Filter.Export=!0,u.pageData.Filter.FormatType=f.CSV,p=p||"export.csv",this.httpService.post(`/api/${s}`,JSON.stringify(u.pageData.Filter)).subscribe(h=>{d.convertToCSV(h,p),u.pageData.Filter.Export=!1})}convertToCSV(d,s=!1,u){let p=this.ExportDataFromUI2(s);d.convertToCSV(p,u)}ExportDataFromUI2(d=!1){const s=document.getElementById("tableGrid"),u=[];return l.gT.IsNotEmpty(s)&&s.querySelectorAll("tr").forEach(h=>{const m=new Object;let C=0;h.querySelectorAll("th, td").forEach(w=>{C++;const N=parseInt(w.getAttribute("colspan"));for(let Q=1;Q<N;Q++)m["column"+C]="",C++;const q=w.innerText,J=q.toString().split("");if(d&&"0"===J[0]&&J.length>1){let Q="'"+q.trim();m["column"+C]=Q}else m["column"+C]=q.trim()}),u.push(m)}),u}}var Z=_(22863);class x{constructor(){(0,a.Z)(this,"listTotal",void 0),(0,a.Z)(this,"pageSize",void 0),(0,a.Z)(this,"show",void 0),this.listTotal=0,this.pageSize=0,this.show=!1}changePaginationData(d){this.pageSize=d.pageData.Filter.RowCount,this.listTotal=d.data?.ListTotal,this.show=this.pageSize<=this.listTotal}changePage(d,s,u){s.Filter.PageNumber=d.pageIndex+1,u.getListData()}}var f=(()=>{return(T=f||(f={}))[T.CSV=0]="CSV",T[T.XLSX=1]="XLSX",f;var T})();class b extends Z.M{constructor(d,s,u,p,h){super(d),(0,a.Z)(this,"_httpService",void 0),(0,a.Z)(this,"dataAPI",void 0),(0,a.Z)(this,"pageAPI",void 0),(0,a.Z)(this,"toastrService",void 0),(0,a.Z)(this,"route",void 0),(0,a.Z)(this,"pageData",{Filter:{},Options:{},Roles:{},Config:{}}),(0,a.Z)(this,"data",void 0),(0,a.Z)(this,"pagination",new x),(0,a.Z)(this,"dragDrop",new v),(0,a.Z)(this,"exportHandler",void 0),(0,a.Z)(this,"comparation",0),(0,a.Z)(this,"queryParams",{}),this._httpService=d,this.dataAPI=s,this.pageAPI=u,this.toastrService=p,this.route=h,this.exportHandler=new t(d),u?(h&&(this.queryParams=this.route.snapshot.queryParams),this.preInitLoader(),this.menuData$.pipe((0,A.b)(()=>this._httpService.post("/api/"+this.pageAPI,JSON.stringify(this.queryParams)))).subscribe(m=>{this.pageData=m,this.pageData.Filter||(this.pageData.Filter={}),this.pageData.Filter.PageNumber=1,this.pageData.Filter.ID=this.queryParams.ID,this.preInitList(),this.getListData()})):(this.pageData.Filter.RowCount=20,this.pageData.Filter.PageNumber=1,this.preInitList(),this.menuData$.subscribe(()=>{this.getListData()}))}preInitLoader(){}preInitList(){}getListData(d){this.preGetList(),this.dataAPI&&this._httpService.post("/api/"+this.dataAPI,JSON.stringify(this.pageData.Filter)).subscribe(s=>{this.data=s,this.postInit(s),this.pagination.changePaginationData(this),d&&(this.pageData.HideStoreApiCount=!1)})}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData.Filter.PageNumber=1,this.getListData("filterMode")}postInit(d){null!=d.PageTitle&&(this.menuData.H=d.PageTitle)}preGetList(){null==this.pageData.Filter.From&&(this.pageData.Filter.From=l.gT.MinDate),null==this.pageData.Filter.To&&(this.pageData.Filter.To=l.gT.MinDate)}preSearchFromPageOne(){}onPaginationChange(d){this.pagination.changePage(d,this.pageData,this)}onSelectAllData(d){this.data.Data=this.data.Data.map(s=>(s.selected=d,s))}getSelectedData(){let d=[];return this.data&&(d=this.data.Data.filter(s=>s.selected)),d}httpPostListID(d,s,u){if(s||(s="Are you sure you want to selected record/s?"),0==confirm(s))return;let p=this.getSelectedData();p.length>0&&this.postListID(d,p,u)}httpPutListID(d,s,u){if(s||(s="Are you sure you want to selected record/s?"),0==confirm(s))return;let p=this.getSelectedData();p.length>0&&this.putListID(d,p,u)}httpDeleteListID(d,s,u){if(s||(s="Are you sure you want to delete selected record/s?"),0==confirm(s))return;let p=this.getSelectedData();p.length>0&&this.DeleteListID(d,p,u)}onSaveDragAndDrop(d){this.dragDrop.onSaveDragAndDrop(d,this)}onPutSaveDragAndDrop(d){this.dragDrop.onPutSaveDragAndDrop(d,this)}postListID(d,s,u){const p=s.map(h=>u?h[u]:h.ID);this._httpService.post(`/api/${d}`,p).subscribe(h=>{this.toastrService.success(h.Message?h.Message:h,g.n.Success),this.getListData()})}putListID(d,s,u){const p=s.map(h=>u?h[u]:h.ID);this._httpService.put(`/api/${d}`,p).subscribe(h=>{this.toastrService.success(h.Message?h.Message:h,g.n.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(d,s,u){const p=s.map(h=>u?h[u]:h.ID);this._httpService.delete(`/api/${d}`,p).subscribe(h=>{this.toastrService.success(h.Message?h.Message:h,g.n.Success),this.getListData()})}postData(d,s){this._httpService.post("/API/"+d,JSON.stringify(s)).subscribe(u=>{this.getListData(),this.toastrService.success(u.Message?u.Message:u,g.n.Success)})}compare(d,s,u){return(d<s?-1:1)*(u?1:-1)}exportCSV(d,s,u){this.exportHandler.exportCSV(d,s,this,u)}s2ab(d){for(var s=new ArrayBuffer(d.length),u=new Uint8Array(s),p=0;p!=d.length;++p)u[p]=255&d.charCodeAt(p);return s}exportXlsx(d,s){this.pageData.Filter.FormatType=1,this.pageData.Filter.Export=!0,this.httpService.post(`/api/${d}`,JSON.stringify(this.pageData.Filter)).subscribe(u=>{s=decodeURI(s);const p=window.URL.createObjectURL(new Blob([this.s2ab(atob(u))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),h=document.createElement("a");h.href=p,h.setAttribute("download",s),document.body.appendChild(h),h.click(),window.URL.revokeObjectURL(p),h.remove()})}convertToCSV(d,s=!1,u){let p=this.exportHandler.ExportDataFromUI2(s);d.convertToCSV(p,u)}OnCompare(d){const s=d?this.data[d]:this.data;if(s.length<1)return;const u=Object.assign({},this.pageData.Filter);u.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),u.To=new Date(new Date(this.pageData.Filter.To).getFullYear(),new Date(this.pageData.Filter.To).getMonth(),0).toDateString(),this._httpService.post("/API/"+this.dataAPI,JSON.stringify(u)).subscribe(p=>{const h=d?p[d]:p;this.comparation=0,s.forEach(m=>{m.PrevIndex="-",m.CurrentIndex="-",m.Increase="-";const C=h.filter(S=>S.EntityID==m.EntityID);if(m.CurrentIndex=m.Rank,C.length>0){const S=C[0];m.PrevIndex=S.Rank,S.SalesNet?m.Increase=(m.SalesNet-S.SalesNet)/S.SalesNet*100:S.Sales&&(m.Increase=(m.Sales-S.Sales)/S.Sales*100),m.IsPositive=m.Increase>0,m.IsNegative=m.Increase<0,this.comparation+=m.Increase}})})}}},15378:(L,U,_)=>{_.r(U),_.d(U,{ProfileModule:()=>rn});var a=_(81180),g=_(36895),l=_(24006),A=_(9116),P=_(88651),v=_(96700),t=_(94650),Z=_(89156),x=_(97185),f=_(65412),b=_(31920),T=_(51161),d=_(30273),s=_(10266),u=_(64425),p=_(67327);const m="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",C="0123456789ABCDEFGHIJKLMNOPQRSTUV",S="0123456789ABCDEFGHJKMNPQRSTVWXYZ";var N=_(77579),q=_(82722),J=_(39300),Q=_(63900),k=_(42046),F=_(63165);let et=(()=>{class n{constructor(e){(0,a.Z)(this,"dialogRef",void 0),(0,a.Z)(this,"config",void 0),this.dialogRef=e}ngOnInit(){this.config=new k.O,this.config.okText="Disable Two Factor Authentication",this.config.customWidth="500px",this.config.title="DIsabled Two Factor Authentication",this.config.headerType=v.n.Warning}onOk(){this.dialogRef.close(!0)}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.so))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-modal-confirmation-disabled"]],decls:5,vars:1,consts:[[3,"config","onOk","onCancel","onClose"],[1,"row","px-10","py-4"],[1,"font-weight-normal","h4","text-left","lh-base"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"p",2),t._uU(4,"Are you sure you want to disable two factor authentication for your account? "),t.qZA()()()()),2&e&&t.Q6J("config",o.config)},dependencies:[F.M]})),n})();var j=_(15861),V=_(3259),nt=_(11481);const ot=["qrcElement"];let it=(()=>{class n{constructor(e,o){this.renderer=e,this.sanitizer=o,this.allowEmptyString=!1,this.colorDark="#000000ff",this.colorLight="#ffffffff",this.cssClass="qrcode",this.elementType="canvas",this.errorCorrectionLevel="M",this.margin=4,this.qrdata="",this.scale=4,this.width=10,this.qrCodeURL=new t.vpe,this.context=null}ngOnChanges(){var e=this;return(0,j.Z)(function*(){yield e.createQRCode()})()}isValidQrCodeText(e){return!1===this.allowEmptyString?!(typeof e>"u"||""===e||"null"===e||null===e):!(typeof e>"u")}toDataURL(e){return new Promise((o,i)=>{(0,V.toDataURL)(this.qrdata,e,(c,y)=>{c?i(c):o(y)})})}toCanvas(e,o){return new Promise((i,c)=>{(0,V.toCanvas)(e,this.qrdata,o,y=>{y?c(y):i("success")})})}toSVG(e){return new Promise((o,i)=>{(0,V.toString)(this.qrdata,e,(c,y)=>{c?i(c):o(y)})})}renderElement(e){for(const o of this.qrcElement.nativeElement.childNodes)this.renderer.removeChild(this.qrcElement.nativeElement,o);this.renderer.appendChild(this.qrcElement.nativeElement,e)}createQRCode(){var e=this;return(0,j.Z)(function*(){e.version&&e.version>40?(console.warn("[angularx-qrcode] max value for `version` is 40"),e.version=40):e.version&&e.version<1?(console.warn("[angularx-qrcode]`min value for `version` is 1"),e.version=1):void 0!==e.version&&isNaN(e.version)&&(console.warn("[angularx-qrcode] version should be a number, defaulting to auto."),e.version=void 0);try{if(!e.isValidQrCodeText(e.qrdata))throw new Error("[angularx-qrcode] Field `qrdata` is empty, set 'allowEmptyString=\"true\"' to overwrite this behaviour.");e.isValidQrCodeText(e.qrdata)&&""===e.qrdata&&(e.qrdata=" ");const o={color:{dark:e.colorDark,light:e.colorLight},errorCorrectionLevel:e.errorCorrectionLevel,margin:e.margin,scale:e.scale,version:e.version,width:e.width},i=e.imageSrc,c=e.imageHeight||40,y=e.imageWidth||40;switch(e.elementType){case"canvas":const D=e.renderer.createElement("canvas");e.context=D.getContext("2d"),e.toCanvas(D,o).then(()=>{if(e.ariaLabel&&e.renderer.setAttribute(D,"aria-label",`${e.ariaLabel}`),e.title&&e.renderer.setAttribute(D,"title",`${e.title}`),i&&e.context){e.centerImage=new Image(y,c),i!==e.centerImage.src&&(e.centerImage.src=i),c!==e.centerImage.height&&(e.centerImage.height=c),y!==e.centerImage.width&&(e.centerImage.width=y);const O=e.centerImage;O&&(O.onload=()=>{e.context?.drawImage(O,D.width/2-y/2,D.height/2-c/2,y,c)})}e.renderElement(D),e.emitQRCodeURL(D)}).catch(O=>{console.error("[angularx-qrcode] canvas error:",O)});break;case"svg":const M=e.renderer.createElement("div");e.toSVG(o).then(O=>{e.renderer.setProperty(M,"innerHTML",O);const H=M.firstChild;e.renderer.setAttribute(H,"height",`${e.width}`),e.renderer.setAttribute(H,"width",`${e.width}`),e.renderElement(H),e.emitQRCodeURL(H)}).catch(O=>{console.error("[angularx-qrcode] svg error:",O)});break;default:const I=e.renderer.createElement("img");e.toDataURL(o).then(O=>{e.alt&&I.setAttribute("alt",e.alt),e.ariaLabel&&I.setAttribute("aria-label",e.ariaLabel),I.setAttribute("src",O),e.title&&I.setAttribute("title",e.title),e.renderElement(I),e.emitQRCodeURL(I)}).catch(O=>{console.error("[angularx-qrcode] img/url error:",O)})}}catch(o){console.error("[angularx-qrcode] Error generating QR Code:",o.message)}})()}emitQRCodeURL(e){const o=e.constructor.name;if(o===SVGSVGElement.name){const y=new Blob([e.outerHTML],{type:"image/svg+xml"}),D=URL.createObjectURL(y),M=this.sanitizer.bypassSecurityTrustUrl(D);return void this.qrCodeURL.emit(M)}let i="";o===HTMLCanvasElement.name&&(i=e.toDataURL("image/png")),o===HTMLImageElement.name&&(i=e.src),fetch(i).then(c=>c.blob()).then(c=>URL.createObjectURL(c)).then(c=>this.sanitizer.bypassSecurityTrustUrl(c)).then(c=>{this.qrCodeURL.emit(c)}).catch(c=>{console.error("[angularx-qrcode] Error when fetching image/png URL: "+c)})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.Qsj),t.Y36(nt.H7))},n.\u0275cmp=t.Xpm({type:n,selectors:[["qrcode"]],viewQuery:function(e,o){if(1&e&&t.Gf(ot,7),2&e){let i;t.iGM(i=t.CRH())&&(o.qrcElement=i.first)}},inputs:{allowEmptyString:"allowEmptyString",colorDark:"colorDark",colorLight:"colorLight",cssClass:"cssClass",elementType:"elementType",errorCorrectionLevel:"errorCorrectionLevel",imageSrc:"imageSrc",imageHeight:"imageHeight",imageWidth:"imageWidth",margin:"margin",qrdata:"qrdata",scale:"scale",version:"version",width:"width",alt:"alt",ariaLabel:"ariaLabel",title:"title"},outputs:{qrCodeURL:"qrCodeURL"},features:[t.TTD],decls:2,vars:2,consts:[["qrcElement",""]],template:function(e,o){1&e&&t._UZ(0,"div",null,0),2&e&&t.Tol(o.cssClass)},encapsulation:2,changeDetection:0}),n})(),at=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({}),n})();function rt(n,r){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"div")(2,"div",3),t._uU(3," Two Factor Authentication Status: "),t.TgZ(4,"span",4),t._uU(5,"Enabled"),t.qZA()()(),t.TgZ(6,"div",5)(7,"button",6),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onDisableTotp())}),t._uU(8,"Disable Two Factor Authentication"),t.qZA()(),t.BQk()}}function st(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",7)(1,"div",8)(2,"h4"),t._uU(3,"Connect Your DealPOS account to an Authenticator Application"),t.qZA(),t.TgZ(4,"p"),t._uU(5,"Secure your login with One Time Password using an Authenticator Application!"),t.qZA()()(),t.TgZ(6,"div",7)(7,"div",8)(8,"ol",9)(9,"li",10)(10,"h5"),t._uU(11,"Download Authenticator application"),t.qZA(),t.TgZ(12,"div",11)(13,"a",12),t._UZ(14,"img",13),t._uU(15," Microsoft Authenticator "),t.qZA(),t.TgZ(16,"a",14),t._UZ(17,"img",15),t._uU(18," Google Authenticator "),t.qZA()()(),t.TgZ(19,"li",16)(20,"h5"),t._uU(21,"Scan the QR code below"),t.qZA(),t.TgZ(22,"div",5),t._UZ(23,"qrcode",17),t.qZA()(),t.TgZ(24,"li",16)(25,"h5"),t._uU(26,"Validate your QR Code"),t.qZA(),t.TgZ(27,"form",18),t.NdJ("submit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onValidate())}),t.TgZ(28,"div")(29,"input",19),t.NdJ("keypress",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.numberOnly(i))})("ngModelChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.validation2FA.ValidationCode=i)}),t.qZA()(),t.TgZ(30,"div",5)(31,"button",20),t._uU(32,"Validate"),t.qZA()()()()()()()}if(2&n){const e=t.oxw();t.xp6(23),t.Q6J("qrdata",e.qrcodeContent)("width",256),t.xp6(6),t.Q6J("ngModel",e.validation2FA.ValidationCode)}}let lt=(()=>{class n{constructor(e,o,i,c){(0,a.Z)(this,"document",void 0),(0,a.Z)(this,"authenticatorService",void 0),(0,a.Z)(this,"toastrService",void 0),(0,a.Z)(this,"dialog",void 0),(0,a.Z)(this,"qrcodeContent",void 0),(0,a.Z)(this,"validation2FA",{SecretKey:null,ValidationCode:null,Enabled:!0}),(0,a.Z)(this,"destroy$",void 0),(0,a.Z)(this,"totpEnabled",void 0),this.document=e,this.authenticatorService=o,this.toastrService=i,this.dialog=c,this.destroy$=new N.x}ngOnInit(){this.generateQrCodeContent()}generateQrCodeContent(){const e=this.getDomainName(),o=this.generateRandomSecret();this.validation2FA.SecretKey=o,this.qrcodeContent=`otpauth://totp/${e}?secret=${o}&issuer=dealpos`}generateRandomSecret(){const e=p.gT.Guid_NewGuid();return function w(n,r,e){let o,i;switch(e=e||{},r){case"RFC3548":case"RFC4648":o=m,i=!0;break;case"RFC4648-HEX":o=C,i=!0;break;case"Crockford":o=S,i=!1;break;default:throw new Error("Unknown base32 variant: "+r)}const c=void 0!==e.padding?e.padding:i,y=function h(n){if(n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray)return new DataView(n.buffer,n.byteOffset,n.byteLength);if(n instanceof ArrayBuffer)return new DataView(n);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}(n);let D=0,M=0,I="";for(let O=0;O<y.byteLength;O++)for(M=M<<8|y.getUint8(O),D+=8;D>=5;)I+=o[M>>>D-5&31],D-=5;if(D>0&&(I+=o[M<<5-D&31]),c)for(;I.length%8!=0;)I+="=";return I}((new TextEncoder).encode(e),"RFC3548")}getDomainName(){return this.document.location.origin.replace(/^https?:\/\//,"")}onValidate(){this.validateOnVerfiyCode()&&this.authenticatorService.configure2FA(this.validation2FA).pipe((0,q.R)(this.destroy$)).subscribe(e=>{this.toastrService.success(e.Message,"TOTP Enabled"),this.totpEnabled=!0})}validateOnVerfiyCode(){let e=!0;return p.gT.IsEmpty(this.validation2FA.ValidationCode)?(e=!1,this.toastrService.warning("You must enter a authentication code.","Warning")):(this.validation2FA.ValidationCode.length<6||this.validation2FA.ValidationCode.length>6)&&(e=!1,this.toastrService.warning("The authentication code must be six digits long.","Warning")),e}numberOnly(e){return p.gT.numberOnly(e)}onDisableTotp(){this.dialog.open(et).afterClosed().pipe((0,J.h)(e=>p.gT.IsNotEmpty(e)),(0,Q.w)(()=>this.authenticatorService.disableTwoFactorAuthentication())).subscribe(e=>{this.toastrService.success(e.Message,"TOTP Disabled"),this.totpEnabled=!1})}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(g.K0),t.Y36(b.g),t.Y36(x._W),t.Y36(f.uw))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-setup-2FA"]],inputs:{totpEnabled:"totpEnabled"},decls:4,vars:2,consts:[[1,"container-fluid","mt-6"],[4,"ngIf","ngIfElse"],["TOTP_ENABLED",""],[1,"d-inline-block","fs-5"],[1,"text-success","fw-bold"],[1,"mt-6"],["type","button","type","submit",1,"btn","btn-sm","btn-danger",3,"click"],[1,"row"],[1,"col-12"],[1,"ps-7"],[1,"fw-bold"],[1,"d-flex","align-items-center","mt-6"],["href","https://play.google.com/store/apps/details?id=com.azure.authenticator","target","_blank",1,"link-dark","border","py-3","px-6","me-6","border-primary","border-2"],["src","https://res.cloudinary.com/pos/image/upload/v1666247461/POS/Images/Login/Microsoft_Authenticator.png",2,"width","35px"],["href","https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2","target","_blank",1,"link-dark","border","py-3","px-6","me-6","border-primary","border-2"],["src","https://res.cloudinary.com/pos/image/upload/v1666247460/POS/Images/Login/Google_Authenticator.png",2,"width","35px"],[1,"fw-bold","mt-6"],["errorCorrectionLevel","H",1,"qr2fa",3,"qrdata","width"],[1,"mt-6",3,"submit"],["type","text","name","auth","placeholder","Enter six Digit Code",1,"form-control","rounded","customInput","border","border-2","border-primary",3,"ngModel","keypress","ngModelChange"],["type","button","type","submit",1,"btn","btn-sm","btn-primary","py-3"]],template:function(e,o){if(1&e&&(t.TgZ(0,"div",0),t.YNc(1,rt,9,0,"ng-container",1),t.YNc(2,st,33,3,"ng-template",null,2,t.W1O),t.qZA()),2&e){const i=t.MAs(3);t.xp6(1),t.Q6J("ngIf",o.totpEnabled)("ngIfElse",i)}},dependencies:[g.O5,l._Y,l.Fj,l.JJ,l.JL,l.On,l.F,it],styles:[".customInput[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem!important;color:#343434;font-size:.875rem;border-radius:.25rem!important;width:370px} qrcode.qr2fa>.qrcode>canvas{border:2px solid rgb(51,122,183);padding:2px}"]})),n})();function ct(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",57),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.validate())}),t._uU(1,"Submit"),t.qZA()}if(2&n){t.oxw(2);const e=t.MAs(33);t.Q6J("disabled",null==e||null==e.form?null:e.form.invalid)}}function dt(n,r){if(1&n&&(t.ynx(0),t.YNc(1,ct,2,1,"button",56),t.BQk()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.roleService.users.View||e.roleService.profile.View)}}function pt(n,r){1&n&&(t.TgZ(0,"small",62),t._uU(1,"*Email is required"),t.qZA())}function ut(n,r){1&n&&(t.TgZ(0,"small",62),t._uU(1,"*Enter a valid email address"),t.qZA())}function mt(n,r){if(1&n&&(t.ynx(0),t.YNc(1,pt,2,0,"small",61),t.YNc(2,ut,2,0,"small",61),t.BQk()),2&n){t.oxw();const e=t.MAs(2);t.xp6(1),t.Q6J("ngIf",null==e.errors?null:e.errors.required),t.xp6(1),t.Q6J("ngIf",null==e.errors?null:e.errors.pattern)}}const B=function(n,r){return{border:n,"border-danger":r}};function _t(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",20)(1,"input",58,59),t.NdJ("ngModelChange",function(i){t.CHM(e);const c=t.oxw(2);return t.KtG(c.formData.Email=i)}),t.qZA(),t.TgZ(3,"label",60),t._uU(4,"Email"),t.qZA(),t.YNc(5,mt,3,2,"ng-container",2),t.qZA()}if(2&n){const e=t.MAs(2),o=t.oxw(2);t.xp6(1),t.Tol(t.WLB(5,B,e.touched&&e.invalid,e.touched&&e.invalid)),t.Q6J("ngModel",o.formData.Email)("disabled",!(o.roleService.users.View||o.roleService.profile.View)),t.xp6(4),t.Q6J("ngIf",e.touched)}}function gt(n,r){1&n&&(t.TgZ(0,"small",62),t._uU(1,"*Enter a valid email address"),t.qZA())}function ht(n,r){if(1&n&&(t.ynx(0),t.YNc(1,gt,2,0,"small",61),t.BQk()),2&n){t.oxw();const e=t.MAs(2);t.xp6(1),t.Q6J("ngIf",null==e.errors?null:e.errors.pattern)}}function ft(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",20)(1,"input",63,59),t.NdJ("ngModelChange",function(i){t.CHM(e);const c=t.oxw(2);return t.KtG(c.formData.Email=i)}),t.qZA(),t.TgZ(3,"label",60),t._uU(4,"Email"),t.qZA(),t.YNc(5,ht,2,1,"ng-container",2),t.qZA()}if(2&n){const e=t.MAs(2),o=t.oxw(2);t.xp6(1),t.Q6J("disabled",!(o.roleService.users.View||o.roleService.profile.View))("ngModel",o.formData.Email),t.xp6(4),t.Q6J("ngIf",e.touched)}}function Zt(n,r){1&n&&(t.TgZ(0,"i",64),t._uU(1," required."),t.qZA())}function bt(n,r){1&n&&(t.TgZ(0,"i",64),t._uU(1," These passwords don't match."),t.qZA())}function Tt(n,r){if(1&n&&(t.TgZ(0,"ul",65)(1,"li",66),t._uU(2),t.qZA()()),2&n){const e=r.$implicit;t.xp6(2),t.Oqu(e)}}function Ct(n,r){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA()()),2&n){const e=r.$implicit,o=r.index;t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Oqu(e.Key),t.xp6(2),t.Oqu(e.Value)}}function xt(n,r){if(1&n&&(t.TgZ(0,"ul",65)(1,"li",66),t._uU(2),t.qZA()()),2&n){const e=r.$implicit;t.xp6(2),t.Oqu(e)}}function vt(n,r){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA()()),2&n){const e=r.$implicit,o=r.index;t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Oqu(e.Key),t.xp6(2),t.Oqu(e.Value)}}const yt=function(n){return{"border-top-0":n}};function At(n,r){if(1&n&&(t.TgZ(0,"div",70)(1,"div",71),t._uU(2),t.qZA()()),2&n){const e=r.$implicit,o=r.index;t.xp6(1),t.Tol(t.VKq(3,yt,o/4>=1)),t.xp6(1),t.hij(" ",e.Model," ")}}function St(n,r){if(1&n&&(t.TgZ(0,"div",67)(1,"div",68),t._uU(2),t.qZA(),t.TgZ(3,"div",39)(4,"div",14),t.YNc(5,At,3,5,"div",69),t.qZA()()()),2&n){const e=r.$implicit;t.xp6(2),t.hij(" ",e.Name," "),t.xp6(3),t.Q6J("ngForOf",e.ListRole)}}function Mt(n,r){if(1&n&&(t.TgZ(0,"div",15)(1,"div",72),t._UZ(2,"input",73)(3,"label",74),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("value",e.formData.ClientSecret)}}function Dt(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",75),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.copyToClipboard())}),t._uU(1," Copy to Clipboard"),t.qZA()}if(2&n){const e=t.oxw(2);t.Q6J("matTooltip",e.tooltipText)("cdkCopyToClipboard",e.formData.ClientSecret)}}function wt(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"a",76),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.preview("Profile/GenerateClientSecret"))}),t._uU(1,"Generate"),t.qZA()}}const G=function(n){return{active:n}};function Ot(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,dt,2,1,"ng-container",2),t.qZA(),t.TgZ(3,"content")(4,"div",3)(5,"div")(6,"ul",4)(7,"li",5)(8,"a",6),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onSelectTab("GENERAL"))}),t._uU(9,"General"),t.qZA()(),t.TgZ(10,"li",5)(11,"a",7),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onSelectTab("SECURITY"))}),t._uU(12,"Security"),t.qZA()(),t.TgZ(13,"li",5)(14,"a",8),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onSelectTab("ROLES"))}),t._uU(15,"Roles"),t.qZA()(),t.TgZ(16,"li",5)(17,"a",9),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onSelectTab("API"))}),t._uU(18,"Developer API"),t.qZA()(),t.TgZ(19,"li",5)(20,"a",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onSelectTab("TOTP"))}),t._uU(21,"TOTP"),t.qZA()()(),t.TgZ(22,"div",11)(23,"div",12)(24,"div",13)(25,"div",14)(26,"div",15)(27,"div",16)(28,"div",17)(29,"h2"),t._uU(30,"General Credential"),t.qZA()(),t.TgZ(31,"div",18)(32,"form",null,19)(34,"div",20)(35,"input",21),t.NdJ("ngModelChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.formData.FirstName=i)}),t.qZA(),t.TgZ(36,"label",22),t._uU(37,"First Name"),t.qZA()(),t.TgZ(38,"div",20)(39,"input",23),t.NdJ("ngModelChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.formData.LastName=i)}),t.qZA(),t.TgZ(40,"label",24),t._uU(41,"Last Name"),t.qZA()(),t.TgZ(42,"div",20)(43,"input",25),t.NdJ("ngModelChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.formData.LoginID=i)}),t.qZA(),t.TgZ(44,"label",26),t._uU(45,"Username"),t.qZA()(),t.YNc(46,_t,6,8,"div",27),t.YNc(47,ft,6,3,"div",27),t.qZA()()()(),t.TgZ(48,"div",15)(49,"div",16)(50,"div",17)(51,"h2"),t._uU(52,"Change Password"),t.qZA(),t.TgZ(53,"small",28),t._uU(54,"Leave blank if you do not want to change"),t.qZA()(),t.TgZ(55,"div",18)(56,"div",20)(57,"input",29,30),t.NdJ("ngModelChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.formData.NewPassword=i)}),t.qZA(),t.TgZ(59,"label",31),t._uU(60,"Password"),t.qZA(),t.YNc(61,Zt,2,0,"i",32),t.qZA(),t.TgZ(62,"div",20)(63,"input",33),t.NdJ("ngModelChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.formData.RePassword=i)}),t.qZA(),t.TgZ(64,"label",34),t._uU(65,"Re-Password"),t.qZA(),t.YNc(66,bt,2,0,"i",32),t.qZA()()()()()()(),t.TgZ(67,"div",35)(68,"div",36)(69,"div",37)(70,"h5",38),t._uU(71,"Group"),t.qZA(),t.TgZ(72,"i"),t._uU(73,"Profile Groups"),t.qZA()(),t.TgZ(74,"div",39)(75,"div",14),t.YNc(76,Tt,3,1,"ul",40),t.qZA()()(),t.TgZ(77,"div",41)(78,"div",42)(79,"h5",38),t._uU(80,"Outlets"),t.qZA(),t.TgZ(81,"i"),t._uU(82,"Profile Outlets"),t.qZA()(),t.TgZ(83,"div",39)(84,"div",14)(85,"div")(86,"table",43)(87,"thead",44)(88,"tr")(89,"th"),t._uU(90,"No"),t.qZA(),t.TgZ(91,"th"),t._uU(92,"Outlet"),t.qZA(),t.TgZ(93,"th"),t._uU(94,"Access"),t.qZA()()(),t.TgZ(95,"tbody"),t.YNc(96,Ct,7,3,"tr",45),t.qZA()()()()()()(),t.TgZ(97,"div",46)(98,"div",36)(99,"div",37)(100,"h5",38),t._uU(101,"Group"),t.qZA(),t.TgZ(102,"i"),t._uU(103,"Profile Groups"),t.qZA()(),t.TgZ(104,"div",39)(105,"div",14),t.YNc(106,xt,3,1,"ul",40),t.qZA()()(),t.TgZ(107,"div",41)(108,"div",42)(109,"h5",38),t._uU(110,"Outlets"),t.qZA(),t.TgZ(111,"i"),t._uU(112,"Profile Outlets"),t.qZA()(),t.TgZ(113,"div",39)(114,"div",14)(115,"div")(116,"table",43)(117,"thead",44)(118,"tr")(119,"th"),t._uU(120,"No"),t.qZA(),t.TgZ(121,"th"),t._uU(122,"Outlet"),t.qZA(),t.TgZ(123,"th"),t._uU(124,"Access"),t.qZA()()(),t.TgZ(125,"tbody"),t.YNc(126,vt,7,3,"tr",45),t.qZA()()()()()()(),t.TgZ(127,"div",47),t.YNc(128,St,6,2,"div",48),t.qZA(),t.TgZ(129,"div",49)(130,"h3"),t._uU(131,"API Client Secret "),t.TgZ(132,"small",28),t._uU(133,"(developer.dealpos.com)"),t.qZA()(),t.TgZ(134,"div",50),t.YNc(135,Mt,4,1,"div",51),t.TgZ(136,"div",15)(137,"div",20),t.YNc(138,Dt,2,2,"button",52),t.YNc(139,wt,2,0,"a",53),t.qZA()()()(),t.TgZ(140,"div",54),t._UZ(141,"POS-setup-2FA",55),t.qZA()()()()()()}if(2&n){const e=t.MAs(58),o=t.oxw();t.Q6J("pageData",o.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf","GENERAL"==o.activeTab),t.xp6(6),t.Q6J("ngClass",t.VKq(34,G,"GENERAL"==o.activeTab)),t.xp6(3),t.Q6J("ngClass",t.VKq(36,G,"SECURITY"==o.activeTab)),t.xp6(12),t.Q6J("ngClass",t.VKq(38,G,"GENERAL"==o.activeTab)),t.xp6(12),t.Q6J("ngModel",o.formData.FirstName)("disabled",!(o.roleService.users.View||o.roleService.profile.View)),t.xp6(4),t.Q6J("ngModel",o.formData.LastName)("disabled",!(o.roleService.users.View||o.roleService.profile.View)),t.xp6(4),t.Q6J("ngModel",o.formData.LoginID)("disabled",!(o.roleService.users.View||o.roleService.profile.View)),t.xp6(3),t.Q6J("ngIf",o.data.EmailRequired),t.xp6(1),t.Q6J("ngIf",!o.data.EmailRequired),t.xp6(9),t.Tol(t.WLB(40,B,e.touched&&e.invalid,e.touched&&e.invalid)),t.xp6(1),t.Q6J("ngModel",o.formData.NewPassword)("disabled",!(o.roleService.users.View||o.roleService.profile.View)),t.xp6(4),t.Q6J("ngIf",e.touched&&e.invalid),t.xp6(1),t.Tol(t.WLB(43,B,o.formData.NewPassword!=o.formData.RePassword,o.formData.NewPassword!=o.formData.RePassword)),t.xp6(1),t.Q6J("ngModel",o.formData.RePassword)("disabled",!(o.roleService.users.View||o.roleService.profile.View)),t.xp6(3),t.Q6J("ngIf",o.formData.NewPassword!=o.formData.RePassword),t.xp6(10),t.Q6J("ngForOf",o.data.Security.Groups),t.xp6(20),t.Q6J("ngForOf",o.data.Security.Outlets),t.xp6(10),t.Q6J("ngForOf",o.data.Security.Groups),t.xp6(20),t.Q6J("ngForOf",o.data.Security.Outlets),t.xp6(2),t.Q6J("ngForOf",o.data.Role),t.xp6(7),t.Q6J("ngIf",o.formData.ClientSecret),t.xp6(3),t.Q6J("ngIf",o.formData.ClientSecret),t.xp6(1),t.Q6J("ngIf",o.roleService.users.View||o.roleService.profile.View),t.xp6(2),t.Q6J("totpEnabled",o.totpEnabled)}}let qt=(()=>{class n extends P.U{constructor(e,o,i,c,y,D){super(e,"Profile/MyProfileFormInitial",o),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"dialog",void 0),(0,a.Z)(this,"authenticatorService",void 0),(0,a.Z)(this,"roleService",void 0),(0,a.Z)(this,"tooltipText","Copy to Clipboard"),(0,a.Z)(this,"totpEnabled",void 0),(0,a.Z)(this,"activeTab","GENERAL"),this.toastr=i,this.dialog=c,this.authenticatorService=y,this.roleService=D}postBindForm(e){this.totpEnabled=e?.Form?.TOTPEnabled}validate(){this.formData.NewPassword==this.formData.RePassword?this.onSubmit("Profile/SubmitProfile"):this.toastr.error("Password and re-enter password must be equal.",v.n.Error)}onSubmitSuccess(){this.toastr.success("Your profile is successfuly updated",v.n.Success)}preview(e){this.httpService.post(`/API/${e}`).subscribe({next:o=>{this.data.Form=o},error:o=>{this.toastr.error(o,v.n.Error)}})}copyToClipboard(){this.tooltipText="Token has been copied to clipboard",setTimeout(()=>{this.tooltipText="Copy to Clipboard"},2e3)}onSelectTab(e){this.activeTab=e}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(A.gz),t.Y36(x._W),t.Y36(f.uw),t.Y36(b.g),t.Y36(T.N))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-my-profile"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-5"],["id","myTab","role","tablist",1,"nav","nav-tabs"],[1,"nav-item","cursor"],["id","general-tab","data-bs-toggle","tab","href","#general","role","tab","aria-controls","general","aria-selected","false",1,"nav-link","active",3,"ngClass","click"],["id","security-tab","data-bs-toggle","tab","href","#security","role","tab","aria-controls","profile","aria-selected","false",1,"nav-link",3,"ngClass","click"],["id","roles-tab","data-bs-toggle","tab","href","#roles","role","tab","aria-controls","contact","aria-selected","false",1,"nav-link",3,"click"],["id","developerApi-tab","data-bs-toggle","tab","href","#developerApi","role","tab","aria-controls","developerApi","aria-selected","false",1,"nav-link",3,"click"],["id","setupAuth-tab","data-bs-toggle","tab","href","#setupAuth","role","tab","aria-controls","setupAuth","aria-selected","false",1,"nav-link",3,"click"],["id","myTabContent",1,"tab-content"],["id","general","role","tab",1,"tab-pane","fade","show","active","mt-0","pt-8","border","border-top-0",3,"ngClass"],[1,"container"],[1,"row"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],["validation","ngForm"],[1,"form-floating-outline"],["type","text","id","inputFirstName","name","firstName","placeholder","First Name",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","inputFirstName"],["type","text","id","inputLastName","name","lastName","placeholder","Last Name",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","inputLastName"],["type","text","id","inputName","name","userName","placeholder","Username",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","inputName"],["class","form-floating-outline",4,"ngIf"],[1,"text-muted","h6"],["type","password","id","inputPassword","name","password","placeholder","Password","required","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["password","ngModel"],["for","inputPassword"],["class","control-label text-danger",4,"ngIf"],["type","password","id","inputrepassword","placeholder","Re-Password","required","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","inputRepassword"],["id","security","role","tab",1,"tab-pane","fade","show","border","border-top-0","mt-0"],[1,"border-bottom","row","pt-8","ms-3","me-3"],[1,"col-sm-2","mt-3"],[1,"fw-bold"],[1,"col-sm-10"],["class","mb-4",4,"ngFor","ngForOf"],[1,"row","border-bottom","mt-10","ms-3"],[1,"col-sm-2"],[1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngFor","ngForOf"],["id","security","role","tabpanel",1,"tab-pane","panel","fade","border","border-top-0","mt-0"],["id","roles","role","tabpanel",1,"tab-pane","panel","fade","border","border-top-0","mt-0"],["class","row pt-8 ms-3 me-3",4,"ngFor","ngForOf"],["id","developerApi","role","tab",1,"tab-pane","fade","show","border","border-top-0","p-5","mt-0"],[1,"row","mt-5","d-flex","align-items-center"],["class","col-sm-6",4,"ngIf"],["mat-raised-button","","matTooltipPosition","above","id","btnCopyToken","class","btn btn-secondary btn-sm me-5",3,"matTooltip","cdkCopyToClipboard","click",4,"ngIf"],["class","btn btn-success btn-sm","role","button",3,"click",4,"ngIf"],["id","setupAuth","role","tab",1,"tab-pane","fade","show","p-5","mt-0","border","border-top-0"],[3,"totpEnabled"],["matTooltipPosition","above","matTooltip","Save","class","btn btn-success","role","button",3,"disabled","click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Save","role","button",1,"btn","btn-success",3,"disabled","click"],["type","text","id","email","name","email","placeholder","Email","pattern","[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$","required","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["email","ngModel"],["for","email"],["class","text-danger",4,"ngIf"],[1,"text-danger"],["id","email","type","Email","name","email","placeholder","Email","pattern","[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$",1,"form-control",3,"disabled","ngModel","ngModelChange"],[1,"control-label","text-danger"],[1,"mb-4"],[2,"list-style","circle"],[1,"row","pt-8","ms-3","me-3"],[1,"col-sm-2","border","fw-bold","p-3","text-center",2,"background-color","#f6f6f6"],["class","col-md-3 px-0",4,"ngFor","ngForOf"],[1,"col-md-3","px-0"],[1,"p-3","border"],[1,"form-floating-outline","bg-light-gray"],["type","text","name","api-client","readonly","",1,"form-control",3,"value"],["for","api-client"],["mat-raised-button","","matTooltipPosition","above","id","btnCopyToken",1,"btn","btn-secondary","btn-sm","me-5",3,"matTooltip","cdkCopyToClipboard","click"],["role","button",1,"btn","btn-success","btn-sm",3,"click"]],template:function(e,o){1&e&&t.YNc(0,Ot,142,46,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.formData)},dependencies:[g.mk,g.sg,g.O5,l._Y,l.Fj,l.JJ,l.JL,l.Q7,l.c5,l.On,l.F,d.p,s.gM,u.i3,lt]})),n})();var W=_(4077),K=_(98085),Y=_(88796),$=_(3077),z=_(58393),E=_(93669);function Ut(n,r){1&n&&(t.TgZ(0,"th",22),t._uU(1," @@ Cost "),t.qZA())}function Pt(n,r){if(1&n&&(t.TgZ(0,"span",39),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(" - Profit: "+t.lcZ(2,1,e.Profit))}}function Nt(n,r){if(1&n&&(t.TgZ(0,"small"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.hij("( ",e.Commissions[0].Quantity," unit )")}}function It(n,r){if(1&n&&(t.TgZ(0,"i",52),t._uU(1),t.YNc(2,Nt,2,1,"small",53),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("sold by ",e.Commissions[0].SalesName," "),t.xp6(1),t.Q6J("ngIf",e.Commissions[0].Quantity<e.Quantity)}}function Jt(n,r){if(1&n&&(t.TgZ(0,"li")(1,"i"),t._uU(2),t.qZA()()),2&n){const e=r.$implicit;t.xp6(2),t.hij("( ",e.Quantity+" unit by "+e.SalesName," )")}}function Ft(n,r){if(1&n&&(t.TgZ(0,"ul",54)(1,"li")(2,"i"),t._uU(3,"sold by"),t.qZA()(),t.YNc(4,Jt,3,1,"li",19),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(4),t.Q6J("ngForOf",e.Commissions)}}function Et(n,r){if(1&n&&(t.TgZ(0,"th",55),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitCost))}}function Lt(n,r){if(1&n&&(t.TgZ(0,"tr")(1,"th",40)(2,"div")(3,"span",41),t._uU(4),t.qZA(),t.YNc(5,It,3,2,"i",42),t.YNc(6,Ft,5,1,"ul",43),t._UZ(7,"span",44),t.ALo(8,"newlines"),t.qZA()(),t.TgZ(9,"th",45),t._uU(10),t.qZA(),t.TgZ(11,"th",46),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"th",47),t._uU(15),t.qZA(),t.YNc(16,Et,3,3,"th",48),t.TgZ(17,"th",49),t._uU(18),t.ALo(19,"number"),t.qZA(),t.TgZ(20,"th",50),t._uU(21),t.qZA(),t.TgZ(22,"th",51),t._uU(23),t.ALo(24,"number"),t.qZA()()),2&n){const e=r.$implicit,o=t.oxw(3);t.xp6(4),t.Oqu(e.Name),t.xp6(1),t.Q6J("ngIf",1==e.Commissions.length),t.xp6(1),t.Q6J("ngIf",e.Commissions.length>1),t.xp6(1),t.Q6J("innerHTML",t.lcZ(8,11,e.Note),t.oJD),t.xp6(3),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(13,13,e.Quantity)),t.xp6(3),t.Oqu(e.UOMName),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(2),t.Oqu(t.lcZ(19,15,e.UnitPrice)),t.xp6(3),t.Oqu(0==e.Discount?"":e.Discount+"%"),t.xp6(2),t.Oqu(t.lcZ(24,17,e.Total))}}function Qt(n,r){if(1&n&&(t.TgZ(0,"tr")(1,"th",56),t._uU(2,"\xa0"),t.qZA(),t._UZ(3,"th",57)(4,"th",58)(5,"th",59)(6,"th",16),t.TgZ(7,"th",60),t._uU(8),t.qZA(),t.TgZ(9,"th",61),t._uU(10),t.qZA(),t.TgZ(11,"th",62),t._uU(12),t.ALo(13,"number"),t.qZA()()),2&n){const e=r.$implicit;t.xp6(8),t.hij("",e.Label," :"),t.xp6(2),t.Oqu(e.CurrencySymbol),t.xp6(2),t.Oqu(t.lcZ(13,3,e.Amount))}}const kt=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},Rt=function(n){return{ID:n}};function Yt(n,r){if(1&n&&(t.TgZ(0,"div")(1,"div",23)(2,"div",24)(3,"a",25),t._UZ(4,"span",26),t.ALo(5,"date"),t._UZ(6,"small",27),t.ALo(7,"date"),t.qZA(),t.TgZ(8,"span"),t._uU(9),t.ALo(10,"showIfNotNullOrEmptyString"),t.qZA(),t._UZ(11,"span",28),t.TgZ(12,"strong",29),t._uU(13),t.ALo(14,"sum"),t.ALo(15,"number"),t.TgZ(16,"span"),t._uU(17),t.ALo(18,"showIfNotNullOrEmptyString"),t.qZA()(),t.YNc(19,Pt,3,3,"span",30),t.TgZ(20,"i",31),t._uU(21),t.qZA(),t.TgZ(22,"span",32),t._uU(23),t.qZA(),t.TgZ(24,"span",33),t._uU(25),t.qZA()(),t.TgZ(26,"div",34),t._UZ(27,"label",35),t.qZA()(),t.TgZ(28,"table",36),t._UZ(29,"thead"),t.TgZ(30,"tbody",37),t.YNc(31,Lt,25,19,"tr",19),t.qZA()(),t.TgZ(32,"table",38),t.YNc(33,Qt,14,5,"tr",19),t.qZA()()),2&n){const e=r.$implicit,o=t.oxw(2);t.xp6(3),t.Q6J("routerLink",t.DdM(31,kt))("queryParams",t.VKq(32,Rt,e.ID)),t.xp6(1),t.Q6J("innerHTML",e.EntityName+" #"+e.Number+" - "+t.xi3(5,14,e.Date,"dd MMM yyyy"),t.oJD),t.xp6(2),t.Q6J("innerHTML","("+t.xi3(7,17,e.Created,"HH:mm")+")",t.oJD),t.xp6(3),t.Oqu(t.xi3(10,20,e.CustomerNameDisplay," - {0}")),t.xp6(4),t.hij(" ","[Q: "+t.xi3(14,23,e.Items,"Quantity")+", T: "+t.lcZ(15,26,e.Final)+"]"," "),t.xp6(4),t.Oqu(t.xi3(18,28,e.SalesName," - Sales: {0}")),t.xp6(2),t.Q6J("ngIf",o.roleService.report.Profit),t.xp6(2),t.Oqu(null==e.DeliveryOutlet?"":": Delivered from "+e.DeliveryOutlet),t.xp6(2),t.Oqu(null==e.AuthorizationKey?"":": "+e.AuthorizationKey),t.xp6(2),t.Oqu(null==e.SONote?"":": "+e.SONote),t.xp6(2),t.Q6J("innerHTML",e.PaymentStateLabel,t.oJD),t.xp6(4),t.Q6J("ngForOf",e.Items),t.xp6(2),t.Q6J("ngForOf",e.Aggregate)}}function Ht(n,r){if(1&n&&(t.TgZ(0,"div")(1,"strong"),t._uU(2,"Cost ("),t._UZ(3,"span",67),t.ALo(4,"number"),t._uU(5,"%)"),t.qZA(),t._UZ(6,"span",65),t.ALo(7,"number"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(3),t.Q6J("innerHTML",t.lcZ(4,2,e.data.Aggregate.CostRatio),t.oJD),t.xp6(3),t.Q6J("innerHTML",t.lcZ(7,4,e.data.Aggregate.Cost),t.oJD)}}function Vt(n,r){if(1&n&&(t.TgZ(0,"div")(1,"strong")(2,"span"),t._uU(3,"Profit"),t.qZA(),t._uU(4," ("),t._UZ(5,"span",67),t.ALo(6,"number"),t._uU(7,"%)"),t.qZA(),t._UZ(8,"span",65),t.ALo(9,"number"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(5),t.Q6J("innerHTML",t.lcZ(6,2,e.data.Aggregate.ProfitRatio),t.oJD),t.xp6(3),t.Q6J("innerHTML",t.lcZ(9,4,e.data.Aggregate.Profit),t.oJD)}}function Bt(n,r){if(1&n&&(t.TgZ(0,"div",63)(1,"div",64)(2,"div")(3,"strong"),t._uU(4,"Tax Added"),t.qZA(),t._UZ(5,"span",65),t.ALo(6,"number"),t.qZA(),t.TgZ(7,"div")(8,"strong"),t._uU(9,"Sales with Tax"),t.qZA(),t._UZ(10,"span",65),t.ALo(11,"number"),t.qZA()(),t.TgZ(12,"div",66)(13,"div")(14,"strong"),t._uU(15,"Orders"),t.qZA(),t._UZ(16,"span",65),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"div")(19,"strong"),t._uU(20,"Qty"),t.qZA(),t._UZ(21,"span",65),t.ALo(22,"number"),t.qZA()(),t.TgZ(23,"div",66)(24,"div")(25,"strong"),t._uU(26,"Gross Sales"),t.qZA(),t._UZ(27,"span",65),t.ALo(28,"number"),t.qZA(),t.TgZ(29,"div")(30,"strong"),t._uU(31,"Discount"),t.qZA(),t._UZ(32,"span",65),t.ALo(33,"number"),t.qZA(),t.TgZ(34,"div")(35,"strong"),t._uU(36,"Tax Incl."),t.qZA(),t._UZ(37,"span",65),t.ALo(38,"number"),t.qZA(),t.TgZ(39,"div")(40,"strong"),t._uU(41,"Net Sales"),t.qZA(),t._UZ(42,"span",65),t.ALo(43,"number"),t.qZA(),t.YNc(44,Ht,8,6,"div",53),t.YNc(45,Vt,10,6,"div",53),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("innerHTML",t.lcZ(6,10,e.data.Aggregate.TaxAdd),t.oJD),t.xp6(5),t.Q6J("innerHTML",t.lcZ(11,12,e.data.Aggregate.SalesWithTax),t.oJD),t.xp6(6),t.Q6J("innerHTML",t.lcZ(17,14,e.data.Aggregate.Orders),t.oJD),t.xp6(5),t.Q6J("innerHTML",t.lcZ(22,16,e.data.Aggregate.ItemsQuantity),t.oJD),t.xp6(6),t.Q6J("innerHTML",t.lcZ(28,18,e.data.Aggregate.GrossItems),t.oJD),t.xp6(5),t.Q6J("innerHTML",t.lcZ(33,20,e.data.Aggregate.Discount),t.oJD),t.xp6(5),t.Q6J("innerHTML",t.lcZ(38,22,e.data.Aggregate.TaxInclude),t.oJD),t.xp6(5),t.Q6J("innerHTML",t.lcZ(43,24,e.data.Aggregate.SalesWithoutTax),t.oJD),t.xp6(2),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",e.roleService.report.Profit)}}function Gt(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.searchFromPageOne())}),t.TgZ(1,"filters")(2,"div",2)(3,"div",3)(4,"div")(5,"h6"),t._uU(6,"Type"),t.qZA(),t.TgZ(7,"ng-select",4),t.NdJ("ngModelChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.pageData.Filter.TypeID=i)}),t.qZA()(),t.TgZ(8,"div")(9,"h6"),t._uU(10,"Customer"),t.qZA(),t.TgZ(11,"autocompleteV2",5),t.NdJ("onInputChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.resetCustomer(i))})("onSelect",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.onSelectCustomer(i))}),t.qZA()(),t.TgZ(12,"div")(13,"h6"),t._uU(14,"From"),t.qZA(),t.TgZ(15,"datepicker",6),t.NdJ("dateChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.pageData.Filter.From=i)}),t.qZA()(),t.TgZ(16,"div")(17,"h6"),t._uU(18,"To"),t.qZA(),t.TgZ(19,"datepicker",7),t.NdJ("dateChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.pageData.Filter.To=i)}),t.qZA()()()()(),t.TgZ(20,"content")(21,"div",8)(22,"table",9)(23,"thead",10)(24,"tr")(25,"th",11),t._uU(26," Name "),t.qZA(),t.TgZ(27,"th",12),t._uU(28," Code "),t.qZA(),t.TgZ(29,"th",13),t._uU(30," Qty "),t.qZA(),t.TgZ(31,"th",14),t._uU(32," UOM "),t.qZA(),t.YNc(33,Ut,2,0,"th",15),t.TgZ(34,"th",16),t._uU(35," @@ Price "),t.qZA(),t.TgZ(36,"th",17),t._uU(37," % "),t.qZA(),t.TgZ(38,"th",18),t._uU(39," Total "),t.qZA()()()(),t.YNc(40,Yt,34,34,"div",19),t.YNc(41,Bt,46,26,"div",20),t.TgZ(42,"POS-complex-pagination",21),t.NdJ("jumpToPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getListData())})("previousPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getListData())})("nextPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getListData())}),t.qZA()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("items",e.pageData.Options.Types)("ngModel",e.pageData.Filter.TypeID),t.xp6(8),t.Q6J("date",e.pageData.Filter.From),t.xp6(4),t.Q6J("date",e.pageData.Filter.To),t.xp6(14),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(7),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data&&e.data.Data.length>0),t.xp6(1),t.Q6J("total",e.data.Data?e.data.Data.length:0)("pageData",e.pageData)}}let Kt=(()=>{class n extends W.n{constructor(e,o){super(e,"Report/MySales","ReportLoader/MyActivity"),(0,a.Z)(this,"roleService",void 0),this.roleService=o}onSelectCustomer(e){this.pageData.Filter.CustomerID=e}resetCustomer(e){""==e&&(this.pageData.Filter.CustomerID=null)}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(T.N))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-my-sales"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID",3,"items","ngModel","ngModelChange"],["requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"onInputChange","onSelect"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","660px"],[2,"width","68px"],[1,"text-end",2,"width","30px"],[2,"width","50px"],["id","thCost","class","text-end","style","width: 80px",4,"ngIf"],[1,"text-end",2,"width","80px"],[1,"red",2,"width","30px"],[1,"text-end",2,"width","90px"],[4,"ngFor","ngForOf"],["class","clearfix mb-5 mt-5",4,"ngIf"],["api","Report/ReportDetailCount",3,"total","pageData","jumpToPage","previousPage","nextPage"],["id","thCost",1,"text-end",2,"width","80px"],[1,"d-lg-flex","mt-sm-0"],[1,"me-auto","d-sm-block","mt-8","mb-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-4",3,"innerHTML"],[1,"fst-italic","fw-bold",3,"innerHTML"],[1,"d-block"],[1,"text-danger","ms-3"],["class","fw-bold",4,"ngIf"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block"],[1,"d-lg-block","mt-8","me-2","fw-bold","fst-italic"],[1,"status",3,"innerHTML"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"table","table-sm","table-borderless","d-flex","justify-content-end","mt-3"],[1,"fw-bold"],[2,"width","726px"],[1,"fw-normal"],["class","text-warning inlineMarginLeft",4,"ngIf"],["class","list-inline text-warning inlineMarginLeft",4,"ngIf"],[1,"d-block","fw-normal","fst-italic",3,"innerHTML"],[1,"fw-normal",2,"width","75px"],[1,"fw-normal","text-end",2,"width","42px"],[1,"fst-italic","small",2,"width","52px"],["class","fw-normal text-end","style","width: 80px",4,"ngIf"],[1,"fw-normal","text-end",2,"width","92px"],[1,"fw-normal","text-end","text-danger",2,"width","30px"],[1,"fw-normal","text-end",2,"width","102px"],[1,"text-warning","inlineMarginLeft"],[4,"ngIf"],[1,"list-inline","text-warning","inlineMarginLeft"],[1,"fw-normal","text-end",2,"width","80px"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[2,"width","40px"],[1,"text-end",2,"width","130px"],[1,"fw-normal","text-end",2,"width","20px"],[1,"fw-normal","text-end","pe3",2,"width","60px"],[1,"clearfix","mb-5","mt-5"],[1,"zebra",2,"float","right"],[1,"text-end",3,"innerHTML"],[1,"zebra",2,"float","right","margin-right","20px"],[1,"Percentage",3,"innerHTML"]],template:function(e,o){1&e&&t.YNc(0,Gt,43,11,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[g.sg,g.O5,l.JJ,l.On,A.rH,d.p,K.QB,Y.w9,$.v,z.J,g.JJ,g.uU,E.qU,E.sH,E.WV]})),n})();function jt(n,r){1&n&&(t.TgZ(0,"small",17),t._uU(1,"*Enter a valid phone number"),t.qZA())}function Wt(n,r){if(1&n&&(t.ynx(0),t.YNc(1,jt,2,0,"small",16),t.BQk()),2&n){t.oxw();const e=t.MAs(9);t.xp6(1),t.Q6J("ngIf",null==e.errors?null:e.errors.pattern)}}function $t(n,r){1&n&&(t.TgZ(0,"small",17),t._uU(1,"*Enter a valid email address"),t.qZA())}function zt(n,r){if(1&n&&(t.ynx(0),t.YNc(1,$t,2,0,"small",16),t.BQk()),2&n){t.oxw();const e=t.MAs(16);t.xp6(1),t.Q6J("ngIf",null==e.errors?null:e.errors.pattern)}}let Xt=(()=>{class n{constructor(e,o,i,c,y){(0,a.Z)(this,"httpService",void 0),(0,a.Z)(this,"dialogRef",void 0),(0,a.Z)(this,"data",void 0),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"router",void 0),(0,a.Z)(this,"config",new k.O),this.httpService=e,this.dialogRef=o,this.data=i,this.toastr=c,this.router=y,this.config.title="Subscribe",this.config.okText="I want to subscribe",this.config.cancelText="Cancel",this.config.customWidth="35vw"}onOk(e){if("Enter"!==e){if(0==this.data.form.Qty)return this.toastr.error("The number of outlets can't be empty",v.n.Error),void this.dialogRef.close();this.httpService.post("/API/Subscription/SendSubscription",JSON.stringify(this.data.form)).subscribe(o=>{this.toastr.success(o,v.n.Success),this.router.navigate(["/menu/Profile/Main/My_Subscription"]),this.dialogRef.close()})}}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(f.so),t.Y36(f.WI),t.Y36(x._W),t.Y36(A.F0))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-modal-subscribe"]],decls:26,vars:7,consts:[[3,"dynamicValidated","config","onOk","onCancel","onClose"],[1,"container"],["validation","ngForm"],[1,"row"],[1,"col-6"],[1,"form-floating-outline"],["type","text","id","inputPhone","placeholder","Phone","name","phone","pattern","[0-9]{0,15}","required","","matTooltipPosition","above","matTooltip","Your number will be saved to help our customer service quickly identify you in the future",1,"form-control",3,"ngModel","ngModelChange"],["phoneCtrl","ngModel"],["for","inputPhone"],[4,"ngIf"],["type","text","id","inputEmail","placeholder","Email","name","email","pattern","[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$","required","","matTooltipPosition","above","matTooltip","Your monthly recurring invoice will be sent to the email you specified above",1,"form-control",3,"ngModel","ngModelChange"],["emailCtrl","ngModel"],["for","inputEmail"],[1,"col-12"],["name","note","id","inputNote","placeholder","Note","rows","6",1,"form-control",3,"ngModel","ngModelChange"],["for","inputNote"],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(e,o){if(1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(c){return o.onOk(c)})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"form",null,2)(5,"div",3)(6,"div",4)(7,"div",5)(8,"input",6,7),t.NdJ("ngModelChange",function(c){return o.data.form.Phone=c}),t.qZA(),t.TgZ(10,"label",8),t._uU(11,"Phone*"),t.qZA(),t.YNc(12,Wt,2,1,"ng-container",9),t.qZA()(),t.TgZ(13,"div",4)(14,"div",5)(15,"input",10,11),t.NdJ("ngModelChange",function(c){return o.data.form.Email=c}),t.qZA(),t.TgZ(17,"label",12),t._uU(18,"Email*"),t.qZA(),t.YNc(19,zt,2,1,"ng-container",9),t.qZA()()(),t.TgZ(20,"div",3)(21,"div",13)(22,"div",5)(23,"textarea",14),t.NdJ("ngModelChange",function(c){return o.data.form.Note=c}),t.qZA(),t.TgZ(24,"label",15),t._uU(25,"Note"),t.qZA()()()()()()()()),2&e){const i=t.MAs(9),c=t.MAs(16);t.Q6J("dynamicValidated",(null==i?null:i.valid)||(null==c?null:c.valid))("config",o.config),t.xp6(8),t.Q6J("ngModel",o.data.form.Phone),t.xp6(4),t.Q6J("ngIf",i.touched&&i.dirty),t.xp6(3),t.Q6J("ngModel",o.data.form.Email),t.xp6(4),t.Q6J("ngIf",c.touched&&c.dirty),t.xp6(4),t.Q6J("ngModel",o.data.form.Note)}},dependencies:[g.O5,l._Y,l.Fj,l.JJ,l.JL,l.Q7,l.c5,l.On,l.F,F.M,s.gM]})),n})();var te=_(83902),X=_(11594);function ee(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",24),t.NdJ("click",function(){const c=t.CHM(e).$implicit,y=t.oxw(2);return t.KtG(y.onCycleChange(c.key))}),t.TgZ(1,"div",25)(2,"span",26),t._uU(3),t.qZA(),t._UZ(4,"div",27),t.qZA()()}if(2&n){const e=r.$implicit,o=t.oxw(2);t.Tol(e.key==o.formData.Cycle?"active":""),t.xp6(3),t.Oqu(e.dicount),t.xp6(1),t.Q6J("innerHTML",e.desc,t.oJD)}}function ne(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"th",28),t._uU(2,"Register"),t.qZA(),t.TgZ(3,"td"),t._uU(4,":"),t.qZA(),t.TgZ(5,"td")(6,"input",29),t.NdJ("ngModelChange",function(i){t.CHM(e);const c=t.oxw(2);return t.KtG(c.formData.Register=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onQtyRegisterChange())}),t.qZA(),t.TgZ(7,"span"),t._uU(8),t.ALo(9,"number"),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(6),t.Q6J("preventNegative",!0)("ngModel",e.formData.Register),t.xp6(2),t.hij("/ ",t.lcZ(9,3,e.data.Options.Register),"")}}function oe(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",7)(1,"div",30)(2,"div",9)(3,"h2",10),t._uU(4,"Setup Fee "),t.qZA(),t.TgZ(5,"small",11),t._uU(6,"(One-time payment)"),t.qZA()()(),t.TgZ(7,"div",31)(8,"table",32)(9,"tr")(10,"th"),t._uU(11,"POS"),t.qZA(),t.TgZ(12,"td"),t._uU(13,"\xa0:"),t.qZA(),t.TgZ(14,"td")(15,"label",33)(16,"radio-options",34),t.NdJ("modelChange",function(i){t.CHM(e);const c=t.oxw(2);return t.KtG(c.data.Options.SetupFee=i)})("modelChange",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.calculateSetupFee())}),t.qZA()()()()()()()}if(2&n){const e=t.oxw(2);t.xp6(16),t.Q6J("model",e.data.Options.SetupFee)}}function ie(n,r){1&n&&(t.ynx(0),t._uU(1,"s "),t.BQk())}function ae(n,r){1&n&&(t.ynx(0),t._uU(1,"s"),t.BQk())}function re(n,r){if(1&n&&(t.TgZ(0,"tr")(1,"td")(2,"strong"),t._uU(3,"Additional Register"),t.qZA(),t.TgZ(4,"p")(5,"small",41),t._uU(6),t.YNc(7,ae,2,0,"ng-container",18),t.qZA()()(),t.TgZ(8,"td",37),t._uU(9),t.qZA(),t.TgZ(10,"td",38),t._UZ(11,"span",40),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",39),t._uU(15),t.qZA(),t.TgZ(16,"td",38),t._UZ(17,"span",40),t._uU(18),t.ALo(19,"number"),t.qZA()()),2&n){const e=t.oxw(4);t.xp6(6),t.hij("",e.formData.Register," Register "),t.xp6(1),t.Q6J("ngIf",e.formData.Register>1),t.xp6(2),t.Oqu(e.formData.Cycle),t.xp6(2),t.Q6J("innerHTML",e.data.Options.Setup?"IDR ":"$ ",t.oJD),t.xp6(1),t.Oqu(t.lcZ(13,8,e.data.Options.Register)),t.xp6(3),t.hij(" ",e.formData.Discount>0?e.formData.Discount+"%":"-"," "),t.xp6(2),t.Q6J("innerHTML",e.data.Options.Setup?"IDR ":"$ ",t.oJD),t.xp6(1),t.Oqu(t.lcZ(19,10,e.registerFee))}}function se(n,r){if(1&n&&(t.TgZ(0,"tr")(1,"td")(2,"strong")(3,"span"),t._uU(4,"POS"),t.qZA()(),t.TgZ(5,"p")(6,"small",41),t._uU(7," - Consultation "),t._UZ(8,"br"),t._uU(9," - Training 2x "),t._UZ(10,"br"),t._uU(11," - 1 Month Support Group"),t.qZA()()(),t._UZ(12,"td",37),t.TgZ(13,"td",38)(14,"span"),t._uU(15,"IDR "),t.qZA(),t._uU(16),t.ALo(17,"number"),t.qZA(),t._UZ(18,"td",39),t.TgZ(19,"td",38)(20,"span"),t._uU(21,"IDR "),t.qZA(),t._uU(22),t.ALo(23,"number"),t.qZA()()),2&n){const e=t.oxw(4);t.xp6(16),t.Oqu(t.lcZ(17,2,e.formData.Setup)),t.xp6(6),t.Oqu(t.lcZ(23,4,e.formData.Setup))}}function le(n,r){if(1&n&&(t.ynx(0),t.TgZ(1,"tr")(2,"td")(3,"strong"),t._UZ(4,"span",40),t.qZA(),t.TgZ(5,"p")(6,"small",41),t._uU(7),t.YNc(8,ie,2,0,"ng-container",18),t.qZA()()(),t.TgZ(9,"td",37),t._uU(10),t.qZA(),t.TgZ(11,"td",38),t._UZ(12,"span",40),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",39),t._uU(16),t.qZA(),t.TgZ(17,"td",38),t._UZ(18,"span",40),t._uU(19),t.ALo(20,"number"),t.qZA()(),t.YNc(21,re,20,12,"tr",18),t.YNc(22,se,24,6,"tr",18),t.BQk()),2&n){const e=t.oxw(3);t.xp6(4),t.Q6J("innerHTML",1==e.formData.Type?"Starter Subscription":"Standard Subscription",t.oJD),t.xp6(3),t.hij(" ",e.formData.Qty," Outlet"),t.xp6(1),t.Q6J("ngIf",e.formData.Qty>1),t.xp6(2),t.Oqu(e.formData.Cycle),t.xp6(2),t.Q6J("innerHTML",e.data.Options.Setup?"IDR ":"$ ",t.oJD),t.xp6(1),t.Oqu(t.lcZ(14,11,e.data.Options.Type)),t.xp6(3),t.hij(" ",e.formData.Discount>0?e.formData.Discount+"%":"-"," "),t.xp6(2),t.Q6J("innerHTML",e.data.Options.Setup?"IDR ":"$ ",t.oJD),t.xp6(1),t.Oqu(t.lcZ(20,13,e.outletFee)),t.xp6(2),t.Q6J("ngIf",e.formData.Register>0),t.xp6(1),t.Q6J("ngIf",e.data.Options.SetupFee)}}function ce(n,r){if(1&n&&(t.ynx(0),t.TgZ(1,"div",42)(2,"table",43)(3,"tr")(4,"th"),t._uU(5,"Sub Total"),t.qZA(),t.TgZ(6,"td",44),t._uU(7,":"),t.qZA(),t.TgZ(8,"td",38)(9,"strong"),t._UZ(10,"span",40),t._uU(11),t.ALo(12,"number"),t.qZA()()()()(),t.BQk()),2&n){const e=t.oxw(3);t.xp6(10),t.Q6J("innerHTML",e.data.Options.Setup?"IDR ":"$ ",t.oJD),t.xp6(1),t.Oqu(t.lcZ(12,2,e.subTotal))}}function de(n,r){if(1&n&&(t.TgZ(0,"div",31)(1,"table",35)(2,"thead",36)(3,"tr")(4,"th"),t._uU(5,"Product"),t.qZA(),t.TgZ(6,"th",37),t._uU(7,"Month"),t.qZA(),t.TgZ(8,"th",38),t._uU(9,"Price"),t.qZA(),t.TgZ(10,"th",39),t._uU(11,"Disc"),t.qZA(),t.TgZ(12,"th",38),t._uU(13,"Total"),t.qZA()()(),t.TgZ(14,"tbody"),t.YNc(15,le,23,15,"ng-container",18),t.qZA()(),t.YNc(16,ce,13,4,"ng-container",18),t.qZA()),2&n){const e=t.oxw(2);t.xp6(15),t.Q6J("ngIf",(null==e.formData?null:e.formData.Qty)>0),t.xp6(1),t.Q6J("ngIf",(null==e.formData?null:e.formData.Qty)>0)}}function pe(n,r){1&n&&(t.TgZ(0,"div",7)(1,"div",30)(2,"h2"),t._uU(3,'Your payment currency is "IDR"'),t.qZA()(),t.TgZ(4,"div",31)(5,"div",45)(6,"div",46)(7,"h2",47)(8,"button",48),t._uU(9," I Want to pay in USD "),t.qZA()(),t.TgZ(10,"div",49)(11,"div",50)(12,"ol",51)(13,"li",52),t._uU(14," Go to setup menu"),t.qZA(),t.TgZ(15,"li",52),t._uU(16," Click tab currency"),t.qZA(),t.TgZ(17,"li",52),t._uU(18," Select the currency you want to make for payment"),t.qZA(),t.TgZ(19,"li",52),t._uU(20," Select Yes at primary currency box and click save"),t.qZA(),t.TgZ(21,"li",53),t._uU(22," Then you can check to my subscribe again "),t.qZA()(),t.TgZ(23,"p",54),t._uU(24,"For more detailed information, please check the following article: "),t.TgZ(25,"a",55),t._uU(26,"Added Currency Conversion"),t.qZA()()()()()()()())}const ue=function(){return["/menu/Profile/Main/My_Subscription"]};function me(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"button",2),t._uU(3,"Subscribe Later"),t.qZA(),t.TgZ(4,"button",3),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onOpenSubscribeDialog())}),t._uU(5,"Subscribe Now"),t.qZA()(),t.TgZ(6,"content")(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"h2",10),t._uU(14,"Subscribe "),t.qZA(),t.TgZ(15,"small",11),t._uU(16,"(Recurring)"),t.qZA()(),t.TgZ(17,"a",12),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.showRegister=!i.showRegister)}),t._uU(18,"More"),t.qZA()(),t.TgZ(19,"div",13)(20,"table",14)(21,"tr")(22,"th"),t._uU(23,"Outlets"),t.qZA(),t.TgZ(24,"td"),t._uU(25,":"),t.qZA(),t.TgZ(26,"td")(27,"input",15,16),t.NdJ("ngModelChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.formData.Qty=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onQtyOutletChange())}),t.qZA(),t.TgZ(29,"span"),t._uU(30),t.ALo(31,"number"),t.qZA()()(),t.TgZ(32,"tr")(33,"th"),t._uU(34,"Cycle"),t.qZA(),t.TgZ(35,"td"),t._uU(36,":"),t.qZA(),t.TgZ(37,"td"),t.YNc(38,ee,5,4,"div",17),t.qZA()(),t.YNc(39,ne,10,5,"tr",18),t.qZA()()(),t.YNc(40,oe,17,1,"div",19),t.qZA(),t.TgZ(41,"div",20)(42,"div",7)(43,"div",21),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.invoice=!i.invoice)}),t.TgZ(44,"h2",22),t._uU(45,"Invoice Preview"),t.qZA()(),t.YNc(46,de,17,2,"div",23),t.qZA(),t.YNc(47,pe,27,0,"div",19),t.qZA()()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(15,ue)),t.xp6(2),t.Q6J("disabled",0==e.formData.Qty),t.xp6(23),t.Q6J("preventNegative",!0)("ngModel",e.formData.Qty),t.xp6(3),t.hij("/ ",t.lcZ(31,13,e.data.Type[0].amount),""),t.xp6(8),t.Q6J("ngForOf",e.data.DiscountOptions),t.xp6(1),t.Q6J("ngIf",e.showRegister),t.xp6(1),t.Q6J("ngIf",e.data.Options.Setup),t.xp6(6),t.Q6J("ngIf",e.invoice),t.xp6(1),t.Q6J("ngIf",e.data.Options.Setup)}}var R=(()=>{return(n=R||(R={}))[n.Monthly=1]="Monthly",n[n.ThreeMonth=3]="ThreeMonth",n[n.SixMonth=6]="SixMonth",n[n.Yearly=12]="Yearly",R;var n})();let _e=(()=>{class n extends P.U{constructor(e,o,i){super(e,"Subscription/MySubscriptionLoader",o),(0,a.Z)(this,"matDialog",void 0),(0,a.Z)(this,"showRegister",!1),(0,a.Z)(this,"invoice",!0),(0,a.Z)(this,"outletFee",0),(0,a.Z)(this,"registerFee",0),(0,a.Z)(this,"subTotal",0),this.matDialog=i}postBindForm(e){this.calculate(),this.data.DiscountOptions=e.DiscountOptions}onOpenSubscribeDialog(){this.matDialog.open(Xt,{data:{form:this.formData}})}onCycleChange(e){switch(this.formData.Cycle=e,e){case R.ThreeMonth:this.formData.Discount=0;break;case R.SixMonth:this.formData.Discount=10;break;case R.Yearly:this.formData.Discount=15}this.calculateregisterFee(),this.calculate()}onQtyOutletChange(){this.calculate()}calculate(){this.formData.Cycle>1?(this.data.Discount=this.data.Options.Type*this.formData.Qty*this.formData.Cycle*this.formData.Discount/100,this.outletFee=this.data.Options.Type*this.formData.Qty*this.formData.Cycle-this.data.Discount,this.subTotal=this.outletFee+this.registerFee):(this.outletFee=this.data.Options.Type*this.formData.Qty,this.subTotal=this.outletFee+this.registerFee,this.data.Discount=0),this.data.Options.SetupFee&&(this.subTotal=this.subTotal+this.formData.Setup)}calculateSetupFee(){this.data.Options.SetupFee?(this.formData.SetupFee=!0,this.subTotal=this.subTotal+this.formData.Setup):(this.formData.SetupFee=!1,this.subTotal=this.subTotal-this.formData.Setup)}onQtyRegisterChange(){this.calculateregisterFee(),this.calculate()}calculateregisterFee(){let e=this.data.Options.Register*this.formData.Cycle*this.formData.Register;this.registerFee=this.formData.Discount>0?e-e*this.formData.Discount/100:e}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(A.gz),t.Y36(f.uw))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-choose-plan"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-5",3,"routerLink"],[1,"btn","btn-success",3,"disabled","click"],[1,"container-fluid","bg-light-gray","pb-10"],[1,"row","pt-5"],[1,"col-md-5","m-0","pe-0","pt-0","pb-0"],[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"me-auto","d-sm-block","mt-3"],[1,"d-inline"],[1,"text-muted","h6"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"card-body",2,"padding-right","0.625rem"],[1,"table-sm"],["type","text","autoNum","",1,"form-control",2,"width","65px","display","inline-block",3,"preventNegative","ngModel","ngModelChange"],["outletQty","ngModel"],["class","card border-dark align-text-top d-inline-block me-1 mb-0",3,"class","click",4,"ngFor","ngForOf"],[4,"ngIf"],["class","card",4,"ngIf"],[1,"col-md-7"],[1,"card-header",3,"click"],[1,"title"],["class","card-body",4,"ngIf"],[1,"card","border-dark","align-text-top","d-inline-block","me-1","mb-0",3,"click"],[1,"card-body","text-center",2,"cursor","pointer","width","80px","padding","10px 5px"],[1,"fw-bold"],[1,"fw-normal","border-top","border-dark",3,"innerHTML"],["matTooltipPosition","above","matTooltip","Additional Register"],["type","text","autoNum","","maxlength","3",1,"form-control",2,"width","65px","display","inline-block",3,"preventNegative","ngModel","ngModelChange"],[1,"card-header"],[1,"card-body"],[1,"form-horizontal"],[1,"form-check","form-check-inline",2,"cursor","pointer","padding-top","8px"],["name","POS",3,"model","modelChange"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"min-width","65px"],[1,"text-end"],[1,"text-end",2,"min-width","85px"],[3,"innerHTML"],[2,"font-size","90% !important"],[1,"d-flex","justify-content-end"],[1,"table-sm","table-borderless","me-3"],[1,"sep"],["id","accordionExample",1,"accordion"],[1,"accordion-item"],["id","panelsStayOpen-headingTwo",1,"accordion-header"],["type","button","data-bs-toggle","collapse","data-bs-target","#panelsStayOpen-collapseTwo","aria-expanded","false","aria-controls","panelsStayOpen-collapseTwo",1,"accordion-button","collapsed"],["id","panelsStayOpen-collapseTwo","aria-labelledby","panelsStayOpen-headingTwo",1,"accordion-collapse","collapse"],[1,"accordion-body","pt-2"],[1,"list-group","list-group-numbered","mt-5","mb-3"],[1,"list-group-item","mb-3","border-top-0","border-start-0","border-end-0","border-bottom-1"],[1,"list-group-item","rounded-0","border-top-0","border-start-0","border-end-0","border-bottom-1"],[1,"ms-2","mt-6"],["href","https://support.dealpos.com/en/articles/4774163-added-currency-conversion","target","_blank"]],template:function(e,o){1&e&&t.YNc(0,me,48,16,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.formData)},dependencies:[g.sg,g.O5,l.Fj,l.JJ,l.nD,l.On,A.rH,d.p,te.b,X.P,s.gM,g.JJ],styles:[".active[_ngcontent-%COMP%]{background-color:#fffed9}"]})),n})();var ge=_(22863);let he=(()=>{class n{constructor(e,o,i){(0,a.Z)(this,"dialogRef",void 0),(0,a.Z)(this,"data",void 0),(0,a.Z)(this,"router",void 0),(0,a.Z)(this,"config",new k.O),this.dialogRef=e,this.data=o,this.router=i,this.config.title=this.data.title,this.config.okText="Yes",this.config.cancelText="No"}onOk(){this.router.navigate(["/menu/Profile/Main/My_Subscription/Choose_your_plan"]),this.dialogRef.close()}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.so),t.Y36(f.WI),t.Y36(A.F0))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-modal-choose-plan"]],decls:6,vars:2,consts:[[3,"config","onOk","onCancel","onClose"],[1,"text-center",2,"width","440px"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"h4",1),t._uU(3),t.TgZ(4,"span"),t._uU(5,"Do you want to Choose your Plan ?"),t.qZA()()()()),2&e&&(t.Q6J("config",o.config),t.xp6(3),t.hij(" ",o.data.body," "))},dependencies:[F.M]})),n})(),fe=(()=>{class n{constructor(e,o,i,c){(0,a.Z)(this,"httpService",void 0),(0,a.Z)(this,"dialogRef",void 0),(0,a.Z)(this,"data",void 0),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"message",""),(0,a.Z)(this,"config",new k.O),this.httpService=e,this.dialogRef=o,this.data=i,this.toastr=c,this.config.title="Confim Adjusted Subscription"}onOk(){const e={Message:this.message};0==this.message.trim().length?(this.toastr.error("The reason cannot be empty",v.n.Error),this.dialogRef.close()):this.httpService.post("/API/Subscription/Confirm",JSON.stringify(e)).subscribe(o=>{this.toastr.success(o.Message,v.n.Success),this.dialogRef.close()})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(f.so),t.Y36(f.WI),t.Y36(x._W))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-modal-confirm-adjusted-plan"]],decls:8,vars:2,consts:[[3,"config","onOk","onCancel","onClose"],[1,"font-weight","h4","mb-5"],[1,"form-floating-outline"],["name","address","id","inputAddress","placeholder","Address","matTooltipPosition","above","matTooltip","Address","required","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputAddress"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"p",1),t._uU(3," Do you agree about billing adjusted? "),t.qZA(),t.TgZ(4,"div",2)(5,"textarea",3),t.NdJ("ngModelChange",function(c){return o.message=c}),t.qZA(),t.TgZ(6,"label",4),t._uU(7,"Reason"),t.qZA()()()()),2&e&&(t.Q6J("config",o.config),t.xp6(5),t.Q6J("ngModel",o.message))},dependencies:[l.Fj,l.JJ,l.Q7,l.On,F.M,s.gM]})),n})(),Ze=(()=>{class n{constructor(e,o,i,c){(0,a.Z)(this,"httpService",void 0),(0,a.Z)(this,"dialogRef",void 0),(0,a.Z)(this,"data",void 0),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"message",""),(0,a.Z)(this,"config",new k.O),this.httpService=e,this.dialogRef=o,this.data=i,this.toastr=c,this.config.title="Stop Subscription"}onOk(){const e={Message:this.message};0==this.message.trim().length?(this.toastr.error("The reason cannot be empty",v.n.Error),this.dialogRef.close()):this.httpService.post("/API/Subscription/Close",JSON.stringify(e)).subscribe(o=>{this.toastr.success(o.Message,v.n.Error),this.dialogRef.close()})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(f.so),t.Y36(f.WI),t.Y36(x._W))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-modal-stop-subscription"]],decls:6,vars:2,consts:[[3,"config","onOk","onCancel","onClose"],[1,"form-floating-outline"],["name","message",2,"width","250px","height","102px",3,"ngModel","ngModelChange"],["for","message"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"textarea",2),t.NdJ("ngModelChange",function(c){return o.message=c}),t.qZA(),t.TgZ(4,"label",3),t._uU(5,"Reason"),t.qZA()()()()),2&e&&(t.Q6J("config",o.config),t.xp6(3),t.Q6J("ngModel",o.message))},dependencies:[l.Fj,l.JJ,l.On,F.M]})),n})();var be=_(69751);let Te=(()=>{class n{constructor(){(0,a.Z)(this,"apiUrl","https://app.midtrans.com/snap/snap.js"),(0,a.Z)(this,"injected",!1)}initScript(){return new be.y(e=>{let o;this.injected||(o=document.createElement("script"),o.src=this.apiUrl,o.async=!0,o.setAttribute("data-client-key","Mid-client-rdi5ridKhHfeIvTj"),this.injected=!0,document.body.appendChild(o))})}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,a.Z)(n,"\u0275prov",t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})),n})();const xe=function(){return["/menu/Profile/Main/My_Subscription/Choose_your_plan"]};function ve(n,r){1&n&&(t.TgZ(0,"a",34),t._uU(1,"Choose Your Plan"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,xe))}function ye(n,r){if(1&n&&(t.TgZ(0,"div",16),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,e.data.Zoho.Subscription.Since,"dd MMM yyyy")," ")}}const Ae=function(n,r){return{"bg-warning":n,"bg-danger":r}};function Se(n,r){if(1&n&&(t.TgZ(0,"div",35)(1,"div",36)(2,"h5",13),t._uU(3," Subscription "),t.qZA(),t.TgZ(4,"div",16),t._uU(5),t.qZA()()()),2&n){const e=t.oxw(2);t.xp6(1),t.Tol(t.WLB(3,Ae,"SellOnly"==e.data.Zoho.Subscription.SubscriptionState||"Overdue"==e.data.Zoho.Subscription.SubscriptionState,"Suspended"==e.data.Zoho.Subscription.SubscriptionState)),t.xp6(4),t.hij(" ",e.data.Zoho.Subscription.SubscriptionState," ")}}function Me(n,r){if(1&n&&(t.TgZ(0,"span",42),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij("",t.lcZ(2,1,e.data.Zoho.Subscription.Discount)," %")}}function De(n,r){if(1&n&&(t.TgZ(0,"span")(1,"del"),t._uU(2),t.ALo(3,"number"),t.qZA(),t._UZ(4,"br"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(2),t.Oqu(t.lcZ(3,1,e.data.Zoho.Subscription.TotalAmount))}}function we(n,r){if(1&n&&(t.TgZ(0,"div",6)(1,"div",7)(2,"h2"),t._uU(3,"Current Plan"),t.qZA()(),t.TgZ(4,"div",9)(5,"table",28)(6,"thead",29)(7,"tr")(8,"th",37),t._uU(9,"Usage"),t.qZA(),t.TgZ(10,"th",37),t._uU(11,"Frequency"),t.qZA(),t.TgZ(12,"th",38),t._uU(13,"Amount"),t.qZA()()(),t.TgZ(14,"tbody")(15,"tr")(16,"td",39),t._uU(17),t._UZ(18,"br"),t._uU(19),t.ALo(20,"number"),t.TgZ(21,"small"),t._uU(22,"month"),t.qZA(),t._uU(23,") "),t.qZA(),t.TgZ(24,"td",39)(25,"span"),t._uU(26),t._UZ(27,"br"),t.qZA(),t.YNc(28,Me,3,3,"span",40),t.qZA(),t.TgZ(29,"td",39),t.YNc(30,De,5,3,"span",41),t.TgZ(31,"span"),t._uU(32),t.ALo(33,"number"),t.qZA()()()()()()()),2&n){const e=t.oxw(2);t.xp6(17),t.hij(" ",e.data.Zoho.Subscription.OutletCount," Outlet"),t.xp6(2),t.hij(" (",t.lcZ(20,6,e.data.Zoho.Subscription.RecurringAmount)," / "),t.xp6(7),t.Oqu(12==e.data.Zoho.Subscription.Frequency?"Yearly":1==e.data.Zoho.Subscription.Frequency?"Monthly":3==e.data.Zoho.Subscription.Frequency?"3 Months":"6 Months"),t.xp6(2),t.Q6J("ngIf",0!=e.data.Zoho.Subscription.Discount),t.xp6(2),t.Q6J("ngIf",0!=e.data.Zoho.Subscription.Discount),t.xp6(2),t.Oqu(t.lcZ(33,8,e.data.Zoho.Subscription.TotalAfterDiscount))}}function Oe(n,r){if(1&n&&(t.TgZ(0,"span",42),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij("",t.lcZ(2,1,e.data.Zoho.Subscription.Discount)," %")}}function qe(n,r){if(1&n&&(t.TgZ(0,"span")(1,"del"),t._uU(2),t.ALo(3,"number"),t.qZA(),t._UZ(4,"br"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(2),t.Oqu(t.lcZ(3,1,e.data.NextBilling.TotalAmount))}}function Ue(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"div",6)(1,"div",7)(2,"div")(3,"h2"),t._uU(4,"Adjusted Plan"),t.qZA()(),t.TgZ(5,"div",43)(6,"button",44),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onOpenConfirmAdjustedModal())}),t._uU(7," Confirm "),t.qZA()()(),t.TgZ(8,"div",9)(9,"table",28)(10,"thead",29)(11,"tr")(12,"th",37),t._uU(13,"Usage"),t.qZA(),t.TgZ(14,"th",37),t._uU(15,"Frequency"),t.qZA(),t.TgZ(16,"th",38),t._uU(17,"Amount"),t.qZA()()(),t.TgZ(18,"tbody")(19,"tr")(20,"td",39),t._uU(21),t._UZ(22,"br"),t._uU(23),t.ALo(24,"number"),t.TgZ(25,"small"),t._uU(26,"month"),t.qZA(),t._uU(27,") "),t.qZA(),t.TgZ(28,"td",39)(29,"span"),t._uU(30),t._UZ(31,"br"),t.qZA(),t.YNc(32,Oe,3,3,"span",40),t.qZA(),t.TgZ(33,"td",39),t.YNc(34,qe,5,3,"span",41),t.TgZ(35,"span"),t._uU(36),t.ALo(37,"number"),t.qZA()()()()()()()}if(2&n){const e=t.oxw(2);t.xp6(21),t.hij(" ",e.data.NextBilling.Outlet," Outlet"),t.xp6(2),t.hij(" (",t.lcZ(24,6,e.data.NextBilling.RecurringAmount)," / "),t.xp6(7),t.Oqu(12==e.data.Zoho.Subscription.Frequency?"Yearly":3==e.data.Zoho.Subscription.Frequency?"3 Monthly":"6 Months"),t.xp6(2),t.Q6J("ngIf",0!=e.data.Zoho.Subscription.Discount),t.xp6(2),t.Q6J("ngIf",0!=e.data.Zoho.Subscription.Discount),t.xp6(2),t.Oqu(t.lcZ(37,8,e.data.NextBilling.TotalAfterDiscount))}}function Pe(n,r){if(1&n&&(t.TgZ(0,"small",26),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij(" Tax Deduction (",e.data.Zoho.TaxDeductionPercentage," %)")}}function Ne(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"a",57),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.payAllInvoice())}),t._UZ(1,"i",58),t._uU(2),t.ALo(3,"number"),t.ALo(4,"sum"),t.ALo(5,"Filter"),t.ALo(6,"sum"),t.ALo(7,"Filter"),t.qZA()}if(2&n){const e=t.oxw(3);t.xp6(2),t.hij(" Pay All ~ IDR ",t.lcZ(3,1,t.xi3(4,3,t.Dn7(5,6,e.data.Zoho.invoices,"overdue","status"),"total")+t.xi3(6,10,t.Dn7(7,13,e.data.Zoho.invoices,"sent","status"),"total"))," ")}}function Ie(n,r){if(1&n&&(t.TgZ(0,"p",67),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("(",t.lcZ(2,1,e.balance)," due)")}}function Je(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",68),t.NdJ("click",function(){t.CHM(e);const i=t.oxw().$implicit,c=t.oxw(3);return t.KtG(c.paySingleInvoice(i))}),t._UZ(1,"i",58),t.TgZ(2,"span",65),t._uU(3,"Pay Now"),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.MGl("id","pay-button",e.invoice_number,"")}}const Fe=function(n){return{"background-color":n}};function Ee(n,r){if(1&n&&(t.TgZ(0,"tr",59)(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.ALo(5,"date"),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td",53),t._uU(9),t.ALo(10,"number"),t.YNc(11,Ie,3,3,"p",60),t.qZA(),t.TgZ(12,"td"),t._uU(13),t.qZA(),t.TgZ(14,"td",61),t._uU(15),t.qZA(),t.TgZ(16,"td",62)(17,"a",63),t._UZ(18,"i",64),t.TgZ(19,"span",65),t._uU(20,"View"),t.qZA()(),t.YNc(21,Je,4,1,"button",66),t.qZA()()),2&n){const e=r.$implicit,o=r.index;t.Akn(t.VKq(16,Fe,"overdue"==e.status?"#f2dede":"")),t.xp6(2),t.Oqu(o+1+"."),t.xp6(2),t.Oqu(t.xi3(5,11,e.date,"dd MMM yyyy")),t.xp6(3),t.Oqu(e.invoice_number),t.xp6(2),t.hij(" ",t.lcZ(10,14,e.total)," "),t.xp6(2),t.Q6J("ngIf",e.total!=e.balance&&e.balance>0),t.xp6(2),t.Oqu(e.currency_code),t.xp6(2),t.Oqu(e.status),t.xp6(2),t.s9C("href",e.invoice_url,t.LSH),t.xp6(4),t.Q6J("ngIf",("sent"==e.status||"overdue"==e.status)&&"IDR"==e.currency_code)}}function Le(n,r){if(1&n&&(t.TgZ(0,"div",6)(1,"div",7)(2,"div",45)(3,"h2",46),t._UZ(4,"i",47),t._uU(5," Invoices"),t.qZA(),t.YNc(6,Pe,2,1,"small",48),t.qZA(),t.YNc(7,Ne,8,17,"a",49),t.qZA(),t.TgZ(8,"div",9)(9,"table",50)(10,"thead",29)(11,"tr")(12,"th",30),t._uU(13,"No"),t.qZA(),t.TgZ(14,"th",51),t._uU(15,"Date"),t.qZA(),t.TgZ(16,"th",52),t._uU(17,"Number"),t.qZA(),t.TgZ(18,"th",53),t._uU(19,"Amount"),t.qZA(),t._UZ(20,"th",54),t.TgZ(21,"th",55),t._uU(22,"Status"),t.qZA(),t.TgZ(23,"th"),t._uU(24,"Invoice"),t.qZA()()(),t.TgZ(25,"tbody"),t.YNc(26,Ee,22,18,"tr",56),t.qZA()()()()),2&n){const e=t.oxw(2);t.xp6(6),t.Q6J("ngIf",e.data.Zoho.TaxDeductionPercentage>0),t.xp6(1),t.Q6J("ngIf",e.outstandingInvoiceCount>1&&"RP"==e.data.Zoho.Subscription.Currency),t.xp6(19),t.Q6J("ngForOf",e.data.Zoho.invoices)}}function Qe(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"button",69),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.load())}),t._uU(1," Load "),t.qZA()}}const ke=function(n){return{"bg-gradient-warning":n}};function Re(n,r){if(1&n&&(t.TgZ(0,"tr",59)(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",53),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",53),t._uU(9),t.qZA(),t.TgZ(10,"td",53),t._uU(11),t.ALo(12,"date"),t.qZA(),t.TgZ(13,"td",53),t._uU(14),t.ALo(15,"date"),t.qZA()()),2&n){const e=r.$implicit,o=r.index;t.xp6(2),t.Oqu(o+1+"."),t.xp6(2),t.Oqu(e.Name),t.xp6(1),t.Tol(t.VKq(16,ke,e.OrdersCount<25)),t.xp6(1),t.Oqu(t.lcZ(7,8,e.OrdersCount)),t.xp6(3),t.Oqu(e.RegisterCount),t.xp6(2),t.Oqu(t.xi3(12,10,e.MinDate,"dd MMM yyyy")),t.xp6(3),t.Oqu(t.xi3(15,13,e.MaxDate,"dd MMM yyyy"))}}function Ye(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,ve,2,2,"a",2),t.qZA(),t.TgZ(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"h2"),t._UZ(10,"i",8),t._uU(11," Account"),t.qZA()(),t.TgZ(12,"div",9)(13,"div",10)(14,"div",11)(15,"div",12)(16,"h5",13),t._uU(17," Since "),t.qZA(),t.YNc(18,ye,3,4,"div",14),t.qZA()(),t.TgZ(19,"div",15)(20,"div",12)(21,"h5",13),t._uU(22," Type "),t.qZA(),t.TgZ(23,"div",16),t._uU(24),t.qZA()()(),t.YNc(25,Se,6,6,"div",17),t.qZA()()(),t.YNc(26,we,34,10,"div",18),t.YNc(27,Ue,38,10,"div",18),t.TgZ(28,"div",6)(29,"div",7)(30,"h2"),t._UZ(31,"i",19),t._uU(32," Info"),t.qZA()(),t.TgZ(33,"div",9)(34,"div"),t._uU(35," Please pay your biling directly inside our platform. We provide multiple methods ex: Credit Card/Bank Transfer/E-Money. "),t.qZA()()(),t.TgZ(36,"div",6)(37,"div",7)(38,"h2"),t._UZ(39,"i",20),t._uU(40," Close Store"),t.qZA()(),t.TgZ(41,"div",9)(42,"div"),t._uU(43," You can close your store to stop your billing. "),t.qZA(),t.TgZ(44,"div",21)(45,"button",22),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onOpenCloseModal())}),t._uU(46," Close "),t.qZA()()()()(),t.TgZ(47,"div",23),t.YNc(48,Le,27,3,"div",18),t.TgZ(49,"div",6)(50,"div",24)(51,"h2"),t._UZ(52,"i",25),t._uU(53," Outlets Usage "),t.TgZ(54,"small",26),t._uU(55),t.ALo(56,"date"),t.ALo(57,"date"),t.qZA()(),t.YNc(58,Qe,2,0,"button",27),t.qZA(),t.TgZ(59,"div",9)(60,"table",28)(61,"thead",29)(62,"tr")(63,"th",30),t._uU(64,"No"),t.qZA(),t.TgZ(65,"th"),t._uU(66,"Outlet Name"),t.qZA(),t.TgZ(67,"th",31),t._uU(68,"Orders"),t.qZA(),t.TgZ(69,"th",31),t._uU(70,"Registers"),t.qZA(),t.TgZ(71,"th",32),t._uU(72,"Min Date"),t.qZA(),t.TgZ(73,"th",32),t._uU(74,"Max Date"),t.qZA()()(),t.TgZ(75,"tbody"),t.YNc(76,Re,16,18,"tr",33),t.ALo(77,"sortBy"),t.qZA()()()()()()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf","Trial"==e.data.Account.Type),t.xp6(16),t.Q6J("ngIf",e.data.Zoho.Subscription),t.xp6(6),t.hij(" ",e.data.Account.Type," "),t.xp6(1),t.Q6J("ngIf",null!=e.data.Zoho.CustomerID),t.xp6(1),t.Q6J("ngIf",null!=e.data.Zoho.Subscription),t.xp6(1),t.Q6J("ngIf",null!=e.data.Zoho.Subscription&&e.data.NextBilling&&e.data.Billed>e.data.Zoho.Subscription.OutletCount),t.xp6(21),t.Q6J("ngIf",e.data.Zoho.invoices&&e.data.Zoho.invoices.length>0),t.xp6(7),t.AsE("(",t.xi3(56,14,e.data.From,"dd MMM yyyy")," - ",t.xi3(57,17,e.data.To,"dd MMM yyyy"),")"),t.xp6(3),t.Q6J("ngIf",0==e.data.Outlets.length),t.xp6(18),t.Q6J("ngForOf",t.Dn7(77,20,e.data.Outlets,"desc","OrdersCount"))}}let He=(()=>{class n extends ge.M{constructor(e,o,i,c,y){super(e),(0,a.Z)(this,"matDialog",void 0),(0,a.Z)(this,"midtrans",void 0),(0,a.Z)(this,"ngZone",void 0),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"modalTitle",void 0),(0,a.Z)(this,"modalBody",void 0),(0,a.Z)(this,"data",void 0),(0,a.Z)(this,"loadOutlet",!1),(0,a.Z)(this,"outstandingInvoiceCount",0),this.matDialog=o,this.midtrans=i,this.ngZone=c,this.toastr=y,this.data=null}ngOnInit(){this.midtrans.initScript().subscribe(),this.menuData$.subscribe(()=>{this.getData()})}getData(){this.httpService.post("/API/Subscription/GetData",{LoadOutlet:this.loadOutlet}).subscribe({next:o=>{this.data=o,p.gT.IsEmpty(this.data.Outlets)&&(this.data.Outlets=[]),this.postInit(o)}})}postInit(e){e.Zoho.invoices=e.Zoho.invoices?e.Zoho.invoices:[],200!=e.Zoho.code&&(401==e.Zoho.code?this.modalTitle="Trial Customer":400==e.Zoho.code&&(this.modalTitle="your account customer"),this.modalBody=e.Zoho.message,this.matDialog.open(he,{data:{title:this.modalTitle,body:this.modalBody}})),e.Zoho.invoices.forEach(o=>{("sent"==o.status||"overdue"==o.status)&&this.outstandingInvoiceCount++})}showToaster(e){var o="Payment Successful!";e>1&&(o+="\nPlease Log out and re-login if your account is currently suspended!"),this.toastr.success(o,v.n.Success)}payAllInvoice(){let o,i,c,y,e=0;this.data.Zoho.invoices.forEach(M=>{("sent"==M.status||"overdue"==M.status)&&(e+=M.total,null==i?(o=M.invoice_number,i=M.invoice_number.concat("$"+M.total+";"),c=M.invoice_id,y=M.invoice_id.concat("$"+M.total+";")):(o=o.concat("_"+M.invoice_number),i=i.concat(M.invoice_number.concat("$"+M.total+";")),c=c.concat(";"+M.invoice_id),y=y.concat(M.invoice_id.concat("$"+M.total)+";")))}),this.httpService.post("/API/Subscription/GetSNAPTokenMultipleInvoice",JSON.stringify({customer_id:this.data.Zoho.invoices[0].customer_id,invoice_number:i,order_id:o,total:e,invoice_id:y})).subscribe(M=>{this.openSNAPDialog(M)})}paySingleInvoice(e){this.httpService.post("/API/Subscription/GetSNAPToken",JSON.stringify({invoice_number:e.invoice_number,balance:e.balance,TaxDeductionPercentage:this.data.Zoho.TaxDeductionPercentage,invoice_id:e.invoice_id,customer_id:e.customer_id})).subscribe(i=>{this.openSNAPDialog(i)})}openSNAPDialog(e){let o=this.data.Account.SubscriptionStatus;snap.pay(e.token,{onSuccess:i=>{this.ngZone.run(()=>{this.showToaster(o),this.getData()})}})}onOpenCloseModal(){this.matDialog.open(Ze)}onOpenConfirmAdjustedModal(){this.matDialog.open(fe)}load(){this.loadOutlet=!0,this.getData()}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(f.uw),t.Y36(Te),t.Y36(t.R0b),t.Y36(x._W))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-my-subscription"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["class","btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","bg-light-gray"],[1,"row","pt-5","ms-3"],[1,"col-md-4"],[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"fa-solid","fa-user"],[1,"card-body"],[1,"row"],[1,"col","pe-0","ps-3"],[1,"p-3","border","rounded","bg-light-gray","text-black"],[1,"fw-bold"],["class","mt-4 h6",4,"ngIf"],[1,"col","pe-3","ps-3"],[1,"mt-4","h6"],["class","col ps-0 pe-3",4,"ngIf"],["class","card",4,"ngIf"],[1,"fa-solid","fa-circle-info"],[1,"fa-solid","fa-xmark-circle"],[1,"mt-4"],["type","button",1,"btn","btn-sm","btn-danger","py-2",3,"click"],[1,"col-md-8"],[1,"card-header","d-flex","justify-content-between","align-items-center"],[1,"fa","fa-location-dot"],[1,"text-muted","h6"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"table","mt-5"],[1,"thead-light","sticky-top-thead"],[2,"width","20px"],[1,"text-end",2,"width","100px"],[1,"text-end",2,"width","120px"],["class","border",4,"ngFor","ngForOf"],[1,"btn","btn-success",3,"routerLink"],[1,"col","ps-0","pe-3"],[1,"p-3","border","rounded","bg-success","text-white"],[1,"text-center"],[1,"text-center",2,"width","104px"],[1,"text-center","align-top"],["class","text-danger",4,"ngIf"],[4,"ngIf"],[1,"text-danger"],[1,"btn-group"],["type","button",1,"btn","btn-sm","btn-success","py-2",3,"click"],[1,"me-auto","d-sm-block"],[1,"d-inline"],[1,"fa-solid","fa-file-invoice"],["class","text-muted h6",4,"ngIf"],["class","btn btn-success btn-sm","role","button","matTooltipPosition","above","matTooltip","Pay All",3,"click",4,"ngIf"],["id","tableGrid",1,"table","mt-5"],[2,"width","120px"],[2,"width","100px"],[1,"text-end"],[2,"width","60px"],[2,"width","80px"],["class","border",3,"style",4,"ngFor","ngForOf"],["role","button","matTooltipPosition","above","matTooltip","Pay All",1,"btn","btn-success","btn-sm",3,"click"],[1,"fa-lg","fa-solid","fa-arrows-rotate"],[1,"border"],["class","fst-italic text-warning",4,"ngIf"],[1,"text-uppercase"],[1,"d-flex","justify-content-between"],["target","_blank",3,"href"],[1,"fa-lg","fa-solid","fa-file-lines"],[1,"ms-3"],["style","border-width: 1px;",3,"id","click",4,"ngIf"],[1,"fst-italic","text-warning"],[2,"border-width","1px",3,"id","click"],[1,"btn","btn-outline-secondary",3,"click"]],template:function(e,o){1&e&&t.YNc(0,Ye,78,24,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[g.sg,g.O5,A.rH,d.p,s.gM,g.JJ,g.uU,E.qU,E.wn,E.W7]})),n})();var Ve=_(71638);function Be(n,r){1&n&&(t.TgZ(0,"div",13)(1,"h5",14),t._UZ(2,"i",15),t._uU(3," You are not listening to any outlet. Please select one. "),t.qZA()())}function Ge(n,r){if(1&n&&(t.TgZ(0,"div",16)(1,"h5",14),t._UZ(2,"i",15),t._uU(3),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(3),t.hij(" You are currently listening to ",null==e.selectedOutlet?null:e.selectedOutlet.Name,". ")}}function Ke(n,r){if(1&n&&(t.TgZ(0,"div",9)(1,"div",10),t.YNc(2,Be,4,0,"div",11),t.YNc(3,Ge,4,1,"div",12),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngIf",!e.selectedOutlet),t.xp6(1),t.Q6J("ngIf",e.selectedOutlet)}}let je=(()=>{class n{constructor(e,o,i,c){(0,a.Z)(this,"signalrClientService",void 0),(0,a.Z)(this,"httpService",void 0),(0,a.Z)(this,"dialogRef",void 0),(0,a.Z)(this,"toastr",void 0),(0,a.Z)(this,"modalConfig",void 0),(0,a.Z)(this,"entities",void 0),(0,a.Z)(this,"outletID",void 0),(0,a.Z)(this,"selectedOutlet",void 0),(0,a.Z)(this,"initialOutlet",void 0),(0,a.Z)(this,"touchOnSelectOption",void 0),(0,a.Z)(this,"previousSelectedOutlet",void 0),this.signalrClientService=e,this.httpService=o,this.dialogRef=i,this.toastr=c,this.modalConfig=new k.O,this.modalConfig.title="Subscribe Notification",this.modalConfig.customWidth="475px",this.initModalLoader(),this.touchOnSelectOption=!1}initModalLoader(){this.httpService.post("/api/NotificationLoader/PushNotificationList").pipe((0,J.h)(e=>p.gT.IsNotEmpty(e))).subscribe(e=>{this.entities=e.Options.Entities,p.gT.IsNotEmpty(e.SubscribeOn)&&(this.outletID=e.SubscribeOn),this.initSelectedOutlet()})}initSelectedOutlet(){this.selectedOutlet=this.findOutletByID(this.outletID),this.previousSelectedOutlet=this.selectedOutlet,this.initialOutlet=this.selectedOutlet,this.checkValidateButtonOk()}checkValidateButtonOk(){this.modalConfig.validated=!0,p.gT.IsEmpty(this.selectedOutlet)&&(this.modalConfig.validated=!1)}onSelectOutlet(e){this.previousSelectedOutlet=this.selectedOutlet,this.selectedOutlet=e,this.modalConfig.validated=!0}onOpenSelectOutlet(){this.touchOnSelectOption=!0}onCancel(){this.dialogRef.close()}onOk(){this.outletID!==(this.initialOutlet?this.initialOutlet.ID:null)?p.gT.IsNotEmpty(this.outletID)?this.subscribeToPushNotification(`Listening to ${this.selectedOutlet?.Name}`,"Push Notification Enabled"):this.unsubscribeToPushNotification():this.dialogRef.close()}unsubscribeToPushNotification(){this.subscribeToPushNotification(`You are no longer listening to ${this.previousSelectedOutlet?.Name}`,"Push Notification Disabled"),this.setLocalStorage(!0)}subscribeToPushNotification(e,o){let i=localStorage.getItem("PushNotificationID");this.httpService.post("/api/PushNotification/Subscribe",{EntityID:this.outletID}).subscribe(y=>{this.signalrClientService.SubscribeGroup(this.outletID?this.outletID:"",i),this.setLocalStorage(),this.toastr.success(e,o),this.dialogRef.close()})}setLocalStorage(e=!1){e?localStorage.removeItem("NotificationOutletID"):localStorage.setItem("NotificationOutletID",this.outletID)}findOutletByID(e){return this.entities.find(i=>i.ID==e)}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Ve.G),t.Y36(Z.O),t.Y36(f.so),t.Y36(x._W))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-modal-subscribe-notification"]],decls:11,vars:4,consts:[[3,"config","onOk","onCancel","onClose"],[1,"container"],["class","row",4,"ngIf"],[1,"row","mt-1"],[1,"col-md-2"],[1,"pt-10"],[1,"col-md-10"],[1,"form-floating-outline","selected"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose an Options","id","outlet",1,"productform",3,"items","ngModel","open","clear","ngModelChange","change"],[1,"row"],[1,"col-12"],["class","alert alert-danger",4,"ngIf"],["class","alert alert-success",4,"ngIf"],[1,"alert","alert-danger"],[1,"d-flex"],["aria-hidden","true",1,"fa-solid","fa-circle-info","me-3","mt-1"],[1,"alert","alert-success"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),t.TgZ(1,"content")(2,"div",1),t.YNc(3,Ke,4,2,"div",2),t.TgZ(4,"div",3)(5,"div",4)(6,"h5",5),t._uU(7,"Outlet"),t.qZA()(),t.TgZ(8,"div",6)(9,"div",7)(10,"ng-select",8),t.NdJ("open",function(){return o.onOpenSelectOutlet()})("clear",function(){return o.onOpenSelectOutlet()})("ngModelChange",function(c){return o.outletID=c})("change",function(c){return o.onSelectOutlet(c)}),t.qZA()()()()()()()),2&e&&(t.Q6J("config",o.modalConfig),t.xp6(3),t.Q6J("ngIf",!o.touchOnSelectOption),t.xp6(7),t.Q6J("items",o.entities)("ngModel",o.outletID))},dependencies:[g.O5,l.JJ,l.On,F.M,Y.w9]})),n})();var tt=_(59798);const We=function(n){return{ID:n}};function $e(n,r){if(1&n&&(t.TgZ(0,"a",18),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("routerLink","/menu"+e.URL)("queryParams",t.VKq(3,We,e.ObjectID)),t.xp6(1),t.hij(" ",e.Body," ")}}function ze(n,r){if(1&n&&(t.TgZ(0,"a",19),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.s9C("href",e.URL,t.LSH),t.xp6(1),t.hij(" ",e.Body," ")}}function Xe(n,r){if(1&n&&(t.TgZ(0,"tr",15)(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td")(4,"b"),t._uU(5),t.qZA(),t._UZ(6,"br"),t.TgZ(7,"span"),t.YNc(8,$e,2,5,"a",16),t.YNc(9,ze,2,2,"a",17),t.qZA()(),t.TgZ(10,"td"),t._uU(11),t.ALo(12,"date"),t.qZA(),t.TgZ(13,"td"),t._uU(14),t.qZA()()),2&n){const e=r.$implicit;t.xp6(2),t.Oqu(e.OutletName),t.xp6(3),t.Oqu(e.Header),t.xp6(3),t.Q6J("ngIf",e.ObjectIDType>0),t.xp6(1),t.Q6J("ngIf",0==e.ObjectIDType),t.xp6(2),t.Oqu(t.xi3(12,6,e.Created,"dd MMM yyyy HH:mm")),t.xp6(3),t.Oqu(e.TypeString)}}function tn(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mat-paginator",20),t.NdJ("page",function(i){t.CHM(e);const c=t.oxw(2);return t.KtG(c.onPaginationChange(i))}),t.qZA()}if(2&n){const e=t.oxw(2);t.Q6J("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",0==e.pageData.Filter.PageNumber?0:e.pageData.Filter.PageNumber-1)}}function en(n,r){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.searchFromPageOne())}),t.TgZ(1,"actions")(2,"a",2),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.openSubscribeModal())}),t._uU(3,"Subscribe"),t.qZA()(),t.TgZ(4,"filters")(5,"div",3)(6,"div",4)(7,"div")(8,"h6"),t._uU(9,"Outlet"),t.qZA(),t.TgZ(10,"ng-select",5),t.NdJ("ngModelChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.pageData.Filter.ListIDs=i)}),t.qZA()(),t.TgZ(11,"div")(12,"h6"),t._uU(13,"From"),t.qZA(),t.TgZ(14,"datepicker",6),t.NdJ("dateChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.pageData.Filter.From=i)}),t.qZA()(),t.TgZ(15,"div")(16,"h6"),t._uU(17,"To"),t.qZA(),t.TgZ(18,"datepicker",7),t.NdJ("dateChange",function(i){t.CHM(e);const c=t.oxw();return t.KtG(c.pageData.Filter.To=i)}),t.qZA()()()()(),t.TgZ(19,"content")(20,"div",8)(21,"table",9)(22,"thead",10)(23,"tr",11)(24,"th",12),t._uU(25,"Outlet"),t.qZA(),t.TgZ(26,"th"),t._uU(27,"Message"),t.qZA(),t.TgZ(28,"th"),t._uU(29,"Created"),t.qZA(),t.TgZ(30,"th"),t._uU(31,"Type"),t.qZA()()(),t.TgZ(32,"tbody"),t.YNc(33,Xe,15,9,"tr",13),t.qZA()(),t.TgZ(34,"div"),t.YNc(35,tn,1,3,"mat-paginator",14),t.qZA()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(10),t.Q6J("items",e.pageData.Options.Entities)("ngModel",e.pageData.Filter.ListIDs)("multiple",!0),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(4),t.Q6J("date",e.pageData.Filter.To),t.xp6(15),t.Q6J("ngForOf",e.data.Data),t.xp6(2),t.Q6J("ngIf",e.pagination.listTotal>0)}}const nn=[{path:"Main/My_Profile",component:qt},{path:"Main/My_Subscription",component:He},{path:"Main/Notification",component:(()=>{class n extends W.n{constructor(e,o){super(e,"v3/notification/WithTotalCount","NotificationLoader/PushNotificationList"),(0,a.Z)(this,"dialog",void 0),this.dialog=o}preInitList(){let e=new Date;e.setHours(0,0,0,0);let o=new Date;o.setHours(23,59,59,59),this.pageData.Filter.From=e,this.pageData.Filter.To=o}openSubscribeModal(){this.dialog.open(je)}}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(Z.O),t.Y36(f.uw))}),(0,a.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-notification"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button",1,"btn","btn-success",3,"click"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID",3,"items","ngModel","multiple","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","200px"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],[1,"border-bottom"],["target","_blank",3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],["target","_blank",3,"routerLink","queryParams"],["target","_blank",3,"href"],[3,"length","pageSize","pageIndex","page"]],template:function(e,o){1&e&&t.YNc(0,en,36,9,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[g.sg,g.O5,l.JJ,l.On,A.rH,d.p,tt.NW,K.QB,Y.w9,g.uU]})),n})()},{path:"Main/My_Sales",component:Kt},{path:"Main/My_Subscription/Choose_your_plan",component:_e}];let on=(()=>{class n{}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,a.Z)(n,"\u0275mod",t.oAB({type:n})),(0,a.Z)(n,"\u0275inj",t.cJS({imports:[A.Bz.forChild(nn),A.Bz]})),n})();var an=_(65131);let rn=(()=>{class n{}return(0,a.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,a.Z)(n,"\u0275mod",t.oAB({type:n})),(0,a.Z)(n,"\u0275inj",t.cJS({providers:[g.uU],imports:[g.ez,l.u5,l.UX,on,d.R,E.dr,F.d,an.X,X.K,tt.TU,K.ZU,Y.A0,$.T,z.Q,s.AV,u.Iq,at]})),n})()},3077:(L,U,_)=>{_.d(U,{T:()=>u,v:()=>s});var a=_(81180),g=_(36895),l=_(94650),A=_(24006),P=_(65131),v=_(89156),t=_(83902);function Z(p,h){if(1&p&&(l.TgZ(0,"span"),l._uU(1),l.qZA()),2&p){const m=l.oxw();l.xp6(1),l.AsE(" Showing ",m.pageData.Filter.PageNumber*m.total-m.total+1," - ",m.pageData.Filter.PageNumber*m.total," ")}}function x(p,h){if(1&p&&(l.TgZ(0,"span"),l._uU(1),l.qZA()),2&p){const m=l.oxw();l.xp6(1),l.AsE(" Showing ",m.pageData.Filter.RowCount*m.pageData.Filter.PageNumber-m.pageData.Filter.RowCount+1," - ",m.pageData.Filter.RowCount*m.pageData.Filter.PageNumber-m.pageData.Filter.RowCount+m.total," ")}}function f(p,h){if(1&p){const m=l.EpF();l.TgZ(0,"span",8),l.NdJ("click",function(){l.CHM(m);const S=l.oxw();return l.KtG(S.StoreRowsCountAPIResult())}),l.TgZ(1,"i",9),l._uU(2,"?"),l.qZA()()}}function b(p,h){if(1&p&&(l.TgZ(0,"span"),l._uU(1),l.ALo(2,"number"),l.qZA()),2&p){const m=l.oxw();l.xp6(1),l.hij(" of ",l.lcZ(2,1,m.listTotal),"")}}function T(p,h){if(1&p){const m=l.EpF();l.TgZ(0,"a",10),l.NdJ("click",function(){l.CHM(m);const S=l.oxw();return l.KtG(S.onPreviousPage())}),l._UZ(1,"i",11),l._uU(2," Previous"),l.qZA()}}function d(p,h){if(1&p){const m=l.EpF();l.TgZ(0,"a",10),l.NdJ("click",function(){l.CHM(m);const S=l.oxw();return l.KtG(S.onNextPage())}),l._UZ(1,"i",12),l._uU(2," Next"),l.qZA()}}let s=(()=>{class p{constructor(m){(0,a.Z)(this,"httpService",void 0),(0,a.Z)(this,"pageData",void 0),(0,a.Z)(this,"total",void 0),(0,a.Z)(this,"api",void 0),(0,a.Z)(this,"jumpToPage",new l.vpe),(0,a.Z)(this,"previousPage",new l.vpe),(0,a.Z)(this,"nextPage",new l.vpe),(0,a.Z)(this,"pageNumber",1),(0,a.Z)(this,"showingNumber",this.pageNumber),(0,a.Z)(this,"listTotal",-1),this.httpService=m}onJumpToPage(m){"Enter"===m.key&&(this.pageData.Filter.PageNumber=this.pageNumber,this.showingNumber=this.pageNumber,this.jumpToPage.emit())}onPreviousPage(){this.pageData.Filter.PageNumber-=1,this.pageNumber=this.pageData.Filter.PageNumber,this.showingNumber=this.pageNumber,this.previousPage.emit()}onNextPage(){this.pageData.Filter.PageNumber+=1,this.pageNumber=this.pageData.Filter.PageNumber,this.showingNumber=this.pageNumber,this.nextPage.emit()}StoreRowsCountAPIResult(){this.httpService.post("/api/"+this.api,JSON.stringify(this.pageData.Filter)).subscribe(m=>{this.listTotal=m.Count?m.Count:m,this.pageData.HideStoreApiCount=!0})}}return(0,a.Z)(p,"\u0275fac",function(m){return new(m||p)(l.Y36(v.O))}),(0,a.Z)(p,"\u0275cmp",l.Xpm({type:p,selectors:[["POS-complex-pagination"]],inputs:{pageData:"pageData",total:"total",api:"api"},outputs:{jumpToPage:"jumpToPage",previousPage:"previousPage",nextPage:"nextPage"},decls:12,vars:7,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[4,"ngIf"],["style","cursor: pointer",3,"click",4,"ngIf"],["type","text","autoNum","",1,"text-end",2,"width","45px",3,"ngModel","keyup","ngModelChange"],[1,"btn-group"],["class","btn btn-outline-secondary btn-sm text-primary",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],[1,"border","p-3"],[1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-left"],[1,"fa-solid","fa-arrow-right"]],template:function(m,C){1&m&&(l.TgZ(0,"div",0)(1,"div",1)(2,"div",2),l.YNc(3,Z,2,2,"span",3),l.YNc(4,x,2,2,"span",3),l.YNc(5,f,3,0,"span",4),l.YNc(6,b,3,3,"span",3),l._uU(7," records ~ Page "),l.TgZ(8,"input",5),l.NdJ("keyup",function(w){return C.onJumpToPage(w)})("ngModelChange",function(w){return C.pageNumber=w}),l.qZA()()(),l.TgZ(9,"div",6),l.YNc(10,T,3,0,"a",7),l.YNc(11,d,3,0,"a",7),l.qZA()()),2&m&&(l.xp6(3),l.Q6J("ngIf",C.pageData.Filter.RowCount==C.total),l.xp6(1),l.Q6J("ngIf",C.pageData.Filter.RowCount!=C.total),l.xp6(1),l.Q6J("ngIf",!C.pageData.HideStoreApiCount),l.xp6(1),l.Q6J("ngIf",C.pageData.HideStoreApiCount),l.xp6(2),l.Q6J("ngModel",C.pageNumber),l.xp6(2),l.Q6J("ngIf",1!=C.pageData.Filter.PageNumber),l.xp6(1),l.Q6J("ngIf",C.total>=C.pageData.Filter.RowCount))},dependencies:[g.O5,A.Fj,A.JJ,A.On,t.b,g.JJ]})),p})(),u=(()=>{class p{}return(0,a.Z)(p,"\u0275fac",function(m){return new(m||p)}),(0,a.Z)(p,"\u0275mod",l.oAB({type:p})),(0,a.Z)(p,"\u0275inj",l.cJS({imports:[g.ez,A.u5,A.UX,P.X]})),p})()},11594:(L,U,_)=>{_.d(U,{K:()=>f,P:()=>x});var a=_(81180),g=_(94650),l=_(10266),A=_(71948),P=_(36895),v=_(24006);const t=function(b,T){return{color:b,"font-weight":T}};function Z(b,T){if(1&b&&(g.TgZ(0,"mat-radio-button",2),g._uU(1),g.qZA()),2&b){const d=T.$implicit,s=T.index,u=g.oxw();g.Akn(g.WLB(7,t,u.model==d.Key&&u.activeBold?"#0976b4":"",u.model==d.Key&&u.activeBold?"700":"")),g.Q6J("disabled",u.exception==d.Value)("matTooltip",u.title.length>0?u.title[s]:"")("value",d.Key)("name",u.name),g.xp6(1),g.hij("",d.Value," ")}}let x=(()=>{class b{constructor(){(0,a.Z)(this,"model",void 0),(0,a.Z)(this,"disabled",void 0),(0,a.Z)(this,"modelChange",new g.vpe),(0,a.Z)(this,"options",[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}]),(0,a.Z)(this,"border",!1),(0,a.Z)(this,"name",void 0),(0,a.Z)(this,"title",[]),(0,a.Z)(this,"exception",void 0),(0,a.Z)(this,"activeBold",void 0)}change(d){this.modelChange.emit(d)}}return(0,a.Z)(b,"\u0275fac",function(d){return new(d||b)}),(0,a.Z)(b,"\u0275cmp",g.Xpm({type:b,selectors:[["radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"disabled","ngModel","ngModelChange"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(d,s){1&d&&(g.TgZ(0,"mat-radio-group",0),g.NdJ("ngModelChange",function(p){return s.change(p)}),g.YNc(1,Z,2,10,"mat-radio-button",1),g.qZA()),2&d&&(g.Q6J("disabled",s.disabled)("ngModel",s.model),g.xp6(1),g.Q6J("ngForOf",s.options))},dependencies:[A.VQ,A.U0,P.sg,v.JJ,v.On,l.gM],styles:[".mat-mdc-radio-button .mdc-radio{padding:8px;margin:0}.mat-mdc-radio-button .mdc-radio .mdc-radio__background:before{top:-8px;left:-8px;width:36px;height:36px}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:0;right:0;left:0;width:36px;height:36px}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:#0976b4!important}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{background-color:#0976b4!important;border-color:#0976b4!important}\n"],encapsulation:2})),b})(),f=(()=>{class b{}return(0,a.Z)(b,"\u0275fac",function(d){return new(d||b)}),(0,a.Z)(b,"\u0275mod",g.oAB({type:b})),(0,a.Z)(b,"\u0275inj",g.cJS({imports:[A.Fk,P.ez,v.u5,l.AV]})),b})()},64425:(L,U,_)=>{_.d(U,{Iq:()=>t,TU:()=>A,i3:()=>v});var a=_(36895),g=_(94650);class l{constructor(x,f){this._document=f;const b=this._textarea=this._document.createElement("textarea"),T=b.style;T.position="fixed",T.top=T.opacity="0",T.left="-999em",b.setAttribute("aria-hidden","true"),b.value=x,b.readOnly=!0,this._document.body.appendChild(b)}copy(){const x=this._textarea;let f=!1;try{if(x){const b=this._document.activeElement;x.select(),x.setSelectionRange(0,x.value.length),f=this._document.execCommand("copy"),b&&b.focus()}}catch{}return f}destroy(){const x=this._textarea;x&&(x.remove(),this._textarea=void 0)}}let A=(()=>{class Z{constructor(f){this._document=f}copy(f){const b=this.beginCopy(f),T=b.copy();return b.destroy(),T}beginCopy(f){return new l(f,this._document)}}return Z.\u0275fac=function(f){return new(f||Z)(g.LFG(a.K0))},Z.\u0275prov=g.Yz7({token:Z,factory:Z.\u0275fac,providedIn:"root"}),Z})();const P=new g.OlP("CDK_COPY_TO_CLIPBOARD_CONFIG");let v=(()=>{class Z{constructor(f,b,T){this._clipboard=f,this._ngZone=b,this.text="",this.attempts=1,this.copied=new g.vpe,this._pending=new Set,T&&null!=T.attempts&&(this.attempts=T.attempts)}copy(f=this.attempts){if(f>1){let b=f;const T=this._clipboard.beginCopy(this.text);this._pending.add(T);const d=()=>{const s=T.copy();s||!--b||this._destroyed?(this._currentTimeout=null,this._pending.delete(T),T.destroy(),this.copied.emit(s)):this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(d,1))};d()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(f=>f.destroy()),this._pending.clear(),this._destroyed=!0}}return Z.\u0275fac=function(f){return new(f||Z)(g.Y36(A),g.Y36(g.R0b),g.Y36(P,8))},Z.\u0275dir=g.lG2({type:Z,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(f,b){1&f&&g.NdJ("click",function(){return b.copy()})},inputs:{text:["cdkCopyToClipboard","text"],attempts:["cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"}}),Z})(),t=(()=>{class Z{}return Z.\u0275fac=function(f){return new(f||Z)},Z.\u0275mod=g.oAB({type:Z}),Z.\u0275inj=g.cJS({}),Z})()},95017:(L,U,_)=>{_.d(U,{A8:()=>b,Ov:()=>x,Z9:()=>P,eX:()=>Z,k:()=>T,yy:()=>t});var a=_(94033),g=_(77579),l=_(94650);function P(d){return d&&"function"==typeof d.connect&&!(d instanceof a.c)}class t{applyChanges(s,u,p,h,m){s.forEachOperation((C,S,w)=>{let N,q;if(null==C.previousIndex){const J=p(C,S,w);N=u.createEmbeddedView(J.templateRef,J.context,J.index),q=1}else null==w?(u.remove(S),q=3):(N=u.get(S),u.move(N,w),q=2);m&&m({context:N?.context,operation:q,record:C})})}detach(){}}class Z{constructor(){this.viewCacheSize=20,this._viewCache=[]}applyChanges(s,u,p,h,m){s.forEachOperation((C,S,w)=>{let N,q;null==C.previousIndex?(N=this._insertView(()=>p(C,S,w),w,u,h(C)),q=N?1:0):null==w?(this._detachAndCacheView(S,u),q=3):(N=this._moveView(S,w,u,h(C)),q=2),m&&m({context:N?.context,operation:q,record:C})})}detach(){for(const s of this._viewCache)s.destroy();this._viewCache=[]}_insertView(s,u,p,h){const m=this._insertViewFromCache(u,p);if(m)return void(m.context.$implicit=h);const C=s();return p.createEmbeddedView(C.templateRef,C.context,C.index)}_detachAndCacheView(s,u){const p=u.detach(s);this._maybeCacheView(p,u)}_moveView(s,u,p,h){const m=p.get(s);return p.move(m,u),m.context.$implicit=h,m}_maybeCacheView(s,u){if(this._viewCache.length<this.viewCacheSize)this._viewCache.push(s);else{const p=u.indexOf(s);-1===p?s.destroy():u.remove(p)}}_insertViewFromCache(s,u){const p=this._viewCache.pop();return p&&u.insert(p,s),p||null}}class x{get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}constructor(s=!1,u,p=!0,h){this._multiple=s,this._emitChanges=p,this.compareWith=h,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new g.x,u&&u.length&&(s?u.forEach(m=>this._markSelected(m)):this._markSelected(u[0]),this._selectedToEmit.length=0)}select(...s){this._verifyValueAssignment(s),s.forEach(p=>this._markSelected(p));const u=this._hasQueuedChanges();return this._emitChangeEvent(),u}deselect(...s){this._verifyValueAssignment(s),s.forEach(p=>this._unmarkSelected(p));const u=this._hasQueuedChanges();return this._emitChangeEvent(),u}setSelection(...s){this._verifyValueAssignment(s);const u=this.selected,p=new Set(s);s.forEach(m=>this._markSelected(m)),u.filter(m=>!p.has(m)).forEach(m=>this._unmarkSelected(m));const h=this._hasQueuedChanges();return this._emitChangeEvent(),h}toggle(s){return this.isSelected(s)?this.deselect(s):this.select(s)}clear(s=!0){this._unmarkAll();const u=this._hasQueuedChanges();return s&&this._emitChangeEvent(),u}isSelected(s){return this._selection.has(this._getConcreteValue(s))}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(s){this._multiple&&this.selected&&this._selected.sort(s)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(s){s=this._getConcreteValue(s),this.isSelected(s)||(this._multiple||this._unmarkAll(),this.isSelected(s)||this._selection.add(s),this._emitChanges&&this._selectedToEmit.push(s))}_unmarkSelected(s){s=this._getConcreteValue(s),this.isSelected(s)&&(this._selection.delete(s),this._emitChanges&&this._deselectedToEmit.push(s))}_unmarkAll(){this.isEmpty()||this._selection.forEach(s=>this._unmarkSelected(s))}_verifyValueAssignment(s){}_hasQueuedChanges(){return!(!this._deselectedToEmit.length&&!this._selectedToEmit.length)}_getConcreteValue(s){if(this.compareWith){for(let u of this._selection)if(this.compareWith(s,u))return u;return s}return s}}let b=(()=>{class d{constructor(){this._listeners=[]}notify(u,p){for(let h of this._listeners)h(u,p)}listen(u){return this._listeners.push(u),()=>{this._listeners=this._listeners.filter(p=>u!==p)}}ngOnDestroy(){this._listeners=[]}}return d.\u0275fac=function(u){return new(u||d)},d.\u0275prov=l.Yz7({token:d,factory:d.\u0275fac,providedIn:"root"}),d})();const T=new l.OlP("_ViewRepeater")}}]);
|