pakdatakit 2.2.1 → 2.5.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 (154) hide show
  1. package/DATA.md +512 -34
  2. package/LICENSE +1 -1
  3. package/NOTICE +14 -0
  4. package/README.md +472 -28
  5. package/dist/address.cjs +6 -5
  6. package/dist/address.js +4 -3
  7. package/dist/bills.cjs +19 -0
  8. package/dist/bills.d.cts +63 -0
  9. package/dist/bills.d.ts +63 -0
  10. package/dist/bills.js +2 -0
  11. package/dist/{chunk-4VSGCQ6K.cjs → chunk-2OBKPYJZ.cjs} +3 -3
  12. package/dist/chunk-33GOK7EE.cjs +5312 -0
  13. package/dist/chunk-33QMFE2Z.js +21244 -0
  14. package/dist/chunk-34U2ZMHR.js +194 -0
  15. package/dist/chunk-4GSBHJX6.js +165 -0
  16. package/dist/chunk-5DDHO5Z7.cjs +565 -0
  17. package/dist/chunk-5EY5DQS7.js +51 -0
  18. package/dist/chunk-5RGX4DWF.js +559 -0
  19. package/dist/chunk-5UCRHVI4.cjs +302 -0
  20. package/dist/{chunk-TTARJWGT.js → chunk-7DY26QPN.js} +2 -2
  21. package/dist/chunk-7E7L3NYS.cjs +11 -0
  22. package/dist/{chunk-3ZA265SK.cjs → chunk-AUQFA7EE.cjs} +172 -4
  23. package/dist/{chunk-QKH7W2CC.js → chunk-B7DOQ5QF.js} +6 -5
  24. package/dist/{chunk-HBOZIITD.js → chunk-CADQM4ZN.js} +14 -14
  25. package/dist/chunk-CF6AMRBU.cjs +198 -0
  26. package/dist/chunk-CZOZB4K3.js +61 -0
  27. package/dist/{chunk-3IARSCO6.cjs → chunk-DHOP7LQX.cjs} +25 -14
  28. package/dist/chunk-E2XU6NOW.js +909 -0
  29. package/dist/chunk-E6GWBOKV.cjs +911 -0
  30. package/dist/chunk-E6HSKRAE.js +9 -0
  31. package/dist/chunk-EA3SIHYT.js +313 -0
  32. package/dist/{chunk-33FXHM2E.cjs → chunk-ESKXG7Y6.cjs} +5 -5
  33. package/dist/chunk-I7UUPD3G.cjs +21252 -0
  34. package/dist/{chunk-YPPKY5XZ.js → chunk-IBZPJS4H.js} +26 -15
  35. package/dist/chunk-IDTRFOQW.js +35 -0
  36. package/dist/{chunk-XCXFGTHW.cjs → chunk-J5ZF46NZ.cjs} +14 -14
  37. package/dist/{chunk-NZQ47NWD.js → chunk-KRYHLYN2.js} +1 -1
  38. package/dist/{chunk-RXNYY5K5.js → chunk-LQHM3ADX.js} +172 -4
  39. package/dist/{chunk-HTERSQGF.cjs → chunk-MTS6SVNP.cjs} +4 -4
  40. package/dist/chunk-OTI7HY55.js +297 -0
  41. package/dist/{chunk-6IPPANNX.js → chunk-P7LVE2TF.js} +2 -2
  42. package/dist/{chunk-47P7HILD.cjs → chunk-QFPEFD67.cjs} +9 -8
  43. package/dist/chunk-RZQJAZKC.js +22 -0
  44. package/dist/{chunk-PLDVGOKZ.js → chunk-S274QFFB.js} +2 -2
  45. package/dist/chunk-SF4ECUZ6.cjs +56 -0
  46. package/dist/chunk-SQIHFEXI.cjs +25 -0
  47. package/dist/{chunk-NAJGGUAM.cjs → chunk-TC3VRWZV.cjs} +2 -2
  48. package/dist/{chunk-U7MWHXMF.cjs → chunk-TVL6RDAU.cjs} +4 -4
  49. package/dist/chunk-UYFTXD4P.js +168 -0
  50. package/dist/{chunk-AZV45DMG.js → chunk-V2XE3NCG.js} +2 -2
  51. package/dist/chunk-XCFZKCV2.cjs +37 -0
  52. package/dist/chunk-XOTCIXY6.js +5301 -0
  53. package/dist/chunk-XVEG53NN.cjs +322 -0
  54. package/dist/chunk-YDUXIENX.cjs +172 -0
  55. package/dist/chunk-YPAWNWFD.cjs +168 -0
  56. package/dist/chunk-YQFI7W3I.cjs +65 -0
  57. package/dist/{chunk-NTD4JLDW.cjs → chunk-YTLE5K7G.cjs} +1 -1
  58. package/dist/{chunk-EMH4IP2U.js → chunk-ZRONAQBV.js} +1 -1
  59. package/dist/class-validator.cjs +65 -0
  60. package/dist/class-validator.d.cts +63 -0
  61. package/dist/class-validator.d.ts +63 -0
  62. package/dist/class-validator.js +54 -0
  63. package/dist/cli.js +1 -1
  64. package/dist/courier.cjs +16 -0
  65. package/dist/courier.d.cts +51 -0
  66. package/dist/courier.d.ts +51 -0
  67. package/dist/courier.js +3 -0
  68. package/dist/fbr-invoice.cjs +25 -0
  69. package/dist/fbr-invoice.d.cts +170 -0
  70. package/dist/fbr-invoice.d.ts +170 -0
  71. package/dist/fbr-invoice.js +4 -0
  72. package/dist/geo.cjs +23 -6
  73. package/dist/geo.d.cts +56 -1
  74. package/dist/geo.d.ts +56 -1
  75. package/dist/geo.js +2 -1
  76. package/dist/holidays.cjs +4 -4
  77. package/dist/holidays.js +1 -1
  78. package/dist/iban.cjs +5 -5
  79. package/dist/iban.d.cts +8 -6
  80. package/dist/iban.d.ts +8 -6
  81. package/dist/iban.js +1 -1
  82. package/dist/incometax.cjs +27 -0
  83. package/dist/incometax.d.cts +91 -0
  84. package/dist/incometax.d.ts +91 -0
  85. package/dist/incometax.js +2 -0
  86. package/dist/index.cjs +253 -111
  87. package/dist/index.d.cts +12 -4
  88. package/dist/index.d.ts +12 -4
  89. package/dist/index.js +25 -15
  90. package/dist/input.cjs +9 -9
  91. package/dist/input.js +3 -3
  92. package/dist/joi.cjs +43 -0
  93. package/dist/joi.d.cts +25 -0
  94. package/dist/joi.d.ts +25 -0
  95. package/dist/joi.js +37 -0
  96. package/dist/networks.cjs +3 -3
  97. package/dist/networks.js +2 -2
  98. package/dist/numbers.cjs +6 -6
  99. package/dist/numbers.js +2 -2
  100. package/dist/passport.cjs +11 -0
  101. package/dist/passport.d.cts +27 -0
  102. package/dist/passport.d.ts +27 -0
  103. package/dist/passport.js +2 -0
  104. package/dist/phone.cjs +8 -8
  105. package/dist/phone.js +3 -3
  106. package/dist/postal.cjs +14 -6
  107. package/dist/postal.d.cts +54 -2
  108. package/dist/postal.d.ts +54 -2
  109. package/dist/postal.js +1 -1
  110. package/dist/quality.cjs +25 -0
  111. package/dist/quality.d.cts +62 -0
  112. package/dist/quality.d.ts +62 -0
  113. package/dist/quality.js +8 -0
  114. package/dist/raast.cjs +6 -6
  115. package/dist/raast.js +2 -2
  116. package/dist/salestax.cjs +20 -0
  117. package/dist/salestax.d.cts +106 -0
  118. package/dist/salestax.d.ts +106 -0
  119. package/dist/salestax.js +3 -0
  120. package/dist/superstruct.cjs +41 -0
  121. package/dist/superstruct.d.cts +25 -0
  122. package/dist/superstruct.d.ts +25 -0
  123. package/dist/superstruct.js +39 -0
  124. package/dist/text.cjs +21 -5
  125. package/dist/text.d.cts +90 -1
  126. package/dist/text.d.ts +90 -1
  127. package/dist/text.js +1 -1
  128. package/dist/valibot.cjs +18 -8
  129. package/dist/valibot.d.cts +3 -0
  130. package/dist/valibot.d.ts +3 -0
  131. package/dist/valibot.js +17 -7
  132. package/dist/vehicle.cjs +15 -0
  133. package/dist/vehicle.d.cts +43 -0
  134. package/dist/vehicle.d.ts +43 -0
  135. package/dist/vehicle.js +2 -0
  136. package/dist/whatsapp.cjs +3 -3
  137. package/dist/whatsapp.js +2 -2
  138. package/dist/yup.cjs +18 -8
  139. package/dist/yup.d.cts +3 -0
  140. package/dist/yup.d.ts +3 -0
  141. package/dist/yup.js +17 -7
  142. package/dist/zod.cjs +18 -8
  143. package/dist/zod.d.cts +3 -0
  144. package/dist/zod.d.ts +3 -0
  145. package/dist/zod.js +17 -7
  146. package/package.json +167 -6
  147. package/dist/chunk-34CJGJ67.cjs +0 -1697
  148. package/dist/chunk-4VVFS6FN.cjs +0 -715
  149. package/dist/chunk-E6DT2DWQ.js +0 -1689
  150. package/dist/chunk-GJENL6VK.cjs +0 -22
  151. package/dist/chunk-HUQY2WR5.js +0 -20
  152. package/dist/chunk-JKE4AMSZ.js +0 -47
  153. package/dist/chunk-KEHCTYLO.cjs +0 -52
  154. package/dist/chunk-LIYNKIKS.js +0 -709
@@ -20,11 +20,11 @@ var holidays_default = {
20
20
  },
21
21
  ashura: {
22
22
  dates: ["2020-08-29", "2020-08-30"],
23
- source: "https://arynews.tv/muharram-moon-sighting-youm-i-ashur-ruet-e-hilal-committee"
23
+ source: "https://www.sbp.org.pk/circulars/bprd-circular-letter-no-39-of-2020"
24
24
  },
25
25
  eidMiladUnNabi: {
26
26
  dates: ["2020-10-30"],
27
- source: "https://www.geo.tv/latest/313746-rabiul-awwal-moon-not-sighted-eid-i-miladun-nabi-on-oct-30"
27
+ source: "https://www.sbp.org.pk/circulars/bprd-circular-letter-no-46-of-2020"
28
28
  }
29
29
  },
30
30
  "2021": {
@@ -45,11 +45,11 @@ var holidays_default = {
45
45
  },
46
46
  ashura: {
47
47
  dates: ["2021-08-18", "2021-08-19"],
48
- source: "https://propakistani.pk/2021/08/13/govt-announces-ashura-holidays/"
48
+ source: "https://www.sbp.org.pk/circulars/bprd-circular-letter-no-27-of-2021"
49
49
  },
50
50
  eidMiladUnNabi: {
51
51
  dates: ["2021-10-19"],
52
- source: "https://www.geo.tv/latest/376025-eid-milad-un-nabi-govt-notifies-12th-rabi-ul-awal-as-nationwide-public-holiday"
52
+ source: "https://www.sbp.org.pk/circulars/bprd-circular-letter-no-31-of-2021"
53
53
  }
54
54
  },
55
55
  "2022": {
@@ -73,7 +73,7 @@ var holidays_default = {
73
73
  },
74
74
  eidMiladUnNabi: {
75
75
  dates: ["2022-10-09"],
76
- source: "https://www.thenews.com.pk/latest/994846-rabiul-awwal-moon-not-sighted-eid-milad-un-nabi-pbuh-to-be-observed-on-october-9"
76
+ source: "https://www.sbp.org.pk/circulars/bprd-circular-letter-no-28-of-2022"
77
77
  }
78
78
  },
79
79
  "2023": {
@@ -85,7 +85,7 @@ var holidays_default = {
85
85
  "2023-04-24",
86
86
  "2023-04-25"
87
87
  ],
88
- source: "https://gulfnews.com/world/asia/pakistan/eid-al-fitr-2023-pakistan-announces-five-day-holiday-1.95122615"
88
+ source: "https://www.sbp.org.pk/circulars/bprd-circular-letter-no-08-of-2023"
89
89
  },
90
90
  eidUlAdha: {
91
91
  dates: ["2023-06-28", "2023-06-29", "2023-06-30"],
@@ -93,7 +93,7 @@ var holidays_default = {
93
93
  },
94
94
  ashura: {
95
95
  dates: ["2023-07-28", "2023-07-29"],
96
- source: "https://thestandard.com.pk/government-announces-public-holidays-on-july-28-29-for-ashura/"
96
+ source: "https://www.sbp.org.pk/circulars/bprd-circular-letter-no-14-of-2023"
97
97
  },
98
98
  eidMiladUnNabi: {
99
99
  dates: ["2023-09-29"],
@@ -103,11 +103,11 @@ var holidays_default = {
103
103
  "2024": {
104
104
  eidUlFitr: {
105
105
  dates: ["2024-04-10", "2024-04-11", "2024-04-12"],
106
- source: "https://thefridaytimes.com/04-Apr-2024/govt-announces-eidul-fitr-holidays-from-april-10"
106
+ source: "https://www.sbp.org.pk/circulars/bprd-circular-letter-no-08-of-2024"
107
107
  },
108
108
  eidUlAdha: {
109
109
  dates: ["2024-06-17", "2024-06-18", "2024-06-19"],
110
- source: "https://english.aaj.tv/news/330364828/govt-announces-eid-ul-adha-hoildays"
110
+ source: "https://www.sbp.org.pk/circulars/bprd-circular-letter-no-11-of-2024"
111
111
  },
112
112
  ashura: {
113
113
  dates: ["2024-07-16", "2024-07-17"],
@@ -121,7 +121,7 @@ var holidays_default = {
121
121
  "2025": {
122
122
  eidUlFitr: {
123
123
  dates: ["2025-03-31", "2025-04-01", "2025-04-02"],
124
- source: "https://arynews.tv/eidul-fitr-2025-holidays-announcement-pakistan/"
124
+ source: "https://cabinet.gov.pk/SiteImage/Misc/files/Holidays/Eid-ul-Fitr%202025%20Holidays%20-%2019-03-2025.pdf"
125
125
  },
126
126
  eidUlAdha: {
127
127
  dates: ["2025-06-06", "2025-06-07", "2025-06-08", "2025-06-09"],
@@ -129,7 +129,7 @@ var holidays_default = {
129
129
  },
130
130
  ashura: {
131
131
  dates: ["2025-07-05", "2025-07-06"],
132
- source: "https://tribune.com.pk/story/2554016/govt-announces-july-5-6-holidays-on-account-of-ashura"
132
+ source: "https://cabinet.gov.pk/SiteImage/Misc/files/Press%20Release/Ashura-Holidays-2025.pdf"
133
133
  },
134
134
  eidMiladUnNabi: {
135
135
  dates: ["2025-09-06"],
@@ -139,15 +139,15 @@ var holidays_default = {
139
139
  "2026": {
140
140
  eidUlFitr: {
141
141
  dates: ["2026-03-20", "2026-03-21"],
142
- source: "https://www.app.com.pk/?p=1180682"
142
+ source: "https://cabinet.gov.pk/SiteImage/Misc/files/Holidays/EidulFitr%202026.pdf"
143
143
  },
144
144
  eidUlAdha: {
145
145
  dates: ["2026-05-26", "2026-05-27", "2026-05-28"],
146
- source: "https://pkrevenue.com/pakistan-declares-three-day-eid-ul-adha-2026-holidays/"
146
+ source: "https://cabinet.gov.pk/SiteImage/Misc/files/Holidays/2026/Eid-ul-Azha-holidays-Notification-20_05_2026.pdf"
147
147
  },
148
148
  ashura: {
149
149
  dates: ["2026-06-25", "2026-06-26"],
150
- source: "https://en.dailypakistan.com.pk/22-Jun-2026/ashura-holidays-notification-june-2026"
150
+ source: "https://cabinet.gov.pk/SiteImage/Misc/files/Press%20Release/Notification_Ashura%20Public%20Holiday%2C%202026.pdf"
151
151
  },
152
152
  eidMiladUnNabi: {
153
153
  dates: ["2026-08-26"],
@@ -0,0 +1,198 @@
1
+ 'use strict';
2
+
3
+ var chunkSF4ECUZ6_cjs = require('./chunk-SF4ECUZ6.cjs');
4
+ var chunkVPBMIYO2_cjs = require('./chunk-VPBMIYO2.cjs');
5
+
6
+ // data/sales-tax-rates.json
7
+ var sales_tax_rates_default = [
8
+ {
9
+ kind: "goods",
10
+ authority: "FBR",
11
+ province: null,
12
+ rate: 17,
13
+ from: "2019-07-01",
14
+ to: "2023-02-22",
15
+ law: "Sales Tax Act 1990, s. 3(1)",
16
+ source: "https://download1.fbr.gov.pk/Docs/20232231921422957Finance(Supplementary)Act,2023.pdf"
17
+ },
18
+ {
19
+ kind: "goods",
20
+ authority: "FBR",
21
+ province: null,
22
+ rate: 18,
23
+ from: "2023-02-23",
24
+ to: null,
25
+ law: "Sales Tax Act 1990, s. 3(1), as amended by the Finance (Supplementary) Act 2023",
26
+ source: "https://download1.fbr.gov.pk/Docs/20267171373418951SalesTaxAct1990updatedupto30.06.2026.pdf"
27
+ },
28
+ {
29
+ kind: "services",
30
+ authority: "PRA",
31
+ province: "Punjab",
32
+ rate: 16,
33
+ from: "2019-07-01",
34
+ to: null,
35
+ law: "Punjab Sales Tax on Services Act 2012, s. 2(41A) and Second Schedule",
36
+ source: "https://pra.punjab.gov.pk/Downloads/THE-PUNJAB-SALES-TAX-ON-SERVICES-ACT-2012-17th-Edition-2026-2027.pdf"
37
+ },
38
+ {
39
+ kind: "services",
40
+ authority: "SRB",
41
+ province: "Sindh",
42
+ rate: 13,
43
+ from: "2019-07-01",
44
+ to: "2024-06-30",
45
+ law: "Sindh Sales Tax on Services Act 2011, Second Schedule",
46
+ source: "https://www.pas.gov.pk/uploads/acts/Sindh%20Act%20No.II%20of%202024.pdf"
47
+ },
48
+ {
49
+ kind: "services",
50
+ authority: "SRB",
51
+ province: "Sindh",
52
+ rate: 15,
53
+ from: "2024-07-01",
54
+ to: null,
55
+ law: "Sindh Sales Tax on Services Act 2011, s. 8(1), as amended by the Sindh Finance Acts 2024 and 2025",
56
+ source: "https://www.srb.gos.pk/srb/wp-content/uploads/2026/01/Sindh-Sales-Tax-Act-2011-25-26-2.pdf"
57
+ },
58
+ {
59
+ kind: "services",
60
+ authority: "KPRA",
61
+ province: "Khyber Pakhtunkhwa",
62
+ rate: 15,
63
+ from: "2019-07-01",
64
+ to: null,
65
+ law: "Khyber Pakhtunkhwa Finance Act 2019, Second Schedule; Khyber Pakhtunkhwa Sales Tax on Services Act 2022, s. 9(1)",
66
+ source: "https://kpra.gov.pk/wp-content/uploads/2026/09/KPSTSA-2022-Updated-Finance-act-2026.pdf"
67
+ },
68
+ {
69
+ kind: "services",
70
+ authority: "BRA",
71
+ province: "Balochistan",
72
+ rate: 15,
73
+ from: "2019-07-01",
74
+ to: null,
75
+ law: "Balochistan Sales Tax on Services Act 2015, s. 10(1) and Second Schedule",
76
+ source: "https://bra.gob.pk/NewsDirectory/2015_BSTS_Act_Ver01.pdf"
77
+ },
78
+ {
79
+ kind: "services",
80
+ authority: "FBR",
81
+ province: "Islamabad Capital Territory",
82
+ rate: 16,
83
+ from: "2019-07-01",
84
+ to: "2022-06-30",
85
+ law: "Islamabad Capital Territory (Tax on Services) Ordinance 2001, Schedule, Table 1",
86
+ source: "https://fbr.gov.pk/Budget2022-23/FinanceAct/Finance-Act-2022.pdf"
87
+ },
88
+ {
89
+ kind: "services",
90
+ authority: "FBR",
91
+ province: "Islamabad Capital Territory",
92
+ rate: 15,
93
+ from: "2022-07-01",
94
+ to: null,
95
+ law: "Islamabad Capital Territory (Tax on Services) Ordinance 2001, Schedule, Table 1, as amended by the Finance Act 2022",
96
+ source: "https://download1.fbr.gov.pk/Docs/2025711172945966ICTOUpdatedupto30.06.2025.pdf"
97
+ }
98
+ ];
99
+
100
+ // src/salestax.ts
101
+ var RATES = sales_tax_rates_default;
102
+ var PROVINCES = {
103
+ punjab: "Punjab",
104
+ sindh: "Sindh",
105
+ "khyber pakhtunkhwa": "Khyber Pakhtunkhwa",
106
+ kp: "Khyber Pakhtunkhwa",
107
+ kpk: "Khyber Pakhtunkhwa",
108
+ balochistan: "Balochistan",
109
+ baluchistan: "Balochistan",
110
+ "islamabad capital territory": "Islamabad Capital Territory",
111
+ ict: "Islamabad Capital Territory",
112
+ islamabad: "Islamabad Capital Territory",
113
+ "azad jammu and kashmir": "Azad Jammu and Kashmir",
114
+ ajk: "Azad Jammu and Kashmir",
115
+ "gilgit-baltistan": "Gilgit-Baltistan",
116
+ "gilgit baltistan": "Gilgit-Baltistan",
117
+ gb: "Gilgit-Baltistan"
118
+ };
119
+ var OUTSIDE_FEDERAL = /* @__PURE__ */ new Set(["Azad Jammu and Kashmir", "Gilgit-Baltistan"]);
120
+ function provinceName(input) {
121
+ if (typeof input !== "string") return null;
122
+ const key = chunkVPBMIYO2_cjs.normalizeKey(input);
123
+ return Object.prototype.hasOwnProperty.call(PROVINCES, key) ? PROVINCES[key] : null;
124
+ }
125
+ function getSalesTaxRate(query) {
126
+ if (query === null || typeof query !== "object") return null;
127
+ const { kind } = query;
128
+ if (kind !== "goods" && kind !== "services") return null;
129
+ const date = query.date === void 0 ? chunkSF4ECUZ6_cjs.isoDate(/* @__PURE__ */ new Date()) : chunkSF4ECUZ6_cjs.isoDate(query.date);
130
+ if (date === null) return null;
131
+ let province = null;
132
+ if (query.province !== void 0 && query.province !== null) {
133
+ province = provinceName(query.province);
134
+ if (province === null) return null;
135
+ }
136
+ if (kind === "goods") {
137
+ if (province !== null && OUTSIDE_FEDERAL.has(province)) return null;
138
+ } else if (province === null) {
139
+ return null;
140
+ }
141
+ const entry = RATES.find(
142
+ (r) => r.kind === kind && (kind === "goods" || r.province === province) && r.from <= date && (r.to === null || date <= r.to)
143
+ );
144
+ return entry ? { ...entry } : null;
145
+ }
146
+ function basisPoints(rate) {
147
+ if (typeof rate !== "number" || !Number.isFinite(rate) || rate < 0 || rate > 100) {
148
+ return null;
149
+ }
150
+ const exact = chunkSF4ECUZ6_cjs.toUnits(rate, 4);
151
+ if (exact === null || exact % 100 !== 0) return null;
152
+ return exact / 100;
153
+ }
154
+ function amounts(netPaisa, taxPaisa, bp) {
155
+ return {
156
+ net: chunkSF4ECUZ6_cjs.fromPaisa(netPaisa),
157
+ tax: chunkSF4ECUZ6_cjs.fromPaisa(taxPaisa),
158
+ gross: chunkSF4ECUZ6_cjs.fromPaisa(netPaisa + taxPaisa),
159
+ rate: bp / 100
160
+ };
161
+ }
162
+ function splitInclusive(gross, rate) {
163
+ const grossPaisa = chunkSF4ECUZ6_cjs.toUnits(gross, 2);
164
+ const bp = basisPoints(rate);
165
+ if (grossPaisa === null || bp === null) return null;
166
+ const netPaisa = chunkSF4ECUZ6_cjs.divideHalfUp(
167
+ BigInt(grossPaisa) * 10000n,
168
+ BigInt(1e4 + bp)
169
+ );
170
+ return amounts(netPaisa, grossPaisa - netPaisa, bp);
171
+ }
172
+ function calculateSalesTax(amount, options) {
173
+ if (options === null || typeof options !== "object") return null;
174
+ let rate;
175
+ if (options.rate !== void 0 && options.rate !== null) {
176
+ rate = options.rate;
177
+ } else {
178
+ const kind = options.kind ?? (options.province !== void 0 ? "services" : void 0);
179
+ if (kind === void 0) return null;
180
+ const found = getSalesTaxRate({
181
+ kind,
182
+ ...options.province !== void 0 ? { province: options.province } : {},
183
+ ...options.date !== void 0 ? { date: options.date } : {}
184
+ });
185
+ if (found === null) return null;
186
+ rate = found.rate;
187
+ }
188
+ if (options.inclusive === true) return splitInclusive(amount, rate);
189
+ const netPaisa = chunkSF4ECUZ6_cjs.toUnits(amount, 2);
190
+ const bp = basisPoints(rate);
191
+ if (netPaisa === null || bp === null) return null;
192
+ const taxPaisa = chunkSF4ECUZ6_cjs.divideHalfUp(BigInt(netPaisa) * BigInt(bp), 10000n);
193
+ return amounts(netPaisa, taxPaisa, bp);
194
+ }
195
+
196
+ exports.calculateSalesTax = calculateSalesTax;
197
+ exports.getSalesTaxRate = getSalesTaxRate;
198
+ exports.splitInclusive = splitInclusive;
@@ -0,0 +1,61 @@
1
+ import { toAsciiDigits } from './chunk-ENQ7O7VW.js';
2
+
3
+ // src/bills.ts
4
+ var SEPARATORS = /[\s\-‐‑‒–—./]/g;
5
+ function parseElectricityRef(input) {
6
+ if (typeof input !== "string") return null;
7
+ let text = toAsciiDigits(input).replace(SEPARATORS, "").toUpperCase();
8
+ let urbanRural = null;
9
+ const letter = /^(\d{14})([UR])$/.exec(text);
10
+ if (letter) {
11
+ text = letter[1];
12
+ urbanRural = letter[2];
13
+ }
14
+ if (!/^\d+$/.test(text)) return null;
15
+ if (text.length === 14) {
16
+ const formatted = `${text.slice(0, 2)} ${text.slice(2, 7)} ${text.slice(7)}`;
17
+ return {
18
+ type: "reference",
19
+ digits: text,
20
+ formatted: urbanRural ? `${formatted} ${urbanRural}` : formatted,
21
+ urbanRural,
22
+ disco: null
23
+ };
24
+ }
25
+ if (urbanRural !== null) return null;
26
+ if (text.length === 13 && text.startsWith("04000")) {
27
+ return {
28
+ type: "k-electric",
29
+ digits: text,
30
+ formatted: text,
31
+ urbanRural: null,
32
+ disco: "K-Electric"
33
+ };
34
+ }
35
+ if (text.length === 10 || text.length === 11) {
36
+ return {
37
+ type: "customer-id",
38
+ digits: text,
39
+ formatted: text,
40
+ urbanRural: null,
41
+ disco: null
42
+ };
43
+ }
44
+ return null;
45
+ }
46
+ function validateElectricityRef(input) {
47
+ return parseElectricityRef(input) !== null;
48
+ }
49
+ var GAS_DIGITS = {
50
+ SNGPL: 11,
51
+ SSGC: 10
52
+ };
53
+ function validateGasConsumerNumber(input, company) {
54
+ if (typeof input !== "string" || typeof company !== "string") return false;
55
+ const digits = GAS_DIGITS[company.toUpperCase()];
56
+ if (digits === void 0) return false;
57
+ const text = toAsciiDigits(input).replace(SEPARATORS, "");
58
+ return text.length === digits && /^\d+$/.test(text);
59
+ }
60
+
61
+ export { parseElectricityRef, validateElectricityRef, validateGasConsumerNumber };
@@ -47,7 +47,7 @@ var banks_default = [
47
47
  {
48
48
  code: "BPUN",
49
49
  name: "The Bank of Punjab",
50
- type: "commercial"
50
+ type: "public-sector"
51
51
  },
52
52
  {
53
53
  code: "CITI",
@@ -96,7 +96,7 @@ var banks_default = [
96
96
  },
97
97
  {
98
98
  code: "JCMA",
99
- name: "Mobilink Bank (JazzCash)",
99
+ name: "Mobilink Microfinance Bank (JazzCash)",
100
100
  type: "microfinance"
101
101
  },
102
102
  {
@@ -112,7 +112,7 @@ var banks_default = [
112
112
  {
113
113
  code: "KHYB",
114
114
  name: "The Bank of Khyber",
115
- type: "commercial"
115
+ type: "public-sector"
116
116
  },
117
117
  {
118
118
  code: "MCBL",
@@ -153,12 +153,12 @@ var banks_default = [
153
153
  {
154
154
  code: "NBPA",
155
155
  name: "National Bank of Pakistan",
156
- type: "commercial"
156
+ type: "public-sector"
157
157
  },
158
158
  {
159
159
  code: "NBPB",
160
160
  name: "National Bank of Pakistan",
161
- type: "commercial",
161
+ type: "public-sector",
162
162
  aliasOf: "NBPA"
163
163
  },
164
164
  {
@@ -206,12 +206,18 @@ var banks_default = [
206
206
  {
207
207
  code: "SIND",
208
208
  name: "Sindh Bank Limited",
209
- type: "commercial"
209
+ type: "public-sector"
210
210
  },
211
211
  {
212
212
  code: "SMES",
213
- name: "SME Bank Limited",
214
- type: "specialized"
213
+ name: "SME Bank Limited (in liquidation)",
214
+ type: "specialized",
215
+ active: false
216
+ },
217
+ {
218
+ code: "SMFB",
219
+ name: "Sindh Microfinance Bank",
220
+ type: "microfinance"
215
221
  },
216
222
  {
217
223
  code: "SONE",
@@ -225,13 +231,13 @@ var banks_default = [
225
231
  },
226
232
  {
227
233
  code: "TAMW",
228
- name: "easypaisa Digital Bank (formerly Tameer Microfinance Bank)",
234
+ name: "Easypaisa Bank Limited (formerly Tameer Microfinance Bank)",
229
235
  type: "digital",
230
236
  aliasOf: "TMFB"
231
237
  },
232
238
  {
233
239
  code: "TMFB",
234
- name: "easypaisa Digital Bank (formerly Telenor Microfinance Bank)",
240
+ name: "Easypaisa Bank Limited (formerly Telenor Microfinance Bank)",
235
241
  type: "digital"
236
242
  },
237
243
  {
@@ -246,25 +252,30 @@ var banks_default = [
246
252
  },
247
253
  {
248
254
  code: "WMBL",
249
- name: "Mobilink Bank (JazzCash)",
255
+ name: "Mobilink Microfinance Bank (JazzCash)",
250
256
  type: "microfinance",
251
257
  aliasOf: "JCMA"
258
+ },
259
+ {
260
+ code: "ZTBL",
261
+ name: "Zarai Taraqiati Bank Limited",
262
+ type: "specialized"
252
263
  }
253
264
  ];
254
265
 
255
266
  // src/iban.ts
256
267
  var PK_IBAN_PATTERN = /^PK\d{2}[A-Z]{4}[A-Z0-9]{16}$/;
257
- var banks = chunkVPBMIYO2_cjs.lazy(
268
+ var banks = /* @__PURE__ */ chunkVPBMIYO2_cjs.lazy(
258
269
  () => banks_default.map((entry) => ({
259
270
  code: entry.code,
260
271
  name: entry.name,
261
272
  type: entry.type,
262
- active: entry.mergedInto === void 0,
273
+ active: entry.mergedInto === void 0 && entry.active !== false,
263
274
  mergedInto: entry.mergedInto ?? null,
264
275
  aliasOf: entry.aliasOf ?? null
265
276
  }))
266
277
  );
267
- var bankByCode = chunkVPBMIYO2_cjs.lazy(
278
+ var bankByCode = /* @__PURE__ */ chunkVPBMIYO2_cjs.lazy(
268
279
  () => new Map(banks().map((bank) => [bank.code, bank]))
269
280
  );
270
281
  function expandIbanChars(value) {