dealposbooks 5.50.0 → 5.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/3rdpartylicenses.txt +10 -10
  2. package/chunk-2RXAK5B6.js +8 -0
  3. package/chunk-2U3PIWWJ.js +1 -0
  4. package/chunk-32QC4JFI.js +202 -0
  5. package/{chunk-KZU3VXLG.js → chunk-3O7NQ6AZ.js} +1 -1
  6. package/{chunk-PB2MFYIM.js → chunk-3RODMLL2.js} +1 -1
  7. package/chunk-4GZGUASQ.js +1 -0
  8. package/chunk-52EMI2TW.js +803 -0
  9. package/{chunk-DAM2WKDY.js → chunk-52PEVPZN.js} +1 -1
  10. package/{chunk-65V5R4TS.js → chunk-5XVZW6BJ.js} +1 -1
  11. package/chunk-7ET5ZE2L.js +1 -0
  12. package/chunk-7F5JJ627.js +129 -0
  13. package/chunk-7GORVGAV.js +1 -0
  14. package/chunk-AAKZYXG3.js +145 -0
  15. package/{chunk-3ALAWCRA.js → chunk-B7TGZ7J3.js} +1 -1
  16. package/{chunk-DM45YT57.js → chunk-BT4SLG45.js} +1 -1
  17. package/{chunk-IMPGOCFC.js → chunk-BVHTVDYP.js} +1 -1
  18. package/chunk-CPAPQNFC.js +1 -0
  19. package/{chunk-RBNXJUFM.js → chunk-D5WBKKO2.js} +1 -1
  20. package/{chunk-VNZUZ5UI.js → chunk-DAN3PD7R.js} +1 -1
  21. package/chunk-DM42MH3E.js +1 -0
  22. package/chunk-E57RWXDG.js +1 -0
  23. package/{chunk-GU4FXUJC.js → chunk-EDYUAYO2.js} +1 -1
  24. package/{chunk-SX4XIR77.js → chunk-ELZ5FFFM.js} +1 -1
  25. package/{chunk-Z4XRTHAH.js → chunk-F4PHXCVU.js} +1 -1
  26. package/{chunk-TOR7QRRB.js → chunk-G3BJCT7T.js} +1 -1
  27. package/{chunk-XGU6GBEK.js → chunk-GEYRJ2MR.js} +1 -1
  28. package/{chunk-KXW5NWRO.js → chunk-GN7VAGHH.js} +1 -1
  29. package/{chunk-2JFOEOZ2.js → chunk-GQ7SPEZH.js} +1 -1
  30. package/{chunk-ON7PMYMV.js → chunk-H7YYGW7V.js} +1 -1
  31. package/{chunk-XULSWUMO.js → chunk-HYOAHRKW.js} +1 -1
  32. package/chunk-ILQI2X5T.js +1 -0
  33. package/{chunk-A6T2KR7U.js → chunk-J346SEEU.js} +1 -1
  34. package/{chunk-YQYRAH7V.js → chunk-JBYPGHPN.js} +1 -1
  35. package/{chunk-J3HFAWXU.js → chunk-JPKZVL57.js} +1 -1
  36. package/{chunk-LBXNL7E4.js → chunk-JPNJTPYJ.js} +1 -1
  37. package/{chunk-BB2CNXSH.js → chunk-KBJ25I3J.js} +1 -1
  38. package/chunk-KJM3M7Y3.js +1 -0
  39. package/chunk-KU4BYYJE.js +1 -0
  40. package/{chunk-SXNOZOOP.js → chunk-KXWAD3X4.js} +1 -1
  41. package/chunk-L27GCER2.js +160 -0
  42. package/chunk-LF4HTMCE.js +1 -0
  43. package/chunk-MCR6MBS2.js +1 -0
  44. package/{chunk-ZC2ADHDH.js → chunk-MHM3ED4J.js} +1 -1
  45. package/chunk-MWRTPPEI.js +1 -0
  46. package/chunk-NSMNMKCV.js +1 -0
  47. package/{chunk-VKUW7E75.js → chunk-NTVIX4GB.js} +1 -1
  48. package/{chunk-SJOOTBQ5.js → chunk-OILVKUFA.js} +1 -1
  49. package/chunk-OKT36WED.js +1 -0
  50. package/{chunk-KORGIX2B.js → chunk-OOCLTY27.js} +1 -1
  51. package/{chunk-ZAMQ4RCL.js → chunk-QCGJB7O7.js} +1 -1
  52. package/chunk-QSIXT7W7.js +7 -0
  53. package/{chunk-GAXDMEOS.js → chunk-QXE4YYQV.js} +1 -1
  54. package/{chunk-3GYSEQ25.js → chunk-R45WWOYD.js} +1 -1
  55. package/chunk-RFHL2MJ4.js +1 -0
  56. package/{chunk-7DBOORB2.js → chunk-RGVP7KT4.js} +1 -1
  57. package/{chunk-4AGTFPOU.js → chunk-SOD2BIQR.js} +1 -1
  58. package/chunk-TOAH3PY3.js +1 -0
  59. package/{chunk-56CZGYL5.js → chunk-V6BSLJMN.js} +1 -1
  60. package/{chunk-NHW7GVHK.js → chunk-VABCBO2E.js} +1 -1
  61. package/{chunk-RVUOVLL5.js → chunk-VQ62YSFR.js} +1 -1
  62. package/{chunk-4IMFKRR6.js → chunk-WPHZJHC6.js} +1 -1
  63. package/{chunk-SOYJAYJK.js → chunk-YKZN6T5N.js} +1 -1
  64. package/chunk-YMV3SC73.js +1 -0
  65. package/{chunk-DAFEIZYQ.js → chunk-ZLBNHUZF.js} +1 -1
  66. package/{chunk-YU4Q7ASX.js → chunk-ZOMQLK4A.js} +1 -1
  67. package/index.html +2 -2
  68. package/{main-UCTZ3G6L.js → main-ET3JU27S.js} +1 -1
  69. package/package.json +1 -1
  70. package/chunk-27SC6O47.js +0 -1
  71. package/chunk-47G2N7SA.js +0 -1
  72. package/chunk-4RBG4SFN.js +0 -1
  73. package/chunk-5N5QHECN.js +0 -1
  74. package/chunk-6GO647AV.js +0 -1
  75. package/chunk-AF6G72MJ.js +0 -1
  76. package/chunk-BOQI2TMP.js +0 -8
  77. package/chunk-BTFX33U6.js +0 -947
  78. package/chunk-COSMZ2AH.js +0 -1
  79. package/chunk-FHXTQXB7.js +0 -160
  80. package/chunk-HQHEWKLC.js +0 -1
  81. package/chunk-I2OULINE.js +0 -1
  82. package/chunk-JERRSTLA.js +0 -1
  83. package/chunk-OOCCZG53.js +0 -129
  84. package/chunk-SASRJPT7.js +0 -1
  85. package/chunk-URGN4QVD.js +0 -1
  86. package/chunk-UTOLWW4T.js +0 -1
  87. package/chunk-VJROOSEO.js +0 -7
  88. package/chunk-WYLIU52Q.js +0 -1
  89. package/chunk-XN4CDKDI.js +0 -1
  90. package/chunk-Z3ZKNQZS.js +0 -1
  91. package/chunk-ZWNKUBMG.js +0 -202
@@ -142,6 +142,16 @@ Package: @dealpos-npm/ng-dealpos-library
142
142
  License: "ISC"
143
143
 
144
144
 
145
+ --------------------------------------------------------------------------------
146
+ Package: @maskito/core
147
+ License: "Apache-2.0"
148
+
149
+
150
+ --------------------------------------------------------------------------------
151
+ Package: @maskito/kit
152
+ License: "Apache-2.0"
153
+
154
+
145
155
  --------------------------------------------------------------------------------
146
156
  Package: uuid
147
157
  License: "MIT"
@@ -156,16 +166,6 @@ The above copyright notice and this permission notice shall be included in all c
156
166
 
157
167
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
158
168
 
159
- --------------------------------------------------------------------------------
160
- Package: @maskito/core
161
- License: "Apache-2.0"
162
-
163
-
164
- --------------------------------------------------------------------------------
165
- Package: @maskito/kit
166
- License: "Apache-2.0"
167
-
168
-
169
169
  --------------------------------------------------------------------------------
170
170
  Package: @angular/platform-browser
171
171
  License: "MIT"
@@ -0,0 +1,8 @@
1
+ import{a as Oe,b as je,c as Je,d as ze}from"./chunk-SLD7RSX6.js";import{a as Ue,b as He}from"./chunk-GIRWHO6Q.js";import{a as Ge}from"./chunk-SVGPDGYN.js";import{a as v}from"./chunk-52PEVPZN.js";import{b as Ne}from"./chunk-JPNJTPYJ.js";import"./chunk-ZC7ZENN7.js";import{m as J}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{b as Pe,g as Ve,h as Be,i as Q}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import{a as Ie,b as Me}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as Re}from"./chunk-BT7Y4ADP.js";import{a as De,b as Ee}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{b as ke}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as S}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as I,b as M}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{n as q,o as E,w as k,x as K}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{Ia as D,b as T,c as ce,e as A,f as z,j as we,m as U,n as Te,o as Ae,p as H,v as W,x as $,y as L}from"./chunk-MGIEURA2.js";import{b as ve}from"./chunk-DZCJWJUG.js";import"./chunk-VQ62YSFR.js";import{a as ye}from"./chunk-G3BJCT7T.js";import{a as Fe}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as ge,l as xe,m as be,s as Se,u as w}from"./chunk-DM2JLWKE.js";import{Dc as j,Eb as d,Ec as oe,Fc as ie,Ha as B,L as pe,Mb as f,Oc as re,Pb as ne,Pc as ae,Rb as y,Sb as fe,Sc as u,Ub as he,Vb as _e,Wb as i,Xb as r,Yb as C,Z as de,_ as V,ac as g,bd as le,ca as ue,fc as x,g as me,gc as l,ia as p,ib as s,ob as te,qa as h,ra as _,s as se,sc as a,tc as Ce,uc as F,xc as N,yb as b,yc as G,zc as O}from"./chunk-6QJHEOXN.js";import{a as R,b as P}from"./chunk-YQFG5XE2.js";var it=()=>({height:"cacl(100vh - 200px)"}),rt=()=>({height:"calc(100vh - 250px)"});function at(t,c){if(t&1){let e=g();i(0,"p-button",6),x("onClick",function(){h(e);let o=l(2);return _(o.submitForm())}),r()}}function lt(t,c){if(t&1&&(i(0,"div"),d(1,at,1,0,"p-button",5),r()),t&2){let e=l();s(),y(e.roleService.permissions().accountingSetup.create?1:-1)}}function ct(t,c){t&1&&(i(0,"div",18)(1,"h3",19),a(2,"Date"),r(),C(3,"p-datePicker",20),r())}function mt(t,c){if(t&1&&(i(0,"tr",10)(1,"td",28),a(2),r(),i(3,"td"),C(4,"input",29),r(),i(5,"td"),C(6,"input",30),r()()),t&2){let e,n=c.$implicit,o=c.index,m=l(4);f("formGroupName",o),s(2),F(" ",(e=m.asFormGroup(n).get("accountName"))==null?null:e.value," ")}}function st(t,c){if(t&1&&(i(0,"div",10)(1,"h4",21),a(2),r(),i(3,"div",22)(4,"table",23)(5,"thead",24)(6,"tr")(7,"th",25),a(8,"Account Name"),r(),i(9,"th",26),a(10,"Debit"),r(),i(11,"th",26),a(12,"Credit"),r()()(),i(13,"tbody"),d(14,mt,7,2,"tr",27),r()()()()),t&2){let e=c.$implicit,n=c.$index,o=l(3);f("formGroupName",n),s(2),F(" ",e.get("name").value," "),s(12),f("ngForOf",o.getItemsArray(o.asFormGroup(e)).controls)}}function pt(t,c){if(t&1&&(i(0,"p-panel",8),d(1,ct,4,0,"ng-template",null,2,u),C(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",9),he(6,st,15,3,"div",10,fe),r()(),i(8,"div",11)(9,"table",12)(10,"tr")(11,"td",13)(12,"p",14),a(13," Total: "),r()(),i(14,"td",15)(15,"p",16),a(16),re(17,"number"),r()(),i(18,"td",17)(19,"p",16),a(20),re(21,"number"),r()()()()()()),t&2){let e=l(2);ne(oe(11,it)),f("formGroup",e.formGroups),s(4),ne(oe(12,rt)),s(2),_e(e.formsArray.controls),s(10),F(" ",ae(17,7,e.subtotalDebit)," "),s(4),F(" ",ae(21,9,e.subtotalCredit)," ")}}function dt(t,c){if(t&1&&d(0,pt,22,13,"p-panel",7),t&2){let e=l();f("ngIf",e.formGroups)}}var Le=(()=>{class t{constructor(){this.destroy$=new me,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=p(W),this.accSetupService=p(v),this.dayjsService=p(Ne),this.date=new Date,this.routes=p(ve),this.roleService=p(J)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(pe(300),de(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let n=e.map(o=>this.createItemGroup(o));return this.fb.array(n)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(se(e=>e.data),Re("response"),V(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(o=>o.items&&o.items.length>0).forEach(o=>{this.formsArray.push(this.createFormGroup(o))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(n=>{let o=this.getItemsArray(n),m=o.controls.reduce((Y,Z)=>{let ee=Z.get("debitAmount").value||0;return Y+ee},0),tt=o.controls.reduce((Y,Z)=>{let ee=Z.get("creditAmount").value||0;return Y+ee},0);this.subtotalDebit+=m,this.subtotalCredit+=tt})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((n,[o,m])=>(o==="date"?n[o]=m instanceof Date?this.dayjsService.format(m):m:o==="forms"?n.form=m:n[o]=m,n),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-acc-opening-balance-form"]],features:[j([D])],decls:6,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Opening Balance Form",3,"scrollable"],["preventOpenDuplicates",""],["label","Submit"],["label","Submit",3,"onClick"],[3,"formGroup","style",4,"ngIf"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[2,"position","fixed","bottom","0","left","241px",`/* offset from the left edge (assuming 250px sidebar) */
2
+ width`,`calc(
3
+ 100% - 243px
4
+ )`,`/* adjust width to fit the remaining space */
5
+ z-index`,"91","background-color","white",`/* added background */
6
+ /* box-shadow`,"0 -2px 5px rgba(0, 0, 0, 0.1)",`*/ /* added subtle shadow */
7
+ padding`,"8px 0",`/* added padding for height */
8
+ border-top`,"1px solid #e0e0e0"],[1,"w-100","px-4"],[1,"ps-5"],[1,"fw-semibold","fs-4","m-0","text-end",2,"margin-right","10px !important"],[1,"",2,"width","200px"],[1,"fw-semibold","fs-4","m-0","text-start"],[1,"pe-5",2,"width","200px"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["formControlName","date"],[1,"fs-4"],["formArrayName","items"],[1,"table"],[1,"table-secondary"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],[3,"formGroupName",4,"ngFor","ngForOf"],[1,"fs-3","text-dark"],["appMaskNumber","","formControlName","debitAmount",1,"fs-3","form-control","text-dark"],["appMaskNumber","","formControlName","creditAmount",1,"fs-3","form-control","text-dark"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),d(1,lt,2,1,"ng-template",null,0,u)(3,dt,1,1,"ng-template",null,1,u),r(),C(5,"p-toast",4)),n&2&&f("scrollable",!0)},dependencies:[S,ke,w,xe,be,Se,Me,Ie,Q,Ee,De,$,T,A,z,E,Je,K,k,M,I,Ge,L,U,H,Te,Ae,He,Ue],styles:["[_nghost-%COMP%]{display:block} .table thead tr th{border:none}"],changeDetection:0})}}return t})();var qe=t=>({"ng-invalid ng-dirty":t});function ft(t,c){if(t&1){let e=g();i(0,"p-button",4),x("onClick",function(){h(e);let o=l();return _(o.verifyCredentials())}),a(1,"Verify"),r(),i(2,"p-button",4),x("onClick",function(){h(e);let o=l();return _(o.saveCredentials())}),a(3,"Update"),r()}}function ht(t,c){t&1&&(i(0,"div",12)(1,"h3",13),a(2,"Account"),r(),i(3,"small",14),a(4,"Configure Client ID and Client Secret"),r()())}function _t(t,c){if(t&1&&(i(0,"div",5)(1,"p-panel"),d(2,ht,5,0,"ng-template",null,2,u),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),a(8,"Client ID"),r(),C(9,"input",10),r()(),i(10,"div",7)(11,"div",8)(12,"label",9),a(13,"Client Secret"),r(),C(14,"input",11),r()()()()()),t&2){let e=l();s(4),f("formGroup",e.credentialForm),s(5),f("ngClass",ie(3,qe,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),s(5),f("ngClass",ie(5,qe,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var Ke=(()=>{class t{constructor(e,n){this.fb=e,this.messageService=n,this.setupService=p(v)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(V(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[ce.required]],clientSecret:["",[ce.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}verifyCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Verifying credentials:",e),this.setupService.verifyAPICredential(e).subscribe({next:n=>{console.log("Verify result:",n),this.messageService.add({severity:"success",summary:"Verified",detail:"Credentials are valid!"})},error:n=>{console.error("Verify failed:",n),this.messageService.add({severity:"error",summary:"Invalid",detail:"Client ID or Secret is wrong!"})}})}static{this.\u0275fac=function(n){return new(n||t)(te(W),te(D))}}static{this.\u0275cmp=b({type:t,selectors:[["app-api-credential"]],features:[j([D])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),d(1,ft,4,0,"ng-template",null,0,u)(3,_t,15,7,"ng-template",null,1,u),r())},dependencies:[w,ge,L,T,A,z,U,H,E,q,M,I,S,K,k,ze],encapsulation:2})}}return t})();function Ct(t,c){if(t&1){let e=g();i(0,"button",5),x("click",function(){h(e);let o=l(2);return _(o.onFormatJournal())}),a(1," Format "),r()}}function gt(t,c){if(t&1&&d(0,Ct,2,0,"button",4),t&2){let e=l();y(e.roleService.permissions().accountingSetup.delete?0:-1)}}function xt(t,c){t&1&&(i(0,"div",13)(1,"div",14)(2,"h4",15),a(3,"Journal Configuration"),r(),i(4,"small",16),a(5," Enter your account information to format journal entries "),r()()())}function bt(t,c){if(t&1){let e=g();i(0,"div",6)(1,"p-panel"),d(2,xt,6,0,"ng-template",null,2,u),i(4,"div",7)(5,"div",8)(6,"p-floatlabel",9)(7,"input",10),O("ngModelChange",function(o){h(e);let m=l();return G(m.subdomain,o)||(m.subdomain=o),_(o)}),r(),i(8,"label",11),a(9,"Subdomain"),r()(),i(10,"small",12),a(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),r()()()()()}if(t&2){let e=l();s(7),N("ngModel",e.subdomain)}}var Qe=(()=>{class t{constructor(){this.setupService=p(v),this.subdomain=B(""),this.toastrService=p(Fe),this.roleService=p(J)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(n,o){n&1&&(i(0,"app-main-panel",3),d(1,gt,1,1,"ng-template",null,0,u)(3,bt,12,1,"ng-template",null,1,u),r())},dependencies:[w,$,T,A,we,E,q,S,M,I,je,Oe],encapsulation:2})}}return t})();var Xe=()=>p(v).fetchOpeningBalanceFormConfiguration();var Ye=(()=>{class t{constructor(){this._httpService=p(ye)}flushCache(e){e.forEach(n=>{this.flushCacheByEndPoint(n.endPoint)})}flushCacheByEndPoint(e){this._httpService.delete("","/api/FlushCache"+e).subscribe(()=>{console.log(`Cache flushed for endpoint: ${e}`)})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ze=[{endPoint:"/AccessToken",label:"Access Token",description:"Remove token pos in Books",checked:!1},{endPoint:"/Outlet",label:"Outlets",description:"Remove cached for update outlets",checked:!1},{endPoint:"/Payment",label:"Payment Method",description:"Remove cached for payment method",checked:!1},{endPoint:"/Tax",label:"Tax Type",description:"Remove cached for tax type",checked:!1},{endPoint:"/WriteOff",label:"Write Off",description:"Remove cached for write off",checked:!1}];function St(t,c){if(t&1){let e=g();i(0,"div",5)(1,"p-button",6),x("onClick",function(){h(e);let o=l(2);return _(o.onFlushCached())}),r()()}}function vt(t,c){if(t&1&&d(0,St,2,0,"div",5),t&2){let e=l();y(e.isAnyCacheSelected?0:-1)}}function Ft(t,c){t&1&&(i(0,"tr")(1,"th",8),C(2,"p-tableHeaderCheckbox"),r(),i(3,"th"),a(4,"Cache"),r(),i(5,"th"),a(6,"Description"),r()())}function yt(t,c){if(t&1&&(i(0,"tr")(1,"td"),C(2,"p-tableCheckbox",9),r(),i(3,"td"),a(4),r(),i(5,"td"),a(6),r()()),t&2){let e=c.$implicit;s(2),f("value",e),s(2),F(" ",e.label," "),s(2),Ce(e.description)}}function wt(t,c){if(t&1){let e=g();i(0,"p-table",7),x("onRowSelect",function(o){h(e);let m=l();return _(m.onRowSelect(o))})("onRowUnselect",function(o){h(e);let m=l();return _(m.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){h(e);let m=l();return _(m.onHeaderCheckboxToggle(o))}),O("selectionChange",function(o){h(e);let m=l();return G(m.selectedRows,o)||(m.selectedRows=o),_(o)}),d(1,Ft,7,0,"ng-template",null,2,u)(3,yt,7,3,"ng-template",null,3,u),r()}if(t&2){let e=l();f("value",e.cachedData)("totalRecords",e.cachedData.length)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0),N("selection",e.selectedRows)}}var et=(()=>{class t{constructor(){this.flushCachedService=p(Ye),this.cachedData=Ze,this.selectedRows=[],this.params=B({pageNumber:1,pageSize:100}),this.first=le(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=le(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.cachedData.length||100))}onRowSelect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!0)}updateCheckedRows(e,n){this.cachedData=this.cachedData.map(o=>e.includes(o.endPoint)?P(R({},o),{checked:n}):o),this.selectedRows=this.cachedData.filter(o=>o.checked)}onRowUnselect(e){if(Array.isArray(e.data))return;let n=e.data;n?.endPoint&&this.updateCheckedRows([n.endPoint],!1)}onHeaderCheckboxToggle(e){this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:e.checked})),this.selectedRows=e.checked?[...this.cachedData]:[]}onFlushCached(){let e=this.cachedData.filter(n=>n.checked);this.flushCachedService.flushCache(e),this.cachedData=this.cachedData.map(n=>P(R({},n),{checked:!1})),this.selectedRows=[]}get isAnyCacheSelected(){return this.cachedData.some(e=>e.checked)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-flush-cached"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Flush Cache",3,"overflowScroll","showCancelButton"],[1,"d-flex","gap-2"],["label","Flush Cache",3,"onClick"],["dataKey","endPoint","selectionMode","multiple","styleClass","d-flex flex-column justify-content-between h-100",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","selectionChange","value","totalRecords","lazy","rows","scrollable","selection"],[2,"width","1rem"],[3,"value"]],template:function(n,o){n&1&&(i(0,"app-main-panel",4),d(1,vt,1,1,"ng-template",null,0,u)(3,wt,5,6,"ng-template",null,1,u),r()),n&2&&f("overflowScroll",!0)("showCancelButton",!1)},dependencies:[S,Q,Pe,Ve,Be,k],encapsulation:2})}}return t})();var Qn=[{path:"",redirectTo:"timezone",pathMatch:"full"},{path:"",children:[{path:"timezone",loadComponent:()=>import("./chunk-F4PHXCVU.js").then(t=>t.TimezoneComponent)},{path:"journal-tag",loadComponent:()=>import("./chunk-NSMNMKCV.js").then(t=>t.JournalTagComponent)},{path:"journal-tag/info",loadComponent:()=>import("./chunk-OILVKUFA.js").then(t=>t.JournalTagInfoComponent)},{path:"journal-tag/form",loadComponent:()=>import("./chunk-MCR6MBS2.js").then(t=>t.JournalTagFormComponent)},{path:"journal-number",loadComponent:()=>import("./chunk-RFHL2MJ4.js").then(t=>t.JournalNumberComponent)},{path:"advanced",loadComponent:()=>import("./chunk-7GORVGAV.js").then(t=>t.AdvancedComponent)},{path:"opening-balance-form",component:Le,resolve:{data:Xe}},{path:"api-crendetial",component:Ke},{path:"flush-cached",component:et},{path:"format-journal",component:Qe},{path:"closing-entries",loadComponent:()=>import("./chunk-KU4BYYJE.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-ZLBNHUZF.js").then(t=>t.ClosingFormComponent)}]}];export{Qn as ACCOUNTING_SETUP_ROUTES};
@@ -0,0 +1 @@
1
+ import{a as D}from"./chunk-WPHZJHC6.js";import{a as Pe}from"./chunk-SVGPDGYN.js";import{a as it}from"./chunk-YHLRDTIS.js";import{a as Ue,b as He}from"./chunk-LO4HJ77Y.js";import{a as te}from"./chunk-GQ7SPEZH.js";import{b as R}from"./chunk-JPNJTPYJ.js";import{a as Me}from"./chunk-XKI7WLHE.js";import{a as Ge,b as Be}from"./chunk-KQZMRRMA.js";import"./chunk-ZC7ZENN7.js";import"./chunk-WL6ZZCYW.js";import{a as z,b as j}from"./chunk-3VQUNDVT.js";import{b as ke,g as Je,h as Ne,i as Re}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import{a as Ee,b as Te}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as Ve}from"./chunk-BT7Y4ADP.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as Fe,b as De}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as Ie}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as _e,b as ge}from"./chunk-ISIYG4D5.js";import{a as xe,b as y,c as Ce,d as be,e as ve,f as ye,g as we,h as tt}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{n as ce,o as de,w as ue,x as fe,y as he,z as Se}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{b as ie,c as ne,e as oe,f as re,k as le,m as ae,p as pe,v as me,y as se}from"./chunk-MGIEURA2.js";import"./chunk-DZCJWJUG.js";import"./chunk-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as $,l as Q,m as X,p as et,r as Y,s as Z,u as ee}from"./chunk-DM2JLWKE.js";import{Cb as L,Dc as q,Eb as g,Fc as V,Ha as J,Mb as s,Oc as w,Pc as N,Qc as F,Sc as b,Wb as l,Xb as o,Y as M,Yb as h,_ as G,ac as E,bd as I,c as B,eb as U,fc as T,gc as _,ia as v,ib as a,qa as S,ra as x,s as O,sc as m,tc as C,ua as Ze,uc as k,wc as A,xc as W,yb as H,yc as P,zc as K}from"./chunk-6QJHEOXN.js";import{a as c,b as d}from"./chunk-YQFG5XE2.js";var gt={data:{data:[],totalCount:0},meta:{options:{outlets:[],paymentStates:[],deliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:0,from:null,to:null,customerID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},Ke=Ce(we(gt),be(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedInvoice:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ye(t=>{let p=v(D),e=v(R);return{updateFilter(n){y(t,i=>d(c({},i),{filter:c(c({},i.filter),n),skipRequestFirst:!1}))},onRowSelect(n){y(t,i=>{let f=i.data.data.map(u=>u.id===n.id?d(c({},u),{checked:!0}):u);return d(c({},i),{data:d(c({},i.data),{data:f})})})},onRowUnselect(n){y(t,i=>{let f=i.data.data.map(u=>u.id===n.id?d(c({},u),{checked:!1}):u);return d(c({},i),{data:d(c({},i.data),{data:f})})})},onHeaderCheckboxToggle(n){y(t,i=>{let f=i.data.data.map(u=>d(c({},u),{checked:n}));return d(c({},i),{data:d(c({},i.data),{data:f})})})},getCustomerInvoice:z(B(O(n=>Object.entries(n).reduce((i,[f,u])=>(u!=null&&(i[f]=u),i),{})),M(n=>p.getJournalInvoice(n).pipe(O(i=>d(c({},i),{data:i.data.map(f=>d(c({},f),{due:e.from(f.due)?e.from(f.due).format():null,checked:!1}))})),Ve("getCustomerInvoice"),j({next:i=>{y(t,f=>d(c({},f),{data:d(c({},f.data),{data:i.data,totalCount:i.totalCount})}))},error:i=>{console.error("Error fetching customer invoice:",i)}}))))),getCustomerInvoiceLoader:z(B(M(()=>p.getJournalInvoiceLoader().pipe(j({next:n=>{y(t,i=>d(c({},i),{meta:n}))},error:n=>{console.error("Error fetching customer invoice loader:",n)}})))))}}),ve(t=>({onInit:()=>{t.getCustomerInvoiceLoader(),t.getCustomerInvoice(t.filter)}})));var qe=t=>({"ng-invalid ng-dirty":t});function xt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){S(e);let n=_(2);return x(n.onGenerateJournal())}),o()}}function Ct(t,p){if(t&1&&g(0,xt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function bt(t,p){t&1&&(l(0,"tr")(1,"th",12),h(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Number"),o(),l(5,"th",14),m(6,"Customer"),o(),l(7,"th",15),m(8,"Date"),o(),l(9,"th",15),m(10,"Due"),o(),l(11,"th",16),m(12,"Amount"),o(),l(13,"th",17),m(14,"Payment"),o(),l(15,"th",17),m(16,"Delivery"),o(),h(17,"th",18),o())}function vt(t,p){if(t&1&&(l(0,"tr")(1,"td",12),h(2,"p-tableCheckbox",19),o(),l(3,"td",13)(4,"a",20),m(5),o(),h(6,"p-chip",21),o(),l(7,"td",14)(8,"a",22),m(9),o()(),l(10,"td",15),m(11),w(12,"date"),o(),l(13,"td",15),m(14),w(15,"date"),o(),l(16,"td",16),m(17),w(18,"number"),o(),l(19,"td",17),h(20,"p-chip",21),o(),l(21,"td",17),h(22,"p-chip",21),o(),l(23,"td",18),h(24,"p-button",23),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Customer_Invoice/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(),s("label",e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.customerID,U),a(),k(" ",e.customer," "),a(2),C(F(12,14,e.date,"d/MM/yy")),a(3),k(" ",e.due?F(15,17,e.due,"d/MM/yy"):"-"," "),a(3),C(N(18,20,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function yt(t,p){if(t&1&&(m(0),w(1,"number")),t&2){let e=_(2);A(" Showing ",e.store.first()," to ",e.store.end()," of ",N(1,3,e.store.data().totalCount)," entries ")}}function wt(t,p){t&1&&(l(0,"tr")(1,"td",24)(2,"span"),m(3,"No records found."),o()()())}function It(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){S(e);let i=_();return x(i.onPageChange(n))})("onRowSelect",function(n){S(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){S(e);let i=_();return x(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){S(e);let i=_();return x(i.onHeaderCheckboxToggle(n))}),g(2,bt,18,0,"ng-template",null,3,b)(4,vt,25,22,"ng-template",null,4,b)(6,yt,2,5,"ng-template",null,5,b)(8,wt,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();a(),s("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function Et(t,p){if(t&1&&(l(0,"span",37),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",F(2,2,e.name,30)," ")}}function Tt(t,p){if(t&1&&(l(0,"div")(1,"span",39),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Vt(t,p){if(t&1&&(l(0,"div"),g(1,Tt,3,1,"div",38),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function Ft(t,p){if(t&1&&(l(0,"div")(1,"span",39),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Dt(t,p){if(t&1&&(l(0,"div"),g(1,Ft,3,1,"div",38),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function kt(t,p){if(t&1&&(l(0,"div")(1,"span",39),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Jt(t,p){if(t&1&&(l(0,"div"),g(1,kt,3,1,"div",38),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function Nt(t,p){if(t&1){let e=E();l(0,"form",25)(1,"div",26)(2,"label",27),m(3,"Tag"),o(),l(4,"p-select",28),g(5,Et,3,5,"ng-template",null,7,b),o()(),l(7,"div",26)(8,"label",27),m(9,"Payment"),o(),h(10,"p-select",29),o(),l(11,"div",26)(12,"label",27),m(13,"Delivery"),o(),h(14,"p-select",30),o(),l(15,"div",26)(16,"label",27),m(17,"From - To"),o(),l(18,"div",31),h(19,"p-datepicker",32),g(20,Vt,2,1,"div",33),h(21,"p-datepicker",34),g(22,Dt,2,1,"div",33),o()(),l(23,"div",26)(24,"label",27),m(25,"Customer"),o(),l(26,"p-autocomplete",35),T("completeMethod",function(n){S(e);let i=_();return x(i.onSearchContact(n))}),o()(),l(27,"div",26)(28,"label",27),m(29,"Page Size"),o(),h(30,"input",36),g(31,Jt,2,1,"div",33),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(6),s("options",e.store.meta().options.paymentStates),a(4),s("options",e.store.meta().options.deliveryStates),a(5),s("iconDisplay","input")("showIcon",!0)("ngClass",V(16,qe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",V(18,qe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",e.customerSuggestions()),a(4),s("ngClass",V(20,qe,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var ut=(()=>{class t extends Me{constructor(){super(...arguments),this.store=v(Ke),this.dayjsService=v(R),this.generateJournalService=v(D),this.authService=v(te),this.isDialogFilterVisible=J(!1),this.isInitDialogFilterVisible=J(!1),this.customerSuggestions=J([]),this.fb=v(me)}ngOnInit(){console.log(this.dayjsService.from('0001-01-01T00:00:00"')&&!0),this.generateFilterForm()}generateFilterForm(){let{number:e,outletName:r,paymentState:n,deliveryState:i,from:f,to:u,customerID:ze,pageNumber:je,pageSize:Oe,export:Le,exportPageNumber:Ae,exportPageSize:We}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),paymentState:this.fb.control(n),deliveryState:this.fb.control(i),from:this.fb.control(this.dayjsService.from(f)?this.dayjsService.from(f).toDate():null),to:this.fb.control(this.dayjsService.from(u)?this.dayjsService.from(u).toDate():null),customerID:this.fb.control(ze),pageNumber:this.fb.control(je),pageSize:this.fb.control(Oe,[ne.required]),export:this.fb.control(Le),exportPageNumber:this.fb.control(Ae),exportPageSize:this.fb.control(We)})}onSearchContact(e){let{query:r}=e;this.generateJournalService.getCustomerSuggestions(r).pipe(Ve("Customer Suggestions"),G(n=>{this.customerSuggestions.set(n)})).subscribe()}onSearch(e){this.store.updateFilter(d(c({},this.store.filter()),{number:e}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(d(c({},this.store.filter()),{pageNumber:r+1}))}onGenerateJournal(){this.generateJournalService.generateJournalInvoice(this.store.checkedInvoice()).pipe(G(()=>{this.store.getCustomerInvoice(this.store.filter)})).subscribe()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"customerID":i||(r[n]=it);break;case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});console.log("Filter Body:",e),this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=Ze(t)))(n||t)}})()}static{this.\u0275cmp=H({type:t,selectors:[["app-customer-invoice"]],features:[q([Ke]),L],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Customer Invoice",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","lazy","paginator","rows","totalRecords","value"],[1,"pe-0",2,"width","5px"],[1,"ps-2",2,"width","200px"],[2,"width","200px"],[2,"width","40px"],[2,"width","80px"],[2,"width","50px"],[1,"ps-0",2,"width","20px"],[3,"value"],["target","_blank",1,"link","link-primary","text-wrap","text-break","d-flex",3,"href"],[1,"p-1","px-2",3,"label"],["target","_blank",1,"link","link-primary","text-wrap","text-break",3,"href"],["size","small",3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Tag",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","customerID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","formControlName","pageSize","appMaskNumber","",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(u){return S(i),P(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),x(u)})("isInitDialogFilterVisibleChange",function(u){return S(i),P(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),x(u)}),T("filterConfirmed",function(){return S(i),x(n.onFilterOKEvent())})("search",function(u){return S(i),x(n.onSearch(u))}),g(1,Ct,1,1,"ng-template",null,0,b)(3,It,10,5,"ng-template",null,1,b)(5,Nt,32,22,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ie,Re,ke,Je,Ne,ee,$,Q,X,Z,Y,Be,Ge,ge,_e,fe,ue,De,Fe,Te,Ee,de,ce,He,Ue,se,le,ie,oe,re,ae,pe,Se,he,xe,Pe],encapsulation:2,changeDetection:0})}}return t})();var Rt={data:{data:[],totalCount:0},meta:{options:{Outlets:[],PaymentStates:[],DeliveryStates:[]},filter:{number:null,outletName:null,paymentState:0,deliveryState:null,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,paymentState:0,deliveryState:null,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4},skipRequestFirst:!0},$e=Ce(tt("JournalSupplierBillStore"),we(Rt),be(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedSupplierBill:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ye(t=>{let p=v(D),e=v(R);return{updateFilter(r){y(t,n=>d(c({},n),{filter:c(c({},n.filter),r),skipRequestFirst:!1}))},onRowSelect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?d(c({},f),{checked:!0}):f);return d(c({},n),{data:d(c({},n.data),{data:i})})})},onRowUnselect(r){y(t,n=>{let i=n.data.data.map(f=>f.id===r.id?d(c({},f),{checked:!1}):f);return d(c({},n),{data:d(c({},n.data),{data:i})})})},onHeaderCheckboxToggle(r){y(t,n=>{let i=n.data.data.map(f=>d(c({},f),{checked:r}));return d(c({},n),{data:d(c({},n.data),{data:i})})})},getGJSupplierBillLoader:z(B(M(()=>p.getGJSupplierBillLoader().pipe(j({next:r=>{console.log("GJSupplierBillLoader response:",r),y(t,n=>d(c({},n),{meta:r}))},error:r=>{console.error("Error fetching GJSupplierBillLoader:",r)}}))))),getJournalSupplierBill:z(B(O(r=>Object.entries(r).reduce((n,[i,f])=>(f!=null&&(n[i]=f),n),{})),M(r=>p.getJournalSupplierBill(r).pipe(O(n=>d(c({},n),{data:n.data.map(i=>d(c({},i),{due:e.from(i.due)?e.from(i.due).format():null,checked:!1}))})),j({next:n=>{y(t,i=>d(c({},i),{data:n}))},error:n=>{console.error("Error fetching journal supplier bill:",n)}})))))}}),ve(t=>({onInit:()=>{t.getGJSupplierBillLoader(),t.getJournalSupplierBill(t.filter)}})));var Qe=t=>({"ng-invalid ng-dirty":t});function Bt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){S(e);let n=_(2);return x(n.onGenerateJournal())}),o()}}function Mt(t,p){if(t&1&&g(0,Bt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Pt(t,p){t&1&&(l(0,"tr")(1,"th",12),h(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Tag"),o(),l(5,"th",14),m(6,"Number"),o(),l(7,"th",15),m(8,"Supplier"),o(),l(9,"th",16),m(10,"Date"),o(),l(11,"th",16),m(12,"Due"),o(),l(13,"th",13),m(14,"Amount"),o(),l(15,"th",17),m(16,"Payment"),o(),l(17,"th",17),m(18,"Delivery"),o(),h(19,"th",18),o())}function zt(t,p){if(t&1&&(l(0,"tr")(1,"td"),h(2,"p-tableCheckbox",19),o(),l(3,"td"),m(4),o(),l(5,"td")(6,"a",20),m(7),o()(),l(8,"td"),m(9),o(),l(10,"td"),m(11),w(12,"date"),o(),l(13,"td"),m(14),w(15,"date"),o(),l(16,"td"),m(17),w(18,"number"),o(),l(19,"td"),h(20,"p-chip",21),o(),l(21,"td"),h(22,"p-chip",21),o(),l(23,"td"),h(24,"p-button",22),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),C(e.outlet),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Orders/Orders/Supplier_Bill/Info?ID="+e.id,U),a(),k(" ",e.number," "),a(2),C(e.customer),a(2),C(F(12,13,e.date,"d MMM y hh:mm")),a(3),C(e.due?F(15,16,e.due,"d MMM y hh:mm"):"-"),a(3),C(N(18,19,e.amount)),a(3),s("label",e.payment),a(2),s("label",e.delivery),a(2),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function jt(t,p){if(t&1&&m(0),t&2){let e=_(2);A(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ot(t,p){t&1&&(l(0,"tr")(1,"td",23)(2,"span"),m(3,"No records found."),o()()())}function Gt(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){S(e);let i=_();return x(i.onPageChange(n))})("onRowSelect",function(n){S(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){S(e);let i=_();return x(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){S(e);let i=_();return x(i.onHeaderCheckboxToggle(n))}),g(2,Pt,20,0,"ng-template",null,3,b)(4,zt,25,21,"ng-template",null,4,b)(6,jt,1,3,"ng-template",null,5,b)(8,Ot,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();a(),s("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function Ut(t,p){if(t&1&&(l(0,"span",36),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",F(2,2,e.name,30)," ")}}function Ht(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Lt(t,p){if(t&1&&(l(0,"div"),g(1,Ht,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function At(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function Wt(t,p){if(t&1&&(l(0,"div"),g(1,At,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function Kt(t,p){if(t&1&&(l(0,"div")(1,"span",38),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function qt(t,p){if(t&1&&(l(0,"div"),g(1,Kt,3,1,"div",37),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function $t(t,p){if(t&1){let e=E();l(0,"form",24)(1,"div",25)(2,"label",26),m(3,"Tag"),o(),l(4,"p-select",27),g(5,Ut,3,5,"ng-template",null,7,b),o()(),l(7,"div",25)(8,"label",26),m(9,"Payment"),o(),h(10,"p-select",28),o(),l(11,"div",25)(12,"label",26),m(13,"Delivery"),o(),h(14,"p-select",29),o(),l(15,"div",25)(16,"label",26),m(17,"From - To"),o(),l(18,"div",30),h(19,"p-datepicker",31),g(20,Lt,2,1,"div",32),h(21,"p-datepicker",33),g(22,Wt,2,1,"div",32),o()(),l(23,"div",25)(24,"label",26),m(25,"Supplier"),o(),l(26,"p-autocomplete",34),w(27,"async"),T("completeMethod",function(n){S(e);let i=_();return x(i.onSearchSupplier(n))}),o()(),l(28,"div",25)(29,"label",26),m(30,"Page Size"),o(),h(31,"input",35),g(32,qt,2,1,"div",32),o()()}if(t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.Outlets),a(6),s("options",e.store.meta().options.PaymentStates),a(4),s("options",e.store.meta().options.DeliveryStates),a(5),s("iconDisplay","input")("showIcon",!0)("ngClass",V(18,Qe,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",V(20,Qe,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("suggestions",N(27,16,e.supplierSuggestions$)),a(5),s("ngClass",V(22,Qe,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var ft=(()=>{class t extends Me{constructor(){super(),this.generateJournalService=v(D),this.store=v($e),this.authService=v(te),this.isDialogFilterVisible=J(!1),this.isInitDialogFilterVisible=J(!1),this.fb=v(me),this.dayjsService=v(R)}ngOnInit(){this.initform()}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):r[n]=i),r),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(r=>!r)}onRowSelect(e){this.store.onRowSelect(e.data)}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe(Ve("Supplier Suggestions"))}initform(){let{outletName:e,number:r,from:n,to:i,paymentState:f,deliveryState:u,supplierID:ze,pageNumber:je,pageSize:Oe,export:Le,exportPageNumber:Ae,exportPageSize:We}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),paymentState:this.fb.control(f),deliveryState:this.fb.control(u),supplierID:this.fb.control(ze),pageNumber:this.fb.control(je),pageSize:this.fb.control(Oe,[ne.required]),export:this.fb.control(Le),exportPageNumber:this.fb.control(Ae),exportPageSize:this.fb.control(We)})}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedSupplierBill()).pipe(G(()=>{this.store.getJournalSupplierBill(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(d(c({},this.store.filter()),{number:e}))}onPageChange(e){this.store.updateFilter(d(c({},this.store.filter()),{pageNumber:e.first/e.rows+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=H({type:t,selectors:[["app-journal-supplier-bill"]],features:[q([$e]),L],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Supplier Bill",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"label"],[3,"icon","severity","text"],["colspan","10"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Tag",3,"virtualScrollItemSize","options"],["showClear","","formControlName","paymentState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Payment",3,"options"],["showClear","","formControlName","deliveryState","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select a Delivery",3,"options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["type","text","pInputText","","appMaskNumber","","formControlName","pageSize",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(u){return S(i),P(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),x(u)})("isInitDialogFilterVisibleChange",function(u){return S(i),P(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),x(u)}),T("filterConfirmed",function(){return S(i),x(n.onFilterOKEvent())})("search",function(u){return S(i),x(n.onSearch(u))}),g(1,Mt,1,1,"ng-template",null,0,b)(3,Gt,10,5,"ng-template",null,1,b)(5,$t,33,24,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ie,Re,ke,Je,Ne,ee,$,Q,X,et,Z,Y,Be,Ge,ge,_e,fe,ue,De,Fe,Te,Ee,He,Ue,se,le,ie,oe,re,ae,pe,de,ce,xe,Se,he,Pe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Qt={data:{data:[],totalCount:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},filter:{number:null,outletName:null,from:null,to:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4}},Xe=Ce(we(Qt),be(t=>({first:I(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:I(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:I(()=>t.data().data.some(p=>p.checked)),checkedShift:I(()=>t.data().data.filter(p=>p.checked).map(p=>p.id))})),ye(t=>{let p=v(D);return{updateFilter(e){y(t,r=>d(c({},r),{filter:c(c({},r.filter),e)}))},onRowSelect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?d(c({},i),{checked:!0}):i);return d(c({},r),{data:d(c({},r.data),{data:n})})})},onRowUnselect(e){y(t,r=>{let n=r.data.data.map(i=>i.id===e.id?d(c({},i),{checked:!1}):i);return d(c({},r),{data:d(c({},r.data),{data:n})})})},onHeaderCheckboxToggle(e){y(t,r=>{let n=r.data.data.map(i=>d(c({},i),{checked:e}));return d(c({},r),{data:d(c({},r.data),{data:n})})})},getGJShiftLoader:z(B(M(()=>p.getGJShiftLoader().pipe(j(e=>y(t,r=>d(c({},r),{meta:e})),e=>console.error("Error fetching GJ Shift Loader:",e)))))),getJournalShift:z(B(O(e=>Object.entries(e).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),{})),M(e=>p.getJournalShift(e).pipe(j(r=>y(t,n=>d(c({},n),{data:r})),r=>console.error("Error fetching journal shift:",r))))))}}),ve(t=>({onInit:()=>{t.getGJShiftLoader(),t.getJournalShift(t.filter)}})));var Ye=t=>({"ng-invalid ng-dirty":t});function Xt(t,p){if(t&1){let e=E();l(0,"p-button",10),T("onClick",function(){S(e);let n=_(2);return x(n.onGenerateJournal())}),o()}}function Yt(t,p){if(t&1&&g(0,Xt,1,0,"p-button",9),t&2){let e=_();s("ngIf",e.store.hasCheckedRows())}}function Zt(t,p){t&1&&(l(0,"tr")(1,"th",12),h(2,"p-tableHeaderCheckbox"),o(),l(3,"th",13),m(4,"Number"),o(),l(5,"th",14),m(6,"Open"),o(),l(7,"th",14),m(8,"Close"),o(),l(9,"th",15),m(10,"Cashier"),o(),l(11,"th",16),m(12,"Sales + Tax"),o(),l(13,"th",17),m(14,"Invoices"),o(),l(15,"th",16),m(16,"Tag"),o(),l(17,"th",17),m(18,"Register"),o(),l(19,"th",17),m(20,"Visitors"),o(),h(21,"th",18),o())}function ei(t,p){if(t&1&&(l(0,"tr")(1,"td"),h(2,"p-tableCheckbox",19),o(),l(3,"td")(4,"a",20),m(5),o()(),l(6,"td"),m(7),w(8,"date"),o(),l(9,"td"),m(10),w(11,"date"),o(),l(12,"td"),m(13),o(),l(14,"td"),m(15),w(16,"number"),o(),l(17,"td"),m(18),w(19,"number"),o(),l(20,"td"),m(21),o(),l(22,"td"),m(23),o(),l(24,"td"),m(25),w(26,"number"),o(),l(27,"td"),h(28,"p-button",21),o()()),t&2){let e=p.$implicit,r=_(2);a(2),s("value",e),a(2),s("href",r.authService.getTenantExternalURL()+"/menu/Shift/Main/Previous_Shift/Register_Shift_Detail?ID="+e.id,U),a(),k(" ",e.number," "),a(2),C(F(8,14,e.open,"dd MMM y hh:mm")),a(3),C(F(11,17,e.close,"dd MMM y hh:mm")),a(3),C(e.cashier),a(2),C(N(16,20,e.salesNTax)),a(3),C(N(19,22,e.totalInvoice)),a(3),C(e.outlet),a(2),C(e.register),a(2),C(N(26,24,e.visitors)),a(3),s("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function ti(t,p){if(t&1&&m(0),t&2){let e=_(2);A(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function ii(t,p){t&1&&(l(0,"tr")(1,"td",22)(2,"span"),m(3,"No records found."),o()()())}function ni(t,p){if(t&1){let e=E();l(0,"p-panel")(1,"p-table",11),T("onPage",function(n){S(e);let i=_();return x(i.onPageChange(n))})("onRowSelect",function(n){S(e);let i=_();return x(i.onRowSelect(n))})("onRowUnselect",function(n){S(e);let i=_();return x(i.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){S(e);let i=_();return x(i.onHeaderCheckboxToggle(n))}),g(2,Zt,22,0,"ng-template",null,3,b)(4,ei,29,26,"ng-template",null,4,b)(6,ti,1,3,"ng-template",null,5,b)(8,ii,4,0,"ng-template",null,6,b),o()()}if(t&2){let e=_();a(),s("paginator",!0)("lazy",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("value",e.store.data().data)}}function oi(t,p){if(t&1&&(l(0,"span",32),m(1),w(2,"truncate"),o()),t&2){let e=p.$implicit;s("pTooltip",e.name),a(),k(" ",F(2,2,e.name,30)," ")}}function ri(t,p){if(t&1&&(l(0,"div")(1,"span",34),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function li(t,p){if(t&1&&(l(0,"div"),g(1,ri,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("from"))}}function ai(t,p){if(t&1&&(l(0,"div")(1,"span",34),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function pi(t,p){if(t&1&&(l(0,"div"),g(1,ai,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("to"))}}function mi(t,p){if(t&1&&(l(0,"div")(1,"span",34),m(2),o()()),t&2){let e=p.$implicit;a(2),C(e)}}function si(t,p){if(t&1&&(l(0,"div"),g(1,mi,3,1,"div",33),o()),t&2){let e=_(2);a(),s("ngForOf",e.getErrors("pageSize"))}}function ci(t,p){if(t&1&&(l(0,"form",23)(1,"div",24)(2,"label",25),m(3,"Tag"),o(),l(4,"p-select",26),g(5,oi,3,5,"ng-template",null,7,b),o()(),l(7,"div",24)(8,"label",25),m(9,"From - To"),o(),l(10,"div",27),h(11,"p-datepicker",28),g(12,li,2,1,"div",29),h(13,"p-datepicker",30),g(14,pi,2,1,"div",29),o()(),l(15,"div",24)(16,"label",25),m(17,"Page Size"),o(),h(18,"input",31),g(19,si,2,1,"div",29),o()()),t&2){let e=_();s("formGroup",e.form),a(4),s("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),a(7),s("iconDisplay","input")("showIcon",!0)("ngClass",V(13,Ye,e.isInvalid("from"))),a(),s("ngIf",e.isInvalid("from")),a(),s("iconDisplay","input")("showIcon",!0)("ngClass",V(15,Ye,e.isInvalid("to"))),a(),s("ngIf",e.isInvalid("to")),a(4),s("ngClass",V(17,Ye,e.isInvalid("pageSize"))),a(),s("ngIf",e.isInvalid("pageSize"))}}var _t=(()=>{class t extends Me{constructor(){super(),this.generateJournalService=v(D),this.store=v(Xe),this.authService=v(te),this.isDialogFilterVisible=J(!1),this.isInitDialogFilterVisible=J(!1),this.fb=v(me),this.dayjsService=v(R)}ngOnInit(){this.initForm()}initForm(){let{number:e,outletName:r,from:n,to:i,pageNumber:f,pageSize:u,export:ze,exportPageNumber:je,exportPageSize:Oe}=this.store.filter();this.form=this.fb.group({number:this.fb.control(e),outletName:this.fb.control(r),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),pageNumber:this.fb.control(f),pageSize:this.fb.control(u,[ne.required]),export:this.fb.control(ze),exportPageNumber:this.fb.control(je),exportPageSize:this.fb.control(Oe)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((r,[n,i])=>{switch(n){case"from":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;case"to":typeof i=="object"?r[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null:r[n]=i!=null?String(i):null;break;default:r[n]=i===null?"":i;break}return r},{});this.store.updateFilter(e),this.isDialogFilterVisible.set(!1)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(r=>{this.store.onRowUnselect(r)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onGenerateJournal(){this.generateJournalService.generateJournalSupplierBill(this.store.checkedShift()).pipe(G(()=>{this.store.getJournalShift(this.store.filter)})).subscribe()}onSearch(e){this.store.updateFilter(d(c({},this.store.filter()),{number:e}))}onPageChange(e){let r=e.first/e.rows;this.store.updateFilter(d(c({},this.store.filter()),{pageNumber:r+1}))}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=H({type:t,selectors:[["app-journal-shift"]],features:[q([Xe]),L],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Shift Journal",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","paginator","lazy","rows","totalRecords","value"],[2,"width","1rem"],[2,"width","12rem"],[2,"width","11rem"],[2,"width","14rem"],[2,"width","10rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"icon","severity","text"],["colspan","11"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Tag",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["type","text","pInputText","","formControlName","pageSize","appMaskNumber","",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(r,n){if(r&1){let i=E();l(0,"app-main-panel",8),K("isDialogFilterVisibleChange",function(u){return S(i),P(n.isDialogFilterVisible,u)||(n.isDialogFilterVisible=u),x(u)})("isInitDialogFilterVisibleChange",function(u){return S(i),P(n.isInitDialogFilterVisible,u)||(n.isInitDialogFilterVisible=u),x(u)}),T("filterConfirmed",function(){return S(i),x(n.onFilterOKEvent())})("search",function(u){return S(i),x(n.onSearch(u))}),g(1,Yt,1,1,"ng-template",null,0,b)(3,ni,10,5,"ng-template",null,1,b)(5,ci,20,19,"ng-template",null,2,b),o()}r&2&&(s("isSearchableInput",!0)("isFilterable",!0),W("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[Ie,Re,ke,Je,Ne,ee,$,Q,X,Z,Y,Be,ge,_e,fe,ue,se,le,ie,oe,re,ae,pe,De,Fe,Te,Ee,xe,Se,he,de,ce,Pe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var fo=[{path:"invoice",component:ut},{path:"supplier-bill",component:ft},{path:"shift",component:_t},{path:"join-invoice",loadComponent:()=>import("./chunk-LF4HTMCE.js").then(t=>t.ARJournalComponent)},{path:"join-bill",loadComponent:()=>import("./chunk-4GZGUASQ.js").then(t=>t.ApJournalComponent)},{path:"adjustment",loadComponent:()=>import("./chunk-7ET5ZE2L.js").then(t=>t.AdjustmentJournalComponent)}];export{fo as generateJournalRoutes};
@@ -0,0 +1,202 @@
1
+ import{a as ie,b as St}from"./chunk-SOD2BIQR.js";import{f as Tt}from"./chunk-TAN6GLIH.js";import"./chunk-GIRWHO6Q.js";import{a as kt}from"./chunk-YHLRDTIS.js";import{a as vt}from"./chunk-XKI7WLHE.js";import{a as yt}from"./chunk-2ABEICLB.js";import"./chunk-KQZMRRMA.js";import"./chunk-ZC7ZENN7.js";import{m as Ne}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as ee,b as te}from"./chunk-3VQUNDVT.js";import{b as wt,g as bt,h as xt,i as Ct}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as ht,b as gt}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as ft}from"./chunk-JPKZVL57.js";import{a as tt}from"./chunk-VM56C6ZV.js";import{a as st,b as lt}from"./chunk-ISIYG4D5.js";import{b as E,c as pt,d as ct,e as mt,f as dt,g as ut,h as _t}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{a as et,f as A,k as it,m as nt,o as rt,s as ot,w as Y,x as at}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{A as fe,B as Ze,D as Je,L as We,Ma as Xe,Na as X,Va as Ye,c as K,e as Qe,f as ze,m as je,na as Ke,p as qe,v as Ge,y as $e}from"./chunk-MGIEURA2.js";import{b as Oe,d as Ae,e as Be}from"./chunk-DZCJWJUG.js";import"./chunk-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import{c as He,d as ce,f as me,h as de,i as ue,k as _e}from"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as Z,m as J,o as Me,r as Re,u as W}from"./chunk-DM2JLWKE.js";import{$b as U,$c as Pe,Aa as N,Cb as z,Dc as $,Eb as f,Ec as De,Fc as I,Gc as Ee,Ha as L,Kc as Fe,Lb as F,Mb as p,Oc as Ue,Pb as j,Qb as ae,Qc as Ve,Rb as Ce,Sb as M,Sc as x,Ub as R,Vb as O,Wb as l,Xb as s,Y as H,Yb as y,Zb as ye,_ as re,_b as ve,_c as D,ac as S,bd as P,c as B,ca as we,cd as Le,da as be,fc as b,gc as c,hc as ke,ia as C,ib as a,ic as Te,lc as V,mc as q,nc as v,oc as k,qa as u,ra as _,rc as Se,sc as d,tc as T,ua as oe,uc as G,wc as Ie,xc as se,yb as Q,yc as le,zb as xe,zc as pe}from"./chunk-6QJHEOXN.js";import{a as h,b as g}from"./chunk-YQFG5XE2.js";var Et={data:[],count:0,filter:{pagination:1,pageSize:10,groupID:null,text:""},meta:{filter:{pagination:1,pageSize:10,groupID:null,text:""},options:{groups:[]}},metaForm:{form:{id:"",groupID:"",accessTypeID:1,listJournalTagID:[]},options:{users:[],groups:[],accessTypes:[],journalTags:[]}}},he=pt(_t("UserStore"),ut(Et),ct(t=>({first:P(()=>(t.filter().pagination-1)*t.filter().pageSize+1),end:P(()=>Math.min(t.filter().pagination*t.filter().pageSize,t.count())),hasCheckedRows:P(()=>t.data().some(o=>o.checked)),checkedData:P(()=>t.data().filter(o=>o.checked).map(o=>o.userID)),selectedID:P(()=>t.data().find(o=>o.checked)?.userID||null)})),dt(t=>{let o=C(ie);return{setFilter(n){E(t,i=>g(h({},i),{filter:n}))},onRowSelect(n){E(t,i=>{let r=i.data.map(m=>m.userID===n.userID?g(h({},m),{checked:!0}):m);return g(h({},i),{data:r})})},onRowUnselect(n){E(t,i=>{let r=i.data.map(m=>m.userID===n.userID?g(h({},m),{checked:!1}):m);return g(h({},i),{data:r})})},onHeaderCheckboxToggle(n){let i=localStorage.getItem("AUTH_USERNAME");E(t,r=>{let m=r.data.map(w=>w.userName!==i?g(h({},w),{checked:n}):g(h({},w),{checked:!1}));return g(h({},r),{data:m})})},getUserLoader:ee(B(H(()=>o.getUserLoaderList().pipe(te({next:n=>{E(t,i=>g(h({},i),{meta:n}))},error:n=>{console.error("Failed to fetch user loader list:",n)}}))))),getUserFormMeta:ee(B(H(n=>o.getUserFormMeta(n).pipe(te({next:i=>{E(t,r=>g(h({},r),{metaForm:i}))},error:i=>{console.error("Failed to fetch user form meta:",i)}}))))),getUsers:ee(B(H(n=>o.getUsers(n).pipe(te({next:i=>{E(t,r=>g(h({},r),{data:i.data.map(m=>g(h({},m),{checked:!1})),count:i.count}))},error:i=>{console.error("Failed to fetch users:",i)}})))))}}),mt({onInit:t=>{t.getUserLoader(),t.getUsers(t.filter)}}));var Vt=["header"],Pt=["footer"],Lt=["content"],Mt=["closeicon"],Rt=["headless"],Ot=["maskRef"],At=["container"],Bt=["closeButton"],Ht=["*"],Nt=(t,o,e,n,i,r)=>({"p-drawer":!0,"p-drawer-active":t,"p-drawer-left":o,"p-drawer-right":e,"p-drawer-top":n,"p-drawer-bottom":i,"p-drawer-full":r}),Qt=(t,o)=>({transform:t,transition:o}),zt=t=>({value:"visible",params:t});function jt(t,o){t&1&&U(0)}function qt(t,o){if(t&1&&f(0,jt,1,0,"ng-container",4),t&2){let e=c(2);p("ngTemplateOutlet",e.headlessTemplate||e._headlessTemplate)}}function Gt(t,o){t&1&&U(0)}function $t(t,o){if(t&1&&(l(0,"div"),d(1),s()),t&2){let e=c(3);ae(e.cx("title")),a(),T(e.header)}}function Zt(t,o){t&1&&y(0,"TimesIcon"),t&2&&F("data-pc-section","closeicon")}function Jt(t,o){}function Wt(t,o){t&1&&f(0,Jt,0,0,"ng-template")}function Kt(t,o){if(t&1&&f(0,Zt,1,1,"TimesIcon",8)(1,Wt,1,0,null,4),t&2){let e=c(4);p("ngIf",!e.closeIconTemplate&&!e._closeIconTemplate),a(),p("ngTemplateOutlet",e.closeIconTemplate||e._closeIconTemplate)}}function Xt(t,o){if(t&1){let e=S();l(0,"p-button",9),b("onClick",function(i){u(e);let r=c(3);return _(r.close(i))})("keydown.enter",function(i){u(e);let r=c(3);return _(r.close(i))}),f(1,Kt,2,2,"ng-template",null,1,x),s()}if(t&2){let e=c(3);p("ngClass",e.cx("closeButton"))("buttonProps",e.closeButtonProps)("ariaLabel",e.ariaCloseLabel),F("data-pc-section","closebutton")("data-pc-group-section","iconcontainer")}}function Yt(t,o){t&1&&U(0)}function ei(t,o){t&1&&U(0)}function ti(t,o){if(t&1&&(ye(0),l(1,"div",5),f(2,ei,1,0,"ng-container",4),s(),ve()),t&2){let e=c(3);a(),p("ngClass",e.cx("footer")),F("data-pc-section","footer"),a(),p("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}function ii(t,o){if(t&1&&(l(0,"div",5),f(1,Gt,1,0,"ng-container",4)(2,$t,2,3,"div",6)(3,Xt,3,5,"p-button",7),s(),l(4,"div",5),Te(5),f(6,Yt,1,0,"ng-container",4),s(),f(7,ti,3,3,"ng-container",8)),t&2){let e=c(2);p("ngClass",e.cx("header")),F("data-pc-section","header"),a(),p("ngTemplateOutlet",e.headerTemplate||e._headerTemplate),a(),p("ngIf",e.header),a(),p("ngIf",e.showCloseIcon&&e.closable),a(),p("ngClass",e.cx("content")),F("data-pc-section","content"),a(2),p("ngTemplateOutlet",e.contentTemplate||e._contentTemplate),a(),p("ngIf",e.footerTemplate||e._footerTemplate)}}function ni(t,o){if(t&1){let e=S();l(0,"div",3,0),b("@panelState.start",function(i){u(e);let r=c();return _(r.onAnimationStart(i))})("@panelState.done",function(i){u(e);let r=c();return _(r.onAnimationEnd(i))})("keydown",function(i){u(e);let r=c();return _(r.onKeyDown(i))}),f(2,qt,1,1,"ng-container")(3,ii,8,9),s()}if(t&2){let e=c();j(e.style),ae(e.styleClass),p("ngClass",Fe(9,Nt,e.visible,e.position==="left"&&!e.fullScreen,e.position==="right"&&!e.fullScreen,e.position==="top"&&!e.fullScreen,e.position==="bottom"&&!e.fullScreen,e.fullScreen||e.position==="full"))("@panelState",I(19,zt,Ee(16,Qt,e.transformOptions,e.transitionOptions))),F("data-pc-name","sidebar")("data-pc-section","root"),a(2),Ce(e.headlessTemplate||e._headlessTemplate?2:3)}}var ri=({dt:t})=>`
2
+ .p-drawer {
3
+ display: flex;
4
+ flex-direction: column;
5
+ pointer-events: auto;
6
+ transform: translate3d(0px, 0px, 0px);
7
+ position: fixed;
8
+ transition: transform 0.3s;
9
+ background: ${t("drawer.background")};
10
+ color: ${t("drawer.color")};
11
+ border: 1px solid ${t("drawer.border.color")};
12
+ box-shadow: ${t("drawer.shadow")};
13
+ }
14
+
15
+ .p-drawer-content {
16
+ overflow-y: auto;
17
+ flex-grow: 1;
18
+ padding: ${t("drawer.content.padding")};
19
+ }
20
+
21
+ .p-drawer-header {
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: space-between;
25
+ flex-shrink: 0;
26
+ padding: ${t("drawer.header.padding")};
27
+ }
28
+
29
+ .p-drawer-footer {
30
+ padding: ${t("drawer.header.padding")};
31
+ }
32
+
33
+ .p-drawer-title {
34
+ font-weight: ${t("drawer.title.font.weight")};
35
+ font-size: ${t("drawer.title.font.size")};
36
+ }
37
+
38
+ .p-drawer-full .p-drawer {
39
+ transition: none;
40
+ transform: none;
41
+ width: 100vw !important;
42
+ height: 100vh !important;
43
+ max-height: 100%;
44
+ top: 0px !important;
45
+ left: 0px !important;
46
+ border-width: 1px;
47
+ }
48
+
49
+ .p-drawer-left .p-drawer {
50
+ align-self: start;
51
+ width: 20rem;
52
+ height: 100%;
53
+ border-right-width: 1px;
54
+ }
55
+
56
+ .p-drawer-right .p-drawer {
57
+ align-self: end;
58
+ width: 20rem;
59
+ height: 100%;
60
+ border-left-width: 1px;
61
+ }
62
+
63
+ .p-drawer-top .p-drawer {
64
+ height: 10rem;
65
+ width: 100%;
66
+ border-bottom-width: 1px;
67
+ }
68
+
69
+ .p-drawer-bottom .p-drawer {
70
+ height: 10rem;
71
+ width: 100%;
72
+ border-top-width: 1px;
73
+ }
74
+
75
+ .p-drawer-left .p-drawer-content,
76
+ .p-drawer-right .p-drawer-content,
77
+ .p-drawer-top .p-drawer-content,
78
+ .p-drawer-bottom .p-drawer-content {
79
+ width: 100%;
80
+ height: 100%;
81
+ }
82
+
83
+ .p-drawer-open {
84
+ display: flex;
85
+ }
86
+
87
+ .p-drawer-top {
88
+ justify-content: flex-start;
89
+ }
90
+
91
+ .p-drawer-bottom {
92
+ justify-content: flex-end;
93
+ }
94
+
95
+ .p-drawer {
96
+ position: fixed;
97
+ transition: transform 0.3s;
98
+ display: flex;
99
+ flex-direction: column;
100
+ }
101
+
102
+ .p-drawer-content {
103
+ position: relative;
104
+ overflow-y: auto;
105
+ flex-grow: 1;
106
+ }
107
+
108
+ .p-drawer-header {
109
+ display: flex;
110
+ align-items: center;
111
+ }
112
+
113
+ .p-drawer-footer {
114
+ margin-top: auto;
115
+ }
116
+
117
+ .p-drawer-icon {
118
+ display: flex;
119
+ align-items: center;
120
+ justify-content: center;
121
+ margin-left: auto;
122
+ }
123
+
124
+ .p-drawer-left {
125
+ top: 0;
126
+ left: 0;
127
+ width: 20rem;
128
+ height: 100%;
129
+ }
130
+
131
+ .p-drawer-right {
132
+ top: 0;
133
+ right: 0;
134
+ width: 20rem;
135
+ height: 100%;
136
+ }
137
+
138
+ .p-drawer-top {
139
+ top: 0;
140
+ left: 0;
141
+ width: 100%;
142
+ height: 10rem;
143
+ }
144
+
145
+ .p-drawer-bottom {
146
+ bottom: 0;
147
+ left: 0;
148
+ width: 100%;
149
+ height: 10rem;
150
+ }
151
+
152
+ .p-drawer-full {
153
+ width: 100%;
154
+ height: 100%;
155
+ top: 0;
156
+ left: 0;
157
+ -webkit-transition: none;
158
+ transition: none;
159
+ }
160
+
161
+ .p-drawer-mask {
162
+ background-color: rgba(0, 0, 0, 0.4);
163
+ transition-duration: 0.2s;
164
+ }
165
+
166
+ .p-overlay-mask {
167
+ position: fixed;
168
+ top: 0;
169
+ left: 0;
170
+ width: 100%;
171
+ height: 100%;
172
+ }
173
+
174
+ .p-overlay-mask:dir(rtl) {
175
+ flex-direction: row-reverse;
176
+ }
177
+
178
+ .p-overlay-mask-enter {
179
+ animation: p-overlay-mask-enter-animation 150ms forwards;
180
+ }
181
+
182
+ .p-overlay-mask-leave {
183
+ animation: p-overlay-mask-leave-animation 150ms forwards;
184
+ }
185
+
186
+ @keyframes p-overlay-mask-enter-animation {
187
+ from {
188
+ background-color: transparent;
189
+ }
190
+ to {
191
+ background-color: rgba(0, 0, 0, 0.4);
192
+ }
193
+ }
194
+ @keyframes p-overlay-mask-leave-animation {
195
+ from {
196
+ background-color: rgba(0, 0, 0, 0.4);
197
+ }
198
+ to {
199
+ background-color: transparent;
200
+ }
201
+ }
202
+ `,oi={mask:({instance:t})=>({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",flexDirection:"column",alignItems:t.position==="top"?"flex-start":t.position==="bottom"?"flex-end":"center"})},ai={mask:({instance:t})=>({"p-drawer-mask":!0,"p-overlay-mask p-overlay-mask-enter":t.modal,"p-drawer-open":t.containerVisible,"p-drawer-full":t.fullScreen,[`p-drawer-${t.position}`]:!!t.position}),root:({instance:t})=>({"p-drawer p-component":!0,"p-drawer-full":t.fullScreen}),header:"p-drawer-header",title:"p-drawer-title",pcCloseButton:"p-drawer-close-button",content:"p-drawer-content",footer:"p-drawer-footer"},It=(()=>{class t extends Ye{name="drawer";theme=ri;classes=ai;inlineStyles=oi;static \u0275fac=(()=>{let e;return function(i){return(e||(e=oe(t)))(i||t)}})();static \u0275prov=we({token:t,factory:t.\u0275fac})}return t})();var si=ue([me({transform:"{{transform}}",opacity:0}),ce("{{transition}}")]),li=ue([ce("{{transition}}",me({transform:"{{transform}}",opacity:0}))]),ge=(()=>{class t extends et{appendTo="body";blockScroll=!1;style;styleClass;ariaCloseLabel;autoZIndex=!0;baseZIndex=0;modal=!0;closeButtonProps={severity:"secondary",text:!0,rounded:!0};dismissible=!0;showCloseIcon=!0;closeOnEscape=!0;transitionOptions="150ms cubic-bezier(0, 0, 0.2, 1)";get visible(){return this._visible}set visible(e){this._visible=e}get position(){return this._position}set position(e){if(this._position=e,e==="full"){this.transformOptions="none";return}switch(e){case"left":this.transformOptions="translate3d(-100%, 0px, 0px)";break;case"right":this.transformOptions="translate3d(100%, 0px, 0px)";break;case"bottom":this.transformOptions="translate3d(0px, 100%, 0px)";break;case"top":this.transformOptions="translate3d(0px, -100%, 0px)";break}}get fullScreen(){return this._fullScreen}set fullScreen(e){this._fullScreen=e,e&&(this.transformOptions="none")}header;maskStyle;closable=!0;onShow=new N;onHide=new N;visibleChange=new N;maskRef;containerViewChild;closeButtonViewChild;initialized;_visible;_position="left";_fullScreen=!1;container;transformOptions="translate3d(-100%, 0px, 0px)";mask;maskClickListener;documentEscapeListener;animationEndListener;_componentStyle=C(It);ngAfterViewInit(){super.ngAfterViewInit(),this.initialized=!0}headerTemplate;footerTemplate;contentTemplate;closeIconTemplate;headlessTemplate;_headerTemplate;_footerTemplate;_contentTemplate;_closeIconTemplate;_headlessTemplate;templates;ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"content":this._contentTemplate=e.template;break;case"header":this._headerTemplate=e.template;break;case"footer":this._footerTemplate=e.template;break;case"closeicon":this._closeIconTemplate=e.template;break;case"headless":this._headlessTemplate=e.template;break;default:this._contentTemplate=e.template;break}})}onKeyDown(e){e.code==="Escape"&&this.hide(!1)}show(){this.container.setAttribute(this.attrSelector,""),this.autoZIndex&&A.set("modal",this.container,this.baseZIndex||this.config.zIndex.modal),this.modal&&this.enableModality(),this.onShow.emit({}),this.visibleChange.emit(!0)}hide(e=!0){e&&this.onHide.emit({}),this.modal&&this.disableModality()}close(e){this.hide(),this.visibleChange.emit(!1),e.preventDefault()}enableModality(){let e=this.document.querySelectorAll(".p-drawer-active"),n=e.length,i=n==1?String(parseInt(this.container.style.zIndex)-1):String(parseInt(e[n-1].style.zIndex)-1);this.mask||(this.mask=this.renderer.createElement("div"),this.renderer.setStyle(this.mask,"zIndex",i),Ke(this.mask,"style",this.maskStyle),fe(this.mask,"p-overlay-mask p-drawer-mask p-overlay-mask-enter"),this.dismissible&&(this.maskClickListener=this.renderer.listen(this.mask,"click",r=>{this.dismissible&&this.close(r)})),this.renderer.appendChild(this.document.body,this.mask),this.blockScroll&&Ze())}disableModality(){this.mask&&(fe(this.mask,"p-overlay-mask-leave"),this.animationEndListener=this.renderer.listen(this.mask,"animationend",this.destroyModal.bind(this)))}destroyModal(){this.unbindMaskClickListener(),this.mask&&this.renderer.removeChild(this.document.body,this.mask),this.blockScroll&&Je(),this.unbindAnimationEndListener(),this.mask=null}onAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.appendContainer(),this.show(),this.closeOnEscape&&this.bindDocumentEscapeListener();break}}onAnimationEnd(e){switch(e.toState){case"void":this.hide(!1),A.clear(this.container),this.unbindGlobalListeners();break}}appendContainer(){this.appendTo&&(this.appendTo==="body"?this.renderer.appendChild(this.document.body,this.container):We(this.appendTo,this.container))}bindDocumentEscapeListener(){let e=this.el?this.el.nativeElement.ownerDocument:this.document;this.documentEscapeListener=this.renderer.listen(e,"keydown",n=>{n.which==27&&parseInt(this.container.style.zIndex)===A.get(this.container)&&this.close(n)})}unbindDocumentEscapeListener(){this.documentEscapeListener&&(this.documentEscapeListener(),this.documentEscapeListener=null)}unbindMaskClickListener(){this.maskClickListener&&(this.maskClickListener(),this.maskClickListener=null)}unbindGlobalListeners(){this.unbindMaskClickListener(),this.unbindDocumentEscapeListener()}unbindAnimationEndListener(){this.animationEndListener&&this.mask&&(this.animationEndListener(),this.animationEndListener=null)}ngOnDestroy(){this.initialized=!1,this.visible&&this.modal&&this.destroyModal(),this.appendTo&&this.container&&this.renderer.appendChild(this.el.nativeElement,this.container),this.container&&this.autoZIndex&&A.clear(this.container),this.container=null,this.unbindGlobalListeners(),this.unbindAnimationEndListener()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=oe(t)))(i||t)}})();static \u0275cmp=Q({type:t,selectors:[["p-drawer"]],contentQueries:function(n,i,r){if(n&1&&(V(r,Vt,4),V(r,Pt,4),V(r,Lt,4),V(r,Mt,4),V(r,Rt,4),V(r,Xe,4)),n&2){let m;v(m=k())&&(i.headerTemplate=m.first),v(m=k())&&(i.footerTemplate=m.first),v(m=k())&&(i.contentTemplate=m.first),v(m=k())&&(i.closeIconTemplate=m.first),v(m=k())&&(i.headlessTemplate=m.first),v(m=k())&&(i.templates=m)}},viewQuery:function(n,i){if(n&1&&(q(Ot,5),q(At,5),q(Bt,5)),n&2){let r;v(r=k())&&(i.maskRef=r.first),v(r=k())&&(i.containerViewChild=r.first),v(r=k())&&(i.closeButtonViewChild=r.first)}},inputs:{appendTo:"appendTo",blockScroll:[2,"blockScroll","blockScroll",D],style:"style",styleClass:"styleClass",ariaCloseLabel:"ariaCloseLabel",autoZIndex:[2,"autoZIndex","autoZIndex",D],baseZIndex:[2,"baseZIndex","baseZIndex",Pe],modal:[2,"modal","modal",D],closeButtonProps:"closeButtonProps",dismissible:[2,"dismissible","dismissible",D],showCloseIcon:[2,"showCloseIcon","showCloseIcon",D],closeOnEscape:[2,"closeOnEscape","closeOnEscape",D],transitionOptions:"transitionOptions",visible:"visible",position:"position",fullScreen:"fullScreen",header:"header",maskStyle:"maskStyle",closable:[2,"closable","closable",D]},outputs:{onShow:"onShow",onHide:"onHide",visibleChange:"visibleChange"},features:[$([It]),z],ngContentSelectors:Ht,decls:1,vars:1,consts:[["container",""],["icon",""],["role","complementary",3,"ngClass","style","class","keydown",4,"ngIf"],["role","complementary",3,"keydown","ngClass"],[4,"ngTemplateOutlet"],[3,"ngClass"],[3,"class",4,"ngIf"],[3,"ngClass","buttonProps","ariaLabel","onClick","keydown.enter",4,"ngIf"],[4,"ngIf"],[3,"onClick","keydown.enter","ngClass","buttonProps","ariaLabel"]],template:function(n,i){n&1&&(ke(),f(0,ni,4,21,"div",2)),n&2&&p("ngIf",i.visible)},dependencies:[W,Z,J,Me,Y,tt,X],encapsulation:2,data:{animation:[He("panelState",[de("void => visible",[_e(si)]),de("visible => void",[_e(li)])])]},changeDetection:0})}return t})(),Dt=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=xe({type:t});static \u0275inj=be({imports:[ge,X,X]})}return t})();var ci=["class","page"],mi=()=>({width:"400px"}),ne=t=>({"ng-invalid ng-dirty":t}),di=t=>({groupID:t});function ui(t,o){if(t&1){let e=S();l(0,"p-button",24),b("onClick",function(){u(e);let i=c(2);return _(i.onDeleteUser())}),s()}}function _i(t,o){if(t&1){let e=S();l(0,"p-button",25),b("onClick",function(){u(e);let i=c(2);return _(i.onHandleDrawer())}),s()}}function fi(t,o){if(t&1&&(l(0,"div",21),f(1,ui,1,0,"p-button",22)(2,_i,1,0,"p-button",23),s()),t&2){let e=c();a(),p("ngIf",e.store.hasCheckedRows()),a(),p("ngIf",e.roleService.permissions().user.create)}}function hi(t,o){t&1&&(l(0,"th",32),y(1,"p-tableHeaderCheckbox"),s())}function gi(t,o){if(t&1&&(l(0,"tr"),f(1,hi,2,0,"th",28),l(2,"th",29),d(3,"LoginID"),s(),l(4,"th",29),d(5,"Group"),s(),l(6,"th",30),d(7,"Access"),s(),l(8,"th"),d(9,"Tag"),s(),l(10,"th",31),d(11,"Last Login"),s()()),t&2){let e=c(2);a(),p("ngIf",e.roleService.permissions().user.delete)}}function wi(t,o){t&1&&U(0)}function bi(t,o){if(t&1&&y(0,"p-tableCheckbox",38),t&2){let e=c(3).$implicit;p("value",e)}}function xi(t,o){if(t&1&&f(0,bi,1,1,"p-tableCheckbox",37),t&2){let e=c(4);p("ngIf",e.roleService.permissions().user.delete)}}function Ci(t,o){if(t&1&&(l(0,"td"),f(1,wi,1,0,"ng-container",36)(2,xi,1,1,"ng-template",null,7,x),s()),t&2){let e=Se(3),n=c().$implicit,i=c(2);a(),p("ngIf",i.roleService.permissions().user.delete&&n.userName===i.currentUser())("ngIfElse",e)}}function yi(t,o){if(t&1){let e=S();l(0,"tr"),f(1,Ci,4,2,"td",33),l(2,"td")(3,"button",34),b("click",function(){let i=u(e).$implicit,r=c(2);return _(r.onEditUser(i))}),d(4),s()(),l(5,"td")(6,"a",35),d(7),s()(),l(8,"td"),d(9),s(),l(10,"td"),d(11),s(),l(12,"td")(13,"span"),d(14),Ue(15,"date"),s()()()}if(t&2){let e=o.$implicit,n=c(2);a(),p("ngIf",n.roleService.permissions().user.delete),a(2),p("disabled",!n.roleService.permissions().user.edit),a(),G(" ",e.userName||e.userID," "),a(2),p("queryParams",I(11,di,e.groupID)),a(),T(e.groupName),a(2),G(" ",e.accessTypeName," "),a(2),G(" ",e.tags.length===0?"All tags":e.tags.length<=5?e.tags.join(", "):e.tags.length+" tags assigned"," "),a(3),T(Ve(15,8,e.lastLogin,"dd MMM HH:mm"))}}function vi(t,o){if(t&1&&d(0),t&2){let e=c(2);Ie(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.count()," entries ")}}function ki(t,o){t&1&&(l(0,"tr")(1,"td",39)(2,"span"),d(3,"No users found. Try adjusting your filters or add a new user."),s()()())}function Ti(t,o){if(t&1){let e=S();l(0,"p-panel")(1,"div",26),y(2,"app-user-tabs"),l(3,"p-table",27),b("onPage",function(i){u(e);let r=c();return _(r.onPageChange(i))})("onRowSelect",function(i){u(e);let r=c();return _(r.onRowSelect(i))})("onRowUnselect",function(i){u(e);let r=c();return _(r.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){u(e);let r=c();return _(r.onHeaderCheckboxToggle(i))}),f(4,gi,12,1,"ng-template",null,3,x)(6,yi,16,13,"ng-template",null,4,x)(8,vi,1,3,"ng-template",null,5,x)(10,ki,4,0,"ng-template",null,6,x),s()()()}if(t&2){let e=c();a(3),p("value",e.store.data())("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.count())}}function Si(t,o){if(t&1&&(l(0,"div",40)(1,"div",19)(2,"div",41)(3,"label",42),d(4,"Group"),s(),y(5,"p-select",43),s()()()),t&2){let e=c();p("formGroup",e.forms.filterForm),a(5),p("showClear",!0)("options",e.store.meta().options.groups)}}function Ii(t,o){if(t&1&&(l(0,"span",44),d(1),s()),t&2){let e=c();a(),T(e.store.hasCheckedRows()?"Edit User":"Invite User")}}function Di(t,o){if(t&1&&(l(0,"small",14),d(1),s()),t&2){let e=o.$implicit;a(),T(e)}}function Ei(t,o){if(t&1&&(l(0,"small",14),d(1),s()),t&2){let e=o.$implicit;a(),T(e)}}function Fi(t,o){if(t&1&&(l(0,"small",14),d(1),s()),t&2){let e=o.$implicit;a(),T(e)}}function Ui(t,o){if(t&1&&(l(0,"small",14),d(1),s()),t&2){let e=o.$implicit;a(),T(e)}}var An=(()=>{class t extends vt{ngOnInit(){this.generateForm()}constructor(){Le(()=>{this.store.metaForm()&&this.generateForm()}),super(),this.store=C(he),this.fb=C(Ge),this.userService=C(ie),this.isLoading=L(!1),this.form=null,this.isDrawerOpen=L(!1),this.router=C(Ae),this.route=C(Oe),this.isDialogFilterVisible=L(!1),this.roleService=C(Ne),this.currentUser=L(null),this.tabs=[{route:"/pages/users/users",label:"Users"},{route:"/pages/users/groups",label:"Groups"}]}ngAfterViewInit(){this.currentUser.set(localStorage.getItem("AUTH_USERNAME")||null)}onPageChange(e){this.store.setFilter(g(h({},this.store.filter()),{pagination:e.first/e.rows+1}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(n=>{this.store.onRowUnselect(n)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}generateForm(){this.forms={filterForm:this.fb.group({pagination:this.fb.control(1),pageSize:this.fb.control(10),groupID:this.fb.control(null)}),userForm:this.fb.group({id:this.fb.control({value:this.store.metaForm().form.id,disabled:this.store.metaForm().form.id!==kt},[K.required]),groupID:this.fb.control(this.store.metaForm().form.groupID,[K.required]),accessTypeID:this.fb.control(this.store.metaForm().form.accessTypeID,[K.required]),listJournalTagID:this.fb.control(this.store.metaForm().form.listJournalTagID??[])})}}onHandleDrawer(){this.isDrawerOpen.update(e=>!e),this.store.getUserFormMeta(this.route.snapshot.params.id||null)}onInviteUser(){let{userForm:e}=this.forms;if(e.invalid){e.markAllAsTouched();return}let n=e.getRawValue(),i;if(this.store.hasCheckedRows()){let[r]=this.store.checkedData();i={id:r,groupID:n.groupID,accessTypeID:n.accessTypeID,listJournalTagID:n.listJournalTagID}}else i=n;this.userService.inviteUser(i).pipe(re(()=>{this.onHandleDrawer(),this.store.setFilter(h({},this.store.filter())),e.reset()})).subscribe()}onSearch(e){this.store.setFilter(g(h({},this.store.filter()),{text:e,pagination:1}))}onOKFilter(){if(this.forms.filterForm.invalid){this.forms.filterForm.markAllAsTouched();return}let{groupID:e}=this.forms.filterForm.value;this.store.setFilter(g(h({},this.store.filter()),{groupID:e})),this.isDialogFilterVisible.update(n=>!n)}onEditUser(e){this.store.onRowSelect(e),this.store.getUserFormMeta(this.store.selectedID()),this.isDrawerOpen.update(n=>!n)}onHideDrawer(){this.store.onHeaderCheckboxToggle(!1)}onDeleteUser(){let e=this.store.checkedData();this.userService.deleteUser(e).pipe(re(()=>{this.store.setFilter(h({},this.store.filter()))})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=Q({type:t,selectors:[["app-user",8,"page"]],features:[$([he]),z],attrs:ci,decls:41,vars:27,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["showCheckbox",""],["pageTitle","User List",3,"search","isDialogFilterVisibleChange","filterConfirmed","isSearchableInput","isFilterable","isDialogFilterVisible","scrollable"],["position","right",3,"visibleChange","onHide","visible"],[1,"row","py-3","row-gap-3",3,"formGroup"],[1,"col-12"],["for","",1,"m-0"],["fluid","","filter","","filterBy","name","formControlName","id","optionLabel","loginID","optionValue","id","placeholder","Select a User",3,"disabled","options","ngClass"],[1,"text-danger"],["filter","","filterBy","name","formControlName","groupID","optionLabel","name","optionValue","id","placeholder","Select a Group","fluid","",3,"options","ngClass"],["filter","","filterBy","name","formControlName","accessTypeID","optionLabel","value","optionValue","key","placeholder","Select Access Type","fluid","",3,"options","ngClass"],[1,"tags-field"],["fluid","","filter","","filterBy","name","formControlName","listJournalTagID","optionLabel","name","optionValue","id","placeholder","Select a Tag","display","chip",3,"options","maxSelectedLabels","ngClass"],[1,"col"],["label","Submit",3,"onClick"],[1,"d-flex","gap-2","flex-wrap"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["label","Invite",3,"onClick",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick"],["label","Invite",3,"onClick"],[1,"d-flex","flex-column","gap-3","py-2"],["dataKey","userID",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","lazy","paginator","rows","totalRecords"],["style","width: 10px",4,"ngIf"],[2,"width","140px"],[2,"width","100px"],[2,"width","130px"],[2,"width","10px"],[4,"ngIf"],[1,"btn","btn-link","fw-light","text-primary","p-0",2,"text-decoration","none",3,"click","disabled"],["routerLink","/pages/users/groups/forms",1,"link","link-primary",3,"queryParams"],[4,"ngIf","ngIfElse"],[3,"value",4,"ngIf"],[3,"value"],["colspan","3"],[1,"row",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["appendTo","body","formControlName","groupID","optionValue","id","optionLabel","name","placeholder","Select a Group",3,"showClear","options"],[1,"fs-5"]],template:function(n,i){if(n&1){let r=S();l(0,"app-main-panel",8),b("search",function(w){return u(r),_(i.onSearch(w))}),pe("isDialogFilterVisibleChange",function(w){return u(r),le(i.isDialogFilterVisible,w)||(i.isDialogFilterVisible=w),_(w)}),b("filterConfirmed",function(){return u(r),_(i.onOKFilter())}),f(1,fi,3,2,"ng-template",null,0,x)(3,Ti,12,5,"ng-template",null,1,x)(5,Si,6,3,"ng-template",null,2,x),s(),l(7,"p-drawer",9),pe("visibleChange",function(w){return u(r),le(i.isDrawerOpen,w)||(i.isDrawerOpen=w),_(w)}),b("onHide",function(){return u(r),_(i.onHideDrawer())}),f(8,Ii,2,1,"ng-template",null,3,x),l(10,"div",10)(11,"div",11)(12,"div")(13,"label",12),d(14,"Users"),s(),y(15,"p-select",13),R(16,Di,2,1,"small",14,M),s()(),l(18,"div",11)(19,"div")(20,"label",12),d(21,"Groups"),s(),y(22,"p-select",15),R(23,Ei,2,1,"small",14,M),s()(),l(25,"div",11)(26,"div")(27,"label",12),d(28,"Access Type"),s(),y(29,"p-select",16),R(30,Fi,2,1,"small",14,M),s()(),l(32,"div",11)(33,"div",17)(34,"label",12),d(35,"Tag"),s(),y(36,"p-multiSelect",18),R(37,Ui,2,1,"small",14,M),s()(),l(39,"div",19)(40,"p-button",20),b("onClick",function(){return u(r),_(i.onInviteUser())}),s()()()()}n&2&&(p("isSearchableInput",!0)("isFilterable",!0),se("isDialogFilterVisible",i.isDialogFilterVisible),p("scrollable",!0),a(7),j(De(18,mi)),se("visible",i.isDrawerOpen),a(3),p("formGroup",i.forms.userForm),a(5),p("disabled",i.store.hasCheckedRows())("options",i.store.metaForm().options.users)("ngClass",I(19,ne,i.isInvalid("id","userForm"))),a(),O(i.getErrors("id","userForm")),a(6),p("options",i.store.metaForm().options.groups)("ngClass",I(21,ne,i.isInvalid("groupID","userForm"))),a(),O(i.getErrors("id","userForm")),a(6),p("options",i.store.metaForm().options.accessTypes)("ngClass",I(23,ne,i.isInvalid("accessTypeID","userForm"))),a(),O(i.getErrors("accessTypeID","userForm")),a(6),p("options",i.store.metaForm().options.journalTags)("maxSelectedLabels",5)("ngClass",I(25,ne,i.isInvalid("listJournalTagID","userForm"))),a(),O(i.getErrors("listJournalTagID","userForm")))},dependencies:[ft,W,Z,J,Re,Ct,wt,bt,xt,at,Y,Dt,ge,$e,Qe,ze,je,qe,rt,it,nt,ot,gt,ht,Tt,lt,st,St,Be,yt],styles:['[_nghost-%COMP%]{display:block} .p-tabs .p-tab{padding:"1rem 1.125rem"!important} .p-panel .p-panel-header{display:none!important}.tags-field[_ngcontent-%COMP%] .p-multiselect-list-container .p-multiselect-list .p-multiselect-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:350px;display:block;margin-left:8px;gap:8px}.tags-field[_ngcontent-%COMP%] .p-multiselect-list-container .p-multiselect-list .p-multiselect-option span{margin-left:10px}'],changeDetection:0})}}return t})();export{An as UserPageComponent};
@@ -1,4 +1,4 @@
1
- import{a as Aa}from"./chunk-VM56C6ZV.js";import{b as _p}from"./chunk-ALLR2NXQ.js";import{a as jr,h as wp,p as xp,w as Cp}from"./chunk-O44DI62I.js";import{A as bp,C as Hn,Ea as vp,Ma as Lr,Na as Vi,Oa as Wi,Va as $r}from"./chunk-MGIEURA2.js";import{d as mp}from"./chunk-DZCJWJUG.js";import{a as yp}from"./chunk-YQYRAH7V.js";import{c as gi,e as Ba,h as Ea,m as fp}from"./chunk-KL3TPLRB.js";import{c as gp,d as Ln,f as $n,h as jn}from"./chunk-F2X3VGZZ.js";import{j as Ur,l as hp,m as ji,n as Da,o as Nr,u as Hi,x as Nn}from"./chunk-DM2JLWKE.js";import{$b as Kt,$c as Rr,Aa as rt,Ba as ip,Cb as fi,Dc as zr,Ea as Pa,Eb as se,Fa as rp,Fc as or,Gc as Ta,Ha as Or,I as Jl,Jc as dp,Lb as ze,Mb as N,Mc as cp,Nb as Mr,Ob as ap,Pb as np,Qb as ii,Rb as dt,Sc as ho,Tb as Mn,Ub as zn,Vb as Rn,Wb as ve,Xb as Ce,Yb as Ae,Zb as Si,_b as Pi,_c as Ut,ac as mi,ca as hi,cd as Un,d as di,da as Ca,db as op,eb as Fa,fc as Rt,g as Ql,gc as X,ha as Sa,hc as sp,ia as Dt,ib as V,ic as lp,lc as pt,mc as Ia,n as Zl,nc as Ke,oc as Qe,pa as ep,qa as Je,r as ci,ra as et,rc as pp,sa as tp,sc as Bt,tc as rr,ua as ti,uc as co,vc as up,yb as Yt,zb as ka}from"./chunk-6QJHEOXN.js";import{a as x,b as J,c as va,d as Ve,e as $e,f as j,g as Ar,h as wa,i as _a,j as xa}from"./chunk-YQFG5XE2.js";var Bp=Ve((Wn,qn)=>{((i,e)=>{typeof define=="function"&&define.amd?define([],e):typeof qn=="object"&&typeof Wn<"u"?qn.exports=e():i.Papa=e()})(Wn,function i(){var e=typeof self<"u"?self:typeof window<"u"?window:e!==void 0?e:{},t,r=!e.document&&!!e.postMessage,o=e.IS_PAPA_WORKER||!1,a={},n=0,s={};function l(b){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(v){var P=oe(v);P.chunkSize=parseInt(P.chunkSize),v.step||v.chunk||(P.chunkSize=null),this._handle=new C(P),(this._handle.streamer=this)._config=P}.call(this,b),this.parseChunk=function(v,P){var M=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<M){let K=this._config.newline;K||(H=this._config.quoteChar||'"',K=this._handle.guessLineEndings(v,H)),v=[...v.split(K).slice(M)].join(K)}this.isFirstChunk&&le(this._config.beforeFirstChunk)&&(H=this._config.beforeFirstChunk(v))!==void 0&&(v=H),this.isFirstChunk=!1,this._halted=!1;var M=this._partialLine+v,H=(this._partialLine="",this._handle.parse(M,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(v=H.meta.cursor,M=(this._finished||(this._partialLine=M.substring(v-this._baseIndex),this._baseIndex=v),H&&H.data&&(this._rowCount+=H.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)e.postMessage({results:H,workerId:s.WORKER_ID,finished:M});else if(le(this._config.chunk)&&!P){if(this._config.chunk(H,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=H=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(H.data),this._completeResults.errors=this._completeResults.errors.concat(H.errors),this._completeResults.meta=H.meta),this._completed||!M||!le(this._config.complete)||H&&H.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),M||H&&H.meta.paused||this._nextChunk(),H}this._halted=!0},this._sendError=function(v){le(this._config.error)?this._config.error(v):o&&this._config.error&&e.postMessage({workerId:s.WORKER_ID,error:v,finished:!1})}}function d(b){var v;(b=b||{}).chunkSize||(b.chunkSize=s.RemoteChunkSize),l.call(this,b),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(P){this._input=P,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(v=new XMLHttpRequest,this._config.withCredentials&&(v.withCredentials=this._config.withCredentials),r||(v.onload=ue(this._chunkLoaded,this),v.onerror=ue(this._chunkError,this)),v.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var P,M=this._config.downloadRequestHeaders;for(P in M)v.setRequestHeader(P,M[P])}var H;this._config.chunkSize&&(H=this._start+this._config.chunkSize-1,v.setRequestHeader("Range","bytes="+this._start+"-"+H));try{v.send(this._config.downloadRequestBody)}catch(K){this._chunkError(K.message)}r&&v.status===0&&this._chunkError()}},this._chunkLoaded=function(){v.readyState===4&&(v.status<200||400<=v.status?this._chunkError():(this._start+=this._config.chunkSize||v.responseText.length,this._finished=!this._config.chunkSize||this._start>=(P=>(P=P.getResponseHeader("Content-Range"))!==null?parseInt(P.substring(P.lastIndexOf("/")+1)):-1)(v),this.parseChunk(v.responseText)))},this._chunkError=function(P){P=v.statusText||P,this._sendError(new Error(P))}}function m(b){(b=b||{}).chunkSize||(b.chunkSize=s.LocalChunkSize),l.call(this,b);var v,P,M=typeof FileReader<"u";this.stream=function(H){this._input=H,P=H.slice||H.webkitSlice||H.mozSlice,M?((v=new FileReader).onload=ue(this._chunkLoaded,this),v.onerror=ue(this._chunkError,this)):v=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var H=this._input,K=(this._config.chunkSize&&(K=Math.min(this._start+this._config.chunkSize,this._input.size),H=P.call(H,this._start,K)),v.readAsText(H,this._config.encoding));M||this._chunkLoaded({target:{result:K}})},this._chunkLoaded=function(H){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(H.target.result)},this._chunkError=function(){this._sendError(v.error)}}function f(b){var v;l.call(this,b=b||{}),this.stream=function(P){return v=P,this._nextChunk()},this._nextChunk=function(){var P,M;if(!this._finished)return P=this._config.chunkSize,v=P?(M=v.substring(0,P),v.substring(P)):(M=v,""),this._finished=!v,this.parseChunk(M)}}function S(b){l.call(this,b=b||{});var v=[],P=!0,M=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(H){this._input=H,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){M&&v.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),v.length?this.parseChunk(v.shift()):P=!0},this._streamData=ue(function(H){try{v.push(typeof H=="string"?H:H.toString(this._config.encoding)),P&&(P=!1,this._checkIsFinished(),this.parseChunk(v.shift()))}catch(K){this._streamError(K)}},this),this._streamError=ue(function(H){this._streamCleanUp(),this._sendError(H)},this),this._streamEnd=ue(function(){this._streamCleanUp(),M=!0,this._streamData("")},this),this._streamCleanUp=ue(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function C(b){var v,P,M,H,K=Math.pow(2,53),ge=-K,Oe=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,je=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,me=this,Te=0,ae=0,ye=!1,fe=!1,be=[],ee={data:[],errors:[],meta:{}};function O(R){return b.skipEmptyLines==="greedy"?R.join("").trim()==="":R.length===1&&R[0].length===0}function F(){if(ee&&M&&(E("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),M=!1),b.skipEmptyLines&&(ee.data=ee.data.filter(function(Q){return!O(Q)})),D()){let Q=function(ie,ce){le(b.transformHeader)&&(ie=b.transformHeader(ie,ce)),be.push(ie)};var G=Q;if(ee)if(Array.isArray(ee.data[0])){for(var R=0;D()&&R<ee.data.length;R++)ee.data[R].forEach(Q);ee.data.splice(0,1)}else ee.data.forEach(Q)}function L(Q,ie){for(var ce=b.header?{}:[],pe=0;pe<Q.length;pe++){var ne=pe,Pe=Q[pe],Pe=((q,we)=>(xe=>(b.dynamicTypingFunction&&b.dynamicTyping[xe]===void 0&&(b.dynamicTyping[xe]=b.dynamicTypingFunction(xe)),(b.dynamicTyping[xe]||b.dynamicTyping)===!0))(q)?we==="true"||we==="TRUE"||we!=="false"&&we!=="FALSE"&&((xe=>{if(Oe.test(xe)&&(xe=parseFloat(xe),ge<xe&&xe<K))return 1})(we)?parseFloat(we):je.test(we)?new Date(we):we===""?null:we):we)(ne=b.header?pe>=be.length?"__parsed_extra":be[pe]:ne,Pe=b.transform?b.transform(Pe,ne):Pe);ne==="__parsed_extra"?(ce[ne]=ce[ne]||[],ce[ne].push(Pe)):ce[ne]=Pe}return b.header&&(pe>be.length?E("FieldMismatch","TooManyFields","Too many fields: expected "+be.length+" fields but parsed "+pe,ae+ie):pe<be.length&&E("FieldMismatch","TooFewFields","Too few fields: expected "+be.length+" fields but parsed "+pe,ae+ie)),ce}var de;ee&&(b.header||b.dynamicTyping||b.transform)&&(de=1,!ee.data.length||Array.isArray(ee.data[0])?(ee.data=ee.data.map(L),de=ee.data.length):ee.data=L(ee.data,0),b.header&&ee.meta&&(ee.meta.fields=be),ae+=de)}function D(){return b.header&&be.length===0}function E(R,L,de,G){R={type:R,code:L,message:de},G!==void 0&&(R.row=G),ee.errors.push(R)}le(b.step)&&(H=b.step,b.step=function(R){ee=R,D()?F():(F(),ee.data.length!==0&&(Te+=R.data.length,b.preview&&Te>b.preview?P.abort():(ee.data=ee.data[0],H(ee,me))))}),this.parse=function(R,L,de){var G=b.quoteChar||'"',G=(b.newline||(b.newline=this.guessLineEndings(R,G)),M=!1,b.delimiter?le(b.delimiter)&&(b.delimiter=b.delimiter(R),ee.meta.delimiter=b.delimiter):((G=((Q,ie,ce,pe,ne)=>{var Pe,q,we,xe;ne=ne||[","," ","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var bt=0;bt<ne.length;bt++){for(var ht,It=ne[bt],Ne=0,nt=0,Le=0,We=(we=void 0,new Y({comments:pe,delimiter:It,newline:ie,preview:10}).parse(Q)),Me=0;Me<We.data.length;Me++)ce&&O(We.data[Me])?Le++:(ht=We.data[Me].length,nt+=ht,we===void 0?we=ht:0<ht&&(Ne+=Math.abs(ht-we),we=ht));0<We.data.length&&(nt/=We.data.length-Le),(q===void 0||Ne<=q)&&(xe===void 0||xe<nt)&&1.99<nt&&(q=Ne,Pe=It,xe=nt)}return{successful:!!(b.delimiter=Pe),bestDelimiter:Pe}})(R,b.newline,b.skipEmptyLines,b.comments,b.delimitersToGuess)).successful?b.delimiter=G.bestDelimiter:(M=!0,b.delimiter=s.DefaultDelimiter),ee.meta.delimiter=b.delimiter),oe(b));return b.preview&&b.header&&G.preview++,v=R,P=new Y(G),ee=P.parse(v,L,de),F(),ye?{meta:{paused:!0}}:ee||{meta:{paused:!1}}},this.paused=function(){return ye},this.pause=function(){ye=!0,P.abort(),v=le(b.chunk)?"":v.substring(P.getCharIndex())},this.resume=function(){me.streamer._halted?(ye=!1,me.streamer.parseChunk(v,!0)):setTimeout(me.resume,3)},this.aborted=function(){return fe},this.abort=function(){fe=!0,P.abort(),ee.meta.aborted=!0,le(b.complete)&&b.complete(ee),v=""},this.guessLineEndings=function(Q,G){Q=Q.substring(0,1048576);var G=new RegExp(B(G)+"([^]*?)"+B(G),"gm"),de=(Q=Q.replace(G,"")).split("\r"),G=Q.split(`
1
+ import{a as Aa}from"./chunk-VM56C6ZV.js";import{b as _p}from"./chunk-ALLR2NXQ.js";import{a as jr,h as wp,p as xp,w as Cp}from"./chunk-O44DI62I.js";import{A as bp,C as Hn,Ea as vp,Ma as Lr,Na as Vi,Oa as Wi,Va as $r}from"./chunk-MGIEURA2.js";import{d as mp}from"./chunk-DZCJWJUG.js";import{a as yp}from"./chunk-JBYPGHPN.js";import{c as gp,d as Ln,f as $n,h as jn}from"./chunk-F2X3VGZZ.js";import{c as gi,e as Ba,h as Ea,m as fp}from"./chunk-KL3TPLRB.js";import{j as Ur,l as hp,m as ji,n as Da,o as Nr,u as Hi,x as Nn}from"./chunk-DM2JLWKE.js";import{$b as Kt,$c as Rr,Aa as rt,Ba as ip,Cb as fi,Dc as zr,Ea as Pa,Eb as se,Fa as rp,Fc as or,Gc as Ta,Ha as Or,I as Jl,Jc as dp,Lb as ze,Mb as N,Mc as cp,Nb as Mr,Ob as ap,Pb as np,Qb as ii,Rb as dt,Sc as ho,Tb as Mn,Ub as zn,Vb as Rn,Wb as ve,Xb as Ce,Yb as Ae,Zb as Si,_b as Pi,_c as Ut,ac as mi,ca as hi,cd as Un,d as di,da as Ca,db as op,eb as Fa,fc as Rt,g as Ql,gc as X,ha as Sa,hc as sp,ia as Dt,ib as V,ic as lp,lc as pt,mc as Ia,n as Zl,nc as Ke,oc as Qe,pa as ep,qa as Je,r as ci,ra as et,rc as pp,sa as tp,sc as Bt,tc as rr,ua as ti,uc as co,vc as up,yb as Yt,zb as ka}from"./chunk-6QJHEOXN.js";import{a as x,b as J,c as va,d as Ve,e as $e,f as j,g as Ar,h as wa,i as _a,j as xa}from"./chunk-YQFG5XE2.js";var Bp=Ve((Wn,qn)=>{((i,e)=>{typeof define=="function"&&define.amd?define([],e):typeof qn=="object"&&typeof Wn<"u"?qn.exports=e():i.Papa=e()})(Wn,function i(){var e=typeof self<"u"?self:typeof window<"u"?window:e!==void 0?e:{},t,r=!e.document&&!!e.postMessage,o=e.IS_PAPA_WORKER||!1,a={},n=0,s={};function l(b){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(v){var P=oe(v);P.chunkSize=parseInt(P.chunkSize),v.step||v.chunk||(P.chunkSize=null),this._handle=new C(P),(this._handle.streamer=this)._config=P}.call(this,b),this.parseChunk=function(v,P){var M=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<M){let K=this._config.newline;K||(H=this._config.quoteChar||'"',K=this._handle.guessLineEndings(v,H)),v=[...v.split(K).slice(M)].join(K)}this.isFirstChunk&&le(this._config.beforeFirstChunk)&&(H=this._config.beforeFirstChunk(v))!==void 0&&(v=H),this.isFirstChunk=!1,this._halted=!1;var M=this._partialLine+v,H=(this._partialLine="",this._handle.parse(M,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(v=H.meta.cursor,M=(this._finished||(this._partialLine=M.substring(v-this._baseIndex),this._baseIndex=v),H&&H.data&&(this._rowCount+=H.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)e.postMessage({results:H,workerId:s.WORKER_ID,finished:M});else if(le(this._config.chunk)&&!P){if(this._config.chunk(H,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=H=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(H.data),this._completeResults.errors=this._completeResults.errors.concat(H.errors),this._completeResults.meta=H.meta),this._completed||!M||!le(this._config.complete)||H&&H.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),M||H&&H.meta.paused||this._nextChunk(),H}this._halted=!0},this._sendError=function(v){le(this._config.error)?this._config.error(v):o&&this._config.error&&e.postMessage({workerId:s.WORKER_ID,error:v,finished:!1})}}function d(b){var v;(b=b||{}).chunkSize||(b.chunkSize=s.RemoteChunkSize),l.call(this,b),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(P){this._input=P,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(v=new XMLHttpRequest,this._config.withCredentials&&(v.withCredentials=this._config.withCredentials),r||(v.onload=ue(this._chunkLoaded,this),v.onerror=ue(this._chunkError,this)),v.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var P,M=this._config.downloadRequestHeaders;for(P in M)v.setRequestHeader(P,M[P])}var H;this._config.chunkSize&&(H=this._start+this._config.chunkSize-1,v.setRequestHeader("Range","bytes="+this._start+"-"+H));try{v.send(this._config.downloadRequestBody)}catch(K){this._chunkError(K.message)}r&&v.status===0&&this._chunkError()}},this._chunkLoaded=function(){v.readyState===4&&(v.status<200||400<=v.status?this._chunkError():(this._start+=this._config.chunkSize||v.responseText.length,this._finished=!this._config.chunkSize||this._start>=(P=>(P=P.getResponseHeader("Content-Range"))!==null?parseInt(P.substring(P.lastIndexOf("/")+1)):-1)(v),this.parseChunk(v.responseText)))},this._chunkError=function(P){P=v.statusText||P,this._sendError(new Error(P))}}function m(b){(b=b||{}).chunkSize||(b.chunkSize=s.LocalChunkSize),l.call(this,b);var v,P,M=typeof FileReader<"u";this.stream=function(H){this._input=H,P=H.slice||H.webkitSlice||H.mozSlice,M?((v=new FileReader).onload=ue(this._chunkLoaded,this),v.onerror=ue(this._chunkError,this)):v=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var H=this._input,K=(this._config.chunkSize&&(K=Math.min(this._start+this._config.chunkSize,this._input.size),H=P.call(H,this._start,K)),v.readAsText(H,this._config.encoding));M||this._chunkLoaded({target:{result:K}})},this._chunkLoaded=function(H){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(H.target.result)},this._chunkError=function(){this._sendError(v.error)}}function f(b){var v;l.call(this,b=b||{}),this.stream=function(P){return v=P,this._nextChunk()},this._nextChunk=function(){var P,M;if(!this._finished)return P=this._config.chunkSize,v=P?(M=v.substring(0,P),v.substring(P)):(M=v,""),this._finished=!v,this.parseChunk(M)}}function S(b){l.call(this,b=b||{});var v=[],P=!0,M=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(H){this._input=H,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){M&&v.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),v.length?this.parseChunk(v.shift()):P=!0},this._streamData=ue(function(H){try{v.push(typeof H=="string"?H:H.toString(this._config.encoding)),P&&(P=!1,this._checkIsFinished(),this.parseChunk(v.shift()))}catch(K){this._streamError(K)}},this),this._streamError=ue(function(H){this._streamCleanUp(),this._sendError(H)},this),this._streamEnd=ue(function(){this._streamCleanUp(),M=!0,this._streamData("")},this),this._streamCleanUp=ue(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function C(b){var v,P,M,H,K=Math.pow(2,53),ge=-K,Oe=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,je=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,me=this,Te=0,ae=0,ye=!1,fe=!1,be=[],ee={data:[],errors:[],meta:{}};function O(R){return b.skipEmptyLines==="greedy"?R.join("").trim()==="":R.length===1&&R[0].length===0}function F(){if(ee&&M&&(E("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),M=!1),b.skipEmptyLines&&(ee.data=ee.data.filter(function(Q){return!O(Q)})),D()){let Q=function(ie,ce){le(b.transformHeader)&&(ie=b.transformHeader(ie,ce)),be.push(ie)};var G=Q;if(ee)if(Array.isArray(ee.data[0])){for(var R=0;D()&&R<ee.data.length;R++)ee.data[R].forEach(Q);ee.data.splice(0,1)}else ee.data.forEach(Q)}function L(Q,ie){for(var ce=b.header?{}:[],pe=0;pe<Q.length;pe++){var ne=pe,Pe=Q[pe],Pe=((q,we)=>(xe=>(b.dynamicTypingFunction&&b.dynamicTyping[xe]===void 0&&(b.dynamicTyping[xe]=b.dynamicTypingFunction(xe)),(b.dynamicTyping[xe]||b.dynamicTyping)===!0))(q)?we==="true"||we==="TRUE"||we!=="false"&&we!=="FALSE"&&((xe=>{if(Oe.test(xe)&&(xe=parseFloat(xe),ge<xe&&xe<K))return 1})(we)?parseFloat(we):je.test(we)?new Date(we):we===""?null:we):we)(ne=b.header?pe>=be.length?"__parsed_extra":be[pe]:ne,Pe=b.transform?b.transform(Pe,ne):Pe);ne==="__parsed_extra"?(ce[ne]=ce[ne]||[],ce[ne].push(Pe)):ce[ne]=Pe}return b.header&&(pe>be.length?E("FieldMismatch","TooManyFields","Too many fields: expected "+be.length+" fields but parsed "+pe,ae+ie):pe<be.length&&E("FieldMismatch","TooFewFields","Too few fields: expected "+be.length+" fields but parsed "+pe,ae+ie)),ce}var de;ee&&(b.header||b.dynamicTyping||b.transform)&&(de=1,!ee.data.length||Array.isArray(ee.data[0])?(ee.data=ee.data.map(L),de=ee.data.length):ee.data=L(ee.data,0),b.header&&ee.meta&&(ee.meta.fields=be),ae+=de)}function D(){return b.header&&be.length===0}function E(R,L,de,G){R={type:R,code:L,message:de},G!==void 0&&(R.row=G),ee.errors.push(R)}le(b.step)&&(H=b.step,b.step=function(R){ee=R,D()?F():(F(),ee.data.length!==0&&(Te+=R.data.length,b.preview&&Te>b.preview?P.abort():(ee.data=ee.data[0],H(ee,me))))}),this.parse=function(R,L,de){var G=b.quoteChar||'"',G=(b.newline||(b.newline=this.guessLineEndings(R,G)),M=!1,b.delimiter?le(b.delimiter)&&(b.delimiter=b.delimiter(R),ee.meta.delimiter=b.delimiter):((G=((Q,ie,ce,pe,ne)=>{var Pe,q,we,xe;ne=ne||[","," ","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var bt=0;bt<ne.length;bt++){for(var ht,It=ne[bt],Ne=0,nt=0,Le=0,We=(we=void 0,new Y({comments:pe,delimiter:It,newline:ie,preview:10}).parse(Q)),Me=0;Me<We.data.length;Me++)ce&&O(We.data[Me])?Le++:(ht=We.data[Me].length,nt+=ht,we===void 0?we=ht:0<ht&&(Ne+=Math.abs(ht-we),we=ht));0<We.data.length&&(nt/=We.data.length-Le),(q===void 0||Ne<=q)&&(xe===void 0||xe<nt)&&1.99<nt&&(q=Ne,Pe=It,xe=nt)}return{successful:!!(b.delimiter=Pe),bestDelimiter:Pe}})(R,b.newline,b.skipEmptyLines,b.comments,b.delimitersToGuess)).successful?b.delimiter=G.bestDelimiter:(M=!0,b.delimiter=s.DefaultDelimiter),ee.meta.delimiter=b.delimiter),oe(b));return b.preview&&b.header&&G.preview++,v=R,P=new Y(G),ee=P.parse(v,L,de),F(),ye?{meta:{paused:!0}}:ee||{meta:{paused:!1}}},this.paused=function(){return ye},this.pause=function(){ye=!0,P.abort(),v=le(b.chunk)?"":v.substring(P.getCharIndex())},this.resume=function(){me.streamer._halted?(ye=!1,me.streamer.parseChunk(v,!0)):setTimeout(me.resume,3)},this.aborted=function(){return fe},this.abort=function(){fe=!0,P.abort(),ee.meta.aborted=!0,le(b.complete)&&b.complete(ee),v=""},this.guessLineEndings=function(Q,G){Q=Q.substring(0,1048576);var G=new RegExp(B(G)+"([^]*?)"+B(G),"gm"),de=(Q=Q.replace(G,"")).split("\r"),G=Q.split(`
2
2
  `),Q=1<G.length&&G[0].length<de[0].length;if(de.length===1||Q)return`
3
3
  `;for(var ie=0,ce=0;ce<de.length;ce++)de[ce][0]===`
4
4
  `&&ie++;return ie>=de.length/2?`\r
@@ -1 +1 @@
1
- import{a as y,b as J}from"./chunk-VKUW7E75.js";import"./chunk-LBXNL7E4.js";import{m as V}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as j,b as R}from"./chunk-5U7KZJ3H.js";import"./chunk-FHJOSHI3.js";import{i as z}from"./chunk-J3HFAWXU.js";import"./chunk-VM56C6ZV.js";import{a as G,b as H}from"./chunk-ISIYG4D5.js";import"./chunk-ALLR2NXQ.js";import"./chunk-FNGX2XFA.js";import"./chunk-BFEM6LX7.js";import{w as D,x as N,y as L,z as q}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import"./chunk-TOR7QRRB.js";import{a as O}from"./chunk-YQYRAH7V.js";import"./chunk-KL3TPLRB.js";import"./chunk-RVUOVLL5.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import{p as E,u as I}from"./chunk-DM2JLWKE.js";import{Dc as F,Eb as _,Ec as b,Mb as l,Oc as s,Pb as h,Pc as m,Rb as x,Sc as S,W as k,Wb as o,Xb as n,Y as w,Yb as u,_ as B,ac as v,fc as T,gc as a,h as M,ia as c,ib as r,qa as C,ra as d,s as g,sa as P,ta as $,yb as A}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var K=()=>({height:"calc(100vh - 100px)"});function Q(t,f){if(t&1){let e=v();o(0,"p-button",6),T("onClick",function(){C(e);let p=a(2);return d(p.onFormatCOAConfig())}),n()}}function U(t,f){if(t&1){let e=v();o(0,"p-button",7),s(1,"async"),s(2,"async"),T("onClick",function(){C(e);let p=a(2);return d(p.onMigrateCoaConfig())}),n()}if(t&2){let e=a(2);l("disabled",m(1,2,e.countInBooks$)!==0)("pTooltip",m(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function W(t,f){if(t&1&&(o(0,"div",3),_(1,Q,1,0,"p-button",4)(2,U,3,6,"p-button",5),n()),t&2){let e=a();r(),x(e.roleService.permissions().migrate.delete?1:-1),r(),x(e.roleService.permissions().migrate.create?2:-1)}}function X(t,f){if(t&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),s(4,"async"),P(),o(5,"svg",10),u(6,"path",11),n(),$(),u(7,"app-migration-cards",12),s(8,"async"),n()()()),t&2){let e=a();h(b(12,K)),r(),h(b(13,K)),r(2),l("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),l("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var xe=(()=>{class t{constructor(){this.migrateService=c(y),this.toastr=c(O),this.refresh$=new M(void 0),this.pageTitle="Chart of Account Configuration",this.roleService=c(V)}ngOnInit(){let e=this.refresh$.pipe(w(()=>this.migrateService.getCOAConfigurationCount()),B(i=>console.log("API response:",i)),k(1));this.countInPOS$=e.pipe(g(i=>Number(i.pos))),this.countInBooks$=e.pipe(g(i=>Number(i.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-coa-configuration"]],features:[F([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(o(0,"app-main-panel",2),_(1,W,3,2,"ng-template",null,0,S)(3,X,9,14,"ng-template",null,1,S),n()),i&2&&l("pageTitle",p.pageTitle)},dependencies:[z,I,E,N,D,R,j,H,G,q,L,J],encapsulation:2})}}return t})();export{xe as CoaConfigurationComponent};
1
+ import{a as y,b as J}from"./chunk-NTVIX4GB.js";import"./chunk-JPNJTPYJ.js";import{m as V}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as j,b as R}from"./chunk-5U7KZJ3H.js";import"./chunk-FHJOSHI3.js";import{i as z}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as G,b as H}from"./chunk-ISIYG4D5.js";import"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{w as D,x as N,y as L,z as q}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import"./chunk-MGIEURA2.js";import"./chunk-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import{a as O}from"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{p as E,u as I}from"./chunk-DM2JLWKE.js";import{Dc as F,Eb as _,Ec as b,Mb as l,Oc as s,Pb as h,Pc as m,Rb as x,Sc as S,W as k,Wb as o,Xb as n,Y as w,Yb as u,_ as B,ac as v,fc as T,gc as a,h as M,ia as c,ib as r,qa as C,ra as d,s as g,sa as P,ta as $,yb as A}from"./chunk-6QJHEOXN.js";import"./chunk-YQFG5XE2.js";var K=()=>({height:"calc(100vh - 100px)"});function Q(t,f){if(t&1){let e=v();o(0,"p-button",6),T("onClick",function(){C(e);let p=a(2);return d(p.onFormatCOAConfig())}),n()}}function U(t,f){if(t&1){let e=v();o(0,"p-button",7),s(1,"async"),s(2,"async"),T("onClick",function(){C(e);let p=a(2);return d(p.onMigrateCoaConfig())}),n()}if(t&2){let e=a(2);l("disabled",m(1,2,e.countInBooks$)!==0)("pTooltip",m(2,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function W(t,f){if(t&1&&(o(0,"div",3),_(1,Q,1,0,"p-button",4)(2,U,3,6,"p-button",5),n()),t&2){let e=a();r(),x(e.roleService.permissions().migrate.delete?1:-1),r(),x(e.roleService.permissions().migrate.create?2:-1)}}function X(t,f){if(t&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",8),u(3,"app-migration-cards",9),s(4,"async"),P(),o(5,"svg",10),u(6,"path",11),n(),$(),u(7,"app-migration-cards",12),s(8,"async"),n()()()),t&2){let e=a();h(b(12,K)),r(),h(b(13,K)),r(2),l("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),r(4),l("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var xe=(()=>{class t{constructor(){this.migrateService=c(y),this.toastr=c(O),this.refresh$=new M(void 0),this.pageTitle="Chart of Account Configuration",this.roleService=c(V)}ngOnInit(){let e=this.refresh$.pipe(w(()=>this.migrateService.getCOAConfigurationCount()),B(i=>console.log("API response:",i)),k(1));this.countInPOS$=e.pipe(g(i=>Number(i.pos))),this.countInBooks$=e.pipe(g(i=>Number(i.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(i=>{this.refresh$.next(),this.toastr.success(i.message,"Format Successful")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-coa-configuration"]],features:[F([y])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger"],["label","Create","tooltipPosition","left",3,"disabled","pTooltip"],["label","Format","severity","danger",3,"onClick"],["label","Create","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(i,p){i&1&&(o(0,"app-main-panel",2),_(1,W,3,2,"ng-template",null,0,S)(3,X,9,14,"ng-template",null,1,S),n()),i&2&&l("pageTitle",p.pageTitle)},dependencies:[z,I,E,N,D,R,j,H,G,q,L,J],encapsulation:2})}}return t})();export{xe as CoaConfigurationComponent};
@@ -0,0 +1 @@
1
+ import{a as F}from"./chunk-WPHZJHC6.js";import{a as ze}from"./chunk-SVGPDGYN.js";import{a as je,b as Be}from"./chunk-LO4HJ77Y.js";import{a as oe}from"./chunk-GQ7SPEZH.js";import{b as A}from"./chunk-JPNJTPYJ.js";import{a as Me}from"./chunk-XKI7WLHE.js";import"./chunk-KQZMRRMA.js";import"./chunk-ZC7ZENN7.js";import"./chunk-WL6ZZCYW.js";import{a as z,b as j}from"./chunk-3VQUNDVT.js";import{b as ke,g as Ne,h as Pe,i as Re}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import{a as De,b as Ae}from"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as Fe,b as Je}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as Ve}from"./chunk-JPKZVL57.js";import"./chunk-VM56C6ZV.js";import{a as xe,b as Ce}from"./chunk-ISIYG4D5.js";import{a as ve,b as y,c as ye,d as we,e as Te,f as Ie,g as Ee}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{n as fe,o as _e,w as ge,x as he,y as Se,z as be}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{b as re,c as ae,e as le,f as pe,k as me,m as se,p as ce,v as de,y as ue}from"./chunk-MGIEURA2.js";import"./chunk-DZCJWJUG.js";import"./chunk-VQ62YSFR.js";import"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{j as Y,l as Z,m as ee,p as te,r as ie,u as ne}from"./chunk-DM2JLWKE.js";import{Cb as K,Dc as Q,Eb as x,Fc as V,Ha as P,Mb as c,Oc as I,Pc as X,Qc as D,Sc as v,Wb as r,Xb as o,Y as N,Yb as S,_ as O,ac as w,bd as E,c as J,db as U,eb as L,fc as T,gc as _,ia as C,ib as l,qa as g,ra as h,s as k,sc as s,tc as b,uc as R,wc as W,xc as $,yb as G,yc as M,zc as q}from"./chunk-6QJHEOXN.js";import{a as d,b as f}from"./chunk-YQFG5XE2.js";var Ke={data:{data:[],totalCount:0},filter:{number:null,outletName:null,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0},meta:{options:{outlets:[]},filter:{number:null,outletName:null,from:null,to:null,supplierID:null,pageNumber:1,pageSize:20,export:!1,exportPageNumber:1,exportPageSize:1e4,paymentState:0}}},B=ye(Ee(Ke),we(t=>({first:E(()=>(t.filter().pageNumber-1)*t.filter().pageSize+1),end:E(()=>Math.min(t.filter().pageNumber*t.filter().pageSize,t.data().totalCount)),hasCheckedRows:E(()=>t.data().data.some(a=>a.checked)),checkedAPCollection:E(()=>t.data().data.filter(a=>a.checked).map(a=>a.id))})),Ie(t=>{let a=C(F),e=C(A);return{updateFilter(n){y(t,i=>f(d({},i),{filter:d(d({},i.filter),n)}))},onRowSelect(n){y(t,i=>{let u=i.data.data.map(m=>m.id===n.id?f(d({},m),{checked:!0}):m);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onRowUnselect(n){y(t,i=>{let u=i.data.data.map(m=>m.id===n.id?f(d({},m),{checked:!1}):m);return f(d({},i),{data:f(d({},i.data),{data:u})})})},onHeaderCheckboxToggle(n){y(t,i=>{let u=i.data.data.map(m=>f(d({},m),{checked:n}));return f(d({},i),{data:f(d({},i.data),{data:u})})})},getAPLoader:z(J(N(()=>a.getAPJournalLoader().pipe(j({next:n=>{y(t,i=>f(d({},i),{meta:n}))},error:n=>{console.error("Error fetching AP journal:",n)}}))))),getARCollection:z(J(k(n=>Object.entries(n).reduce((i,[u,m])=>(m!=null&&(i[u]=m),i),{})),N(n=>a.getAPJournal(n).pipe(k(i=>f(d({},i),{data:i.data.map(u=>f(d({},u),{due:e.from(u.due)?e.from(u.due).format():null,checked:!1}))})),j({next:i=>{y(t,u=>f(d({},u),{data:i}))},error:i=>{console.error("Error fetching customer invoice:",i)}})))))}}),Te(t=>({onInit:()=>{t.getAPLoader(),t.getARCollection(t.filter)}})));var H=t=>({"ng-invalid ng-dirty":t});function We(t,a){if(t&1){let e=w();r(0,"p-button",10),T("onClick",function(){g(e);let n=_(2);return h(n.onCreateJournal())}),o()}}function $e(t,a){if(t&1&&x(0,We,1,0,"p-button",9),t&2){let e=_();c("ngIf",e.store.hasCheckedRows())}}function qe(t,a){t&1&&(r(0,"tr")(1,"th",12),S(2,"p-tableHeaderCheckbox"),o(),r(3,"th",13),s(4,"Tag"),o(),r(5,"th",14),s(6,"Number"),o(),r(7,"th",15),s(8,"Supplier"),o(),r(9,"th",16),s(10,"Date"),o(),r(11,"th",16),s(12,"Due"),o(),r(13,"th",15),s(14,"Note"),o(),r(15,"th",17),s(16,"Payment"),o(),S(17,"th",18),o())}function Qe(t,a){if(t&1&&(r(0,"tr")(1,"td"),S(2,"p-tableCheckbox",19),o(),r(3,"td"),s(4),o(),r(5,"td")(6,"a",20),s(7),o()(),r(8,"td"),s(9),o(),r(10,"td"),s(11),I(12,"date"),o(),r(13,"td"),s(14),I(15,"date"),o(),r(16,"td"),S(17,"div",21),o(),r(18,"td"),s(19),o(),r(20,"td"),S(21,"p-button",22),o()()),t&2){let e=a.$implicit,p=_(2);l(2),c("value",e),l(2),b(e.outlet),l(2),c("href",p.authService.getTenantExternalURL()+"/menu/Debt/Debt/Join_Bill/New_Join_Bill/Info?ID="+e.id,L),l(),R(" ",e.number," "),l(2),b(e.customer),l(2),b(D(12,12,e.date,"d MMM y")),l(3),b(e.due?D(15,15,e.due,"d MMM y hh:mm"):"-"),l(3),c("innerHTML",e.note,U),l(2),b(e.payment),l(2),c("icon",e.integrated?"fa-solid fa-circle-check":"fa-solid fa-circle-xmark")("severity",e.integrated?"success":"danger")("text",!0)}}function Xe(t,a){if(t&1&&s(0),t&2){let e=_(2);W(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Ye(t,a){t&1&&(r(0,"tr")(1,"td",23)(2,"span"),s(3,"No records found."),o()()())}function Ze(t,a){if(t&1){let e=w();r(0,"p-panel")(1,"p-table",11),T("onPage",function(n){g(e);let i=_();return h(i.onPageChange(n))})("onHeaderCheckboxToggle",function(n){g(e);let i=_();return h(i.onHeaderCheckboxToggle(n))})("onRowSelect",function(n){g(e);let i=_();return h(i.onRowSelect(n))})("onRowUnselect",function(n){g(e);let i=_();return h(i.onRowUnselect(n))}),x(2,qe,18,0,"ng-template",null,3,v)(4,Qe,22,18,"ng-template",null,4,v)(6,Xe,1,3,"ng-template",null,5,v)(8,Ye,4,0,"ng-template",null,6,v),o()()}if(t&2){let e=_();l(),c("value",e.store.data().data)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.data().totalCount)("lazy",!0)}}function et(t,a){if(t&1&&(r(0,"span",34),s(1),I(2,"truncate"),o()),t&2){let e=a.$implicit;c("pTooltip",e.name),l(),R(" ",D(2,2,e.name,30)," ")}}function tt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function it(t,a){if(t&1&&(r(0,"div"),x(1,tt,3,1,"div",35),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("from"))}}function nt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function ot(t,a){if(t&1&&(r(0,"div"),x(1,nt,3,1,"div",35),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("to"))}}function rt(t,a){if(t&1&&(r(0,"div")(1,"span",36),s(2),o()()),t&2){let e=a.$implicit;l(2),b(e)}}function at(t,a){if(t&1&&(r(0,"div"),x(1,rt,3,1,"div",35),o()),t&2){let e=_(2);l(),c("ngForOf",e.getErrors("pageSize"))}}function lt(t,a){if(t&1){let e=w();r(0,"form",24)(1,"div",25)(2,"label",26),s(3,"Tag"),o(),r(4,"p-select",27),x(5,et,3,5,"ng-template",null,7,v),o()(),r(7,"div",25)(8,"label",26),s(9,"From - To"),o(),r(10,"div",28),S(11,"p-datepicker",29),x(12,it,2,1,"div",30),S(13,"p-datepicker",31),x(14,ot,2,1,"div",30),o()(),r(15,"div",25)(16,"label",26),s(17,"Supplier"),o(),r(18,"p-autocomplete",32),I(19,"async"),T("completeMethod",function(n){g(e);let i=_();return h(i.onSearchSupplier(n))}),o()(),r(20,"div",25)(21,"label",26),s(22,"Page Size"),o(),S(23,"input",33),x(24,at,2,1,"div",30),o()()}if(t&2){let e=_();c("formGroup",e.form),l(4),c("virtualScrollItemSize",50)("options",e.store.meta().options.outlets),l(7),c("iconDisplay","input")("showIcon",!0)("ngClass",V(16,H,e.isInvalid("from"))),l(),c("ngIf",e.isInvalid("from")),l(),c("iconDisplay","input")("showIcon",!0)("ngClass",V(18,H,e.isInvalid("to"))),l(),c("ngIf",e.isInvalid("to")),l(4),c("suggestions",X(19,14,e.supplierSuggestions$)),l(5),c("ngClass",V(20,H,e.isInvalid("pageSize"))),l(),c("ngIf",e.isInvalid("pageSize"))}}var Qt=(()=>{class t extends Me{constructor(){super(),this.store=C(B),this.generateJournalService=C(F),this.authService=C(oe),this.isDialogFilterVisible=P(!1),this.isInitDialogFilterVisible=P(!1),this.fb=C(de),this.dayjsService=C(A)}ngOnInit(){this.initform()}initform(){let{outletName:e,number:p,from:n,to:i,paymentState:u,supplierID:m,pageNumber:He,pageSize:Oe,export:Ue,exportPageNumber:Le,exportPageSize:Ge}=this.store.filter();this.form=this.fb.group({outletName:this.fb.control(e),number:this.fb.control(p),from:this.fb.control(this.dayjsService.from(n)?this.dayjsService.from(n).toDate():null),to:this.fb.control(this.dayjsService.from(i)?this.dayjsService.from(i).toDate():null),paymentState:this.fb.control(u),supplierID:this.fb.control(m),pageNumber:this.fb.control(He),pageSize:this.fb.control(Oe,[ae.required]),export:this.fb.control(Ue),exportPageNumber:this.fb.control(Le),exportPageSize:this.fb.control(Ge)})}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched();return}let e=Object.entries(this.form.getRawValue()).reduce((p,[n,i])=>(i!=null&&(n==="from"||n==="to"?(typeof i=="string"||typeof i=="number"||i instanceof Date)&&(p[n]=this.dayjsService.from(i)?this.dayjsService.format(i):null):p[n]=i),p),{});this.store.updateFilter(e),this.isDialogFilterVisible.update(p=>!p)}onSearch(e){this.store.updateFilter(f(d({},this.store.filter()),{number:e}))}onSearchSupplier(e){this.supplierSuggestions$=this.generateJournalService.getSupplierSuggestions(e.query).pipe()}onPageChange(e){let p=e.first/e.rows;this.store.updateFilter(f(d({},this.store.filter()),{pageNumber:p+1}))}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(p=>{this.store.onRowUnselect(p)});return}else this.store.onRowUnselect(e.data)}onCreateJournal(){this.generateJournalService.createAPJournal(this.store.checkedAPCollection()).pipe(O(()=>{this.store.getARCollection(this.store.filter)})).subscribe()}static{this.\u0275fac=function(p){return new(p||t)}}static{this.\u0275cmp=G({type:t,selectors:[["app-ap-journal"]],features:[Q([B]),K],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["item",""],["pageTitle","Join Bill",3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","search","isSearchableInput","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],["label","Generate Journal",3,"onClick",4,"ngIf"],["label","Generate Journal",3,"onClick"],["dataKey","id",3,"onPage","onHeaderCheckboxToggle","onRowSelect","onRowUnselect","value","paginator","rows","totalRecords","lazy"],[2,"width","1rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","14rem"],[2,"width","11rem"],[2,"width","9rem"],[2,"width","4rem"],[3,"value"],["target","_blank",1,"link","link-primary",3,"href"],[3,"innerHTML"],[3,"icon","severity","text"],["colspan","9"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["virtualScroll","","showClear","","filter","","filterBy","name","formControlName","outletName","appendTo","body","optionLabel","name","optionValue","name","placeholder","Select an Tag",3,"virtualScrollItemSize","options"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],[4,"ngIf"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon","ngClass"],["showClear","","formControlName","supplierID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["appMaskNumber","","type","text","pInputText","","formControlName","pageSize",3,"ngClass"],[3,"pTooltip"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(p,n){if(p&1){let i=w();r(0,"app-main-panel",8),q("isDialogFilterVisibleChange",function(m){return g(i),M(n.isDialogFilterVisible,m)||(n.isDialogFilterVisible=m),h(m)})("isInitDialogFilterVisibleChange",function(m){return g(i),M(n.isInitDialogFilterVisible,m)||(n.isInitDialogFilterVisible=m),h(m)}),T("filterConfirmed",function(){return g(i),h(n.onFilterOKEvent())})("search",function(m){return g(i),h(n.onSearch(m))}),x(1,$e,1,1,"ng-template",null,0,v)(3,Ze,10,5,"ng-template",null,1,v)(5,lt,25,22,"ng-template",null,2,v),o()}p&2&&(c("isSearchableInput",!0)("isFilterable",!0),$("isDialogFilterVisible",n.isDialogFilterVisible)("isInitDialogFilterVisible",n.isInitDialogFilterVisible),c("scrollable",!0))},dependencies:[Ve,Re,ke,Ne,Pe,ne,Y,Z,ee,te,ie,he,ge,Ce,xe,ue,me,re,le,pe,se,ce,Je,Fe,Ae,De,_e,fe,Be,je,be,Se,ve,ze],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();export{Qt as ApJournalComponent};