@pisell/pisellos 3.0.76 → 3.0.78

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 (314) hide show
  1. package/dist/core/index.js +1 -2
  2. package/dist/effects/index.d.ts +3 -5
  3. package/dist/effects/index.js +8 -40
  4. package/dist/modules/Account/index.js +3 -2
  5. package/dist/modules/AccountList/index.d.ts +1 -7
  6. package/dist/modules/AccountList/index.js +14 -81
  7. package/dist/modules/AccountList/types.d.ts +0 -28
  8. package/dist/modules/AccountList/types.js +0 -8
  9. package/dist/modules/BaseModule.d.ts +0 -3
  10. package/dist/modules/BaseModule.js +0 -15
  11. package/dist/modules/Cart/index.d.ts +0 -1
  12. package/dist/modules/Cart/index.js +1 -2
  13. package/dist/modules/Date/types.d.ts +3 -1
  14. package/dist/modules/Discount/index.d.ts +0 -1
  15. package/dist/modules/Discount/index.js +1 -1
  16. package/dist/modules/Guests/index.js +9 -9
  17. package/dist/modules/Order/index.d.ts +1 -25
  18. package/dist/modules/Order/index.js +3 -224
  19. package/dist/modules/Order/types.d.ts +0 -45
  20. package/dist/modules/Order/types.js +0 -8
  21. package/dist/modules/Order/utils.js +1 -1
  22. package/dist/modules/Payment/index.d.ts +9 -184
  23. package/dist/modules/Payment/index.js +109 -2084
  24. package/dist/modules/Payment/types.d.ts +30 -772
  25. package/dist/modules/Payment/types.js +12 -236
  26. package/dist/modules/ProductList/index.d.ts +1 -12
  27. package/dist/modules/ProductList/index.js +6 -29
  28. package/dist/modules/Resource/index.js +1 -1
  29. package/dist/modules/Rules/index.d.ts +4 -3
  30. package/dist/modules/Rules/index.js +121 -78
  31. package/dist/modules/Rules/types.d.ts +6 -1
  32. package/dist/modules/Rules/types.js +8 -0
  33. package/dist/modules/Schedule/index.d.ts +0 -9
  34. package/dist/modules/Schedule/index.js +0 -77
  35. package/dist/modules/index.d.ts +0 -1
  36. package/dist/modules/index.js +0 -1
  37. package/dist/plugins/window.d.ts +0 -1
  38. package/dist/solution/BookingByStep/index.d.ts +17 -0
  39. package/dist/solution/BookingByStep/index.js +525 -190
  40. package/dist/solution/BookingByStep/utils/products.d.ts +0 -6
  41. package/dist/solution/BookingByStep/utils/products.js +0 -10
  42. package/dist/solution/BookingByStep/utils/resources.js +4 -0
  43. package/dist/solution/BuyTickets/index.js +8 -7
  44. package/dist/solution/ShopDiscount/index.d.ts +12 -10
  45. package/dist/solution/ShopDiscount/index.js +64 -110
  46. package/dist/solution/ShopDiscount/types.d.ts +0 -8
  47. package/dist/solution/ShopDiscount/utils.js +1 -0
  48. package/dist/solution/index.d.ts +0 -2
  49. package/dist/solution/index.js +1 -3
  50. package/dist/types/index.d.ts +1 -4
  51. package/lib/core/index.js +1 -1
  52. package/lib/effects/index.d.ts +3 -5
  53. package/lib/effects/index.js +1 -17
  54. package/lib/modules/Account/index.js +3 -2
  55. package/lib/modules/AccountList/index.d.ts +1 -7
  56. package/lib/modules/AccountList/index.js +0 -27
  57. package/lib/modules/AccountList/types.d.ts +0 -28
  58. package/lib/modules/BaseModule.d.ts +0 -3
  59. package/lib/modules/BaseModule.js +0 -9
  60. package/lib/modules/Cart/index.d.ts +0 -1
  61. package/lib/modules/Cart/index.js +2 -5
  62. package/lib/modules/Date/types.d.ts +3 -1
  63. package/lib/modules/Discount/index.d.ts +0 -1
  64. package/lib/modules/Discount/index.js +1 -1
  65. package/lib/modules/Guests/index.js +9 -9
  66. package/lib/modules/Order/index.d.ts +1 -25
  67. package/lib/modules/Order/index.js +1 -186
  68. package/lib/modules/Order/types.d.ts +0 -45
  69. package/lib/modules/Order/utils.js +1 -1
  70. package/lib/modules/Payment/index.d.ts +9 -184
  71. package/lib/modules/Payment/index.js +51 -1084
  72. package/lib/modules/Payment/types.d.ts +30 -772
  73. package/lib/modules/Payment/types.js +6 -79
  74. package/lib/modules/ProductList/index.d.ts +1 -12
  75. package/lib/modules/ProductList/index.js +5 -31
  76. package/lib/modules/Resource/index.js +1 -1
  77. package/lib/modules/Rules/index.d.ts +4 -3
  78. package/lib/modules/Rules/index.js +64 -43
  79. package/lib/modules/Rules/types.d.ts +6 -1
  80. package/lib/modules/Rules/types.js +11 -2
  81. package/lib/modules/Schedule/index.d.ts +0 -9
  82. package/lib/modules/Schedule/index.js +0 -60
  83. package/lib/modules/index.d.ts +0 -1
  84. package/lib/modules/index.js +0 -2
  85. package/lib/plugins/window.d.ts +0 -1
  86. package/lib/solution/BookingByStep/index.d.ts +17 -0
  87. package/lib/solution/BookingByStep/index.js +325 -60
  88. package/lib/solution/BookingByStep/utils/products.d.ts +0 -6
  89. package/lib/solution/BookingByStep/utils/products.js +2 -8
  90. package/lib/solution/BookingByStep/utils/resources.js +4 -1
  91. package/lib/solution/BuyTickets/index.js +8 -7
  92. package/lib/solution/ShopDiscount/index.d.ts +12 -10
  93. package/lib/solution/ShopDiscount/index.js +30 -51
  94. package/lib/solution/ShopDiscount/types.d.ts +0 -8
  95. package/lib/solution/index.d.ts +0 -2
  96. package/lib/solution/index.js +1 -5
  97. package/lib/types/index.d.ts +1 -4
  98. package/package.json +1 -3
  99. package/dist/modules/Customer/constants.d.ts +0 -7
  100. package/dist/modules/Customer/constants.js +0 -12
  101. package/dist/modules/Customer/index.d.ts +0 -122
  102. package/dist/modules/Customer/index.js +0 -696
  103. package/dist/modules/Customer/types.d.ts +0 -146
  104. package/dist/modules/Customer/types.js +0 -41
  105. package/dist/modules/Payment/cash.d.ts +0 -19
  106. package/dist/modules/Payment/cash.js +0 -97
  107. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
  108. package/dist/modules/Payment/cashRecommendationAlgorithm.js +0 -423
  109. package/dist/modules/Payment/eftpos.d.ts +0 -11
  110. package/dist/modules/Payment/eftpos.js +0 -80
  111. package/dist/modules/Payment/mx51.d.ts +0 -0
  112. package/dist/modules/Payment/mx51.js +0 -0
  113. package/dist/modules/Payment/utils.d.ts +0 -17
  114. package/dist/modules/Payment/utils.js +0 -62
  115. package/dist/modules/Payment/walletpass.d.ts +0 -99
  116. package/dist/modules/Payment/walletpass.js +0 -711
  117. package/dist/plugins/app-types/app/app.d.ts +0 -83
  118. package/dist/plugins/app-types/app/const.d.ts +0 -4
  119. package/dist/plugins/app-types/app/index.d.ts +0 -14
  120. package/dist/plugins/app-types/applicationManager/application.d.ts +0 -50
  121. package/dist/plugins/app-types/applicationManager/index.d.ts +0 -13
  122. package/dist/plugins/app-types/config.d.ts +0 -3
  123. package/dist/plugins/app-types/cookie/index.d.ts +0 -13
  124. package/dist/plugins/app-types/data/index.d.ts +0 -8
  125. package/dist/plugins/app-types/history/config.d.ts +0 -24
  126. package/dist/plugins/app-types/history/index.d.ts +0 -20
  127. package/dist/plugins/app-types/history/type.d.ts +0 -2
  128. package/dist/plugins/app-types/hooks/index.d.ts +0 -12
  129. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  130. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  131. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  132. package/dist/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  133. package/dist/plugins/app-types/index.d.ts +0 -6
  134. package/dist/plugins/app-types/indexDB/index.d.ts +0 -178
  135. package/dist/plugins/app-types/locales/en.d.ts +0 -3
  136. package/dist/plugins/app-types/locales/index.d.ts +0 -37
  137. package/dist/plugins/app-types/locales/original.d.ts +0 -3
  138. package/dist/plugins/app-types/locales/type.d.ts +0 -19
  139. package/dist/plugins/app-types/locales/zh-CN.d.ts +0 -3
  140. package/dist/plugins/app-types/locales/zh-HK.d.ts +0 -3
  141. package/dist/plugins/app-types/logger/feishu.d.ts +0 -11
  142. package/dist/plugins/app-types/logger/index.d.ts +0 -122
  143. package/dist/plugins/app-types/menuManager/hooks.d.ts +0 -17
  144. package/dist/plugins/app-types/menuManager/index.d.ts +0 -28
  145. package/dist/plugins/app-types/models/global.d.ts +0 -32
  146. package/dist/plugins/app-types/models/index.d.ts +0 -45
  147. package/dist/plugins/app-types/models/type.d.ts +0 -2
  148. package/dist/plugins/app-types/package.json +0 -15
  149. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  150. package/dist/plugins/app-types/pubsub/example.d.ts +0 -5
  151. package/dist/plugins/app-types/pubsub/index.d.ts +0 -63
  152. package/dist/plugins/app-types/request/cache.d.ts +0 -46
  153. package/dist/plugins/app-types/request/cancelToken.d.ts +0 -38
  154. package/dist/plugins/app-types/request/config.d.ts +0 -3
  155. package/dist/plugins/app-types/request/constants.d.ts +0 -2
  156. package/dist/plugins/app-types/request/index.d.ts +0 -24
  157. package/dist/plugins/app-types/request/pisell2Request.d.ts +0 -6
  158. package/dist/plugins/app-types/request/type.d.ts +0 -41
  159. package/dist/plugins/app-types/request/utils.d.ts +0 -46
  160. package/dist/plugins/app-types/routes/config.d.ts +0 -7
  161. package/dist/plugins/app-types/routes/index.d.ts +0 -28
  162. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  163. package/dist/plugins/app-types/socket/components/index.d.ts +0 -2
  164. package/dist/plugins/app-types/socket/constants.d.ts +0 -33
  165. package/dist/plugins/app-types/socket/events.d.ts +0 -31
  166. package/dist/plugins/app-types/socket/heartbeat.d.ts +0 -66
  167. package/dist/plugins/app-types/socket/index.d.ts +0 -61
  168. package/dist/plugins/app-types/socket/monitor.d.ts +0 -169
  169. package/dist/plugins/app-types/socket/reconnect.d.ts +0 -61
  170. package/dist/plugins/app-types/socket/socket.d.ts +0 -129
  171. package/dist/plugins/app-types/socket/types.d.ts +0 -85
  172. package/dist/plugins/app-types/storage/index.d.ts +0 -17
  173. package/dist/plugins/app-types/tasks/index.d.ts +0 -77
  174. package/dist/plugins/app-types/tasks/type.d.ts +0 -62
  175. package/dist/plugins/app-types/tasks/useTasks.d.ts +0 -5
  176. package/dist/plugins/app-types/type.d.ts +0 -2
  177. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  178. package/dist/plugins/app-types/variables/config.d.ts +0 -3
  179. package/dist/plugins/app-types/variables/index.d.ts +0 -6
  180. package/dist/plugins/app-types/variables/type.d.ts +0 -2
  181. package/dist/plugins/app-types/website/index.d.ts +0 -6
  182. package/dist/plugins/app.d.ts +0 -8
  183. package/dist/plugins/app.js +0 -1
  184. package/dist/solution/BookingTicket/index.d.ts +0 -184
  185. package/dist/solution/BookingTicket/index.js +0 -698
  186. package/dist/solution/BookingTicket/types.d.ts +0 -68
  187. package/dist/solution/BookingTicket/types.js +0 -43
  188. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  189. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
  190. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
  191. package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -189
  192. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -85
  193. package/dist/solution/BookingTicket/utils/scan/index.js +0 -294
  194. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  195. package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
  196. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  197. package/dist/solution/Checkout/index.d.ts +0 -432
  198. package/dist/solution/Checkout/index.js +0 -4452
  199. package/dist/solution/Checkout/types.d.ts +0 -727
  200. package/dist/solution/Checkout/types.js +0 -104
  201. package/dist/solution/Checkout/utils/index.d.ts +0 -121
  202. package/dist/solution/Checkout/utils/index.js +0 -511
  203. package/dist/utils/task.d.ts +0 -40
  204. package/dist/utils/task.js +0 -171
  205. package/dist/utils/watch.d.ts +0 -102
  206. package/dist/utils/watch.js +0 -294
  207. package/lib/modules/Customer/constants.d.ts +0 -7
  208. package/lib/modules/Customer/constants.js +0 -39
  209. package/lib/modules/Customer/index.d.ts +0 -122
  210. package/lib/modules/Customer/index.js +0 -439
  211. package/lib/modules/Customer/types.d.ts +0 -146
  212. package/lib/modules/Customer/types.js +0 -37
  213. package/lib/modules/Payment/cash.d.ts +0 -19
  214. package/lib/modules/Payment/cash.js +0 -64
  215. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
  216. package/lib/modules/Payment/cashRecommendationAlgorithm.js +0 -342
  217. package/lib/modules/Payment/eftpos.d.ts +0 -11
  218. package/lib/modules/Payment/eftpos.js +0 -51
  219. package/lib/modules/Payment/mx51.d.ts +0 -0
  220. package/lib/modules/Payment/mx51.js +0 -0
  221. package/lib/modules/Payment/utils.d.ts +0 -17
  222. package/lib/modules/Payment/utils.js +0 -67
  223. package/lib/modules/Payment/walletpass.d.ts +0 -99
  224. package/lib/modules/Payment/walletpass.js +0 -484
  225. package/lib/plugins/app-types/app/app.d.ts +0 -83
  226. package/lib/plugins/app-types/app/const.d.ts +0 -4
  227. package/lib/plugins/app-types/app/index.d.ts +0 -14
  228. package/lib/plugins/app-types/applicationManager/application.d.ts +0 -50
  229. package/lib/plugins/app-types/applicationManager/index.d.ts +0 -13
  230. package/lib/plugins/app-types/config.d.ts +0 -3
  231. package/lib/plugins/app-types/cookie/index.d.ts +0 -13
  232. package/lib/plugins/app-types/data/index.d.ts +0 -8
  233. package/lib/plugins/app-types/history/config.d.ts +0 -24
  234. package/lib/plugins/app-types/history/index.d.ts +0 -20
  235. package/lib/plugins/app-types/history/type.d.ts +0 -2
  236. package/lib/plugins/app-types/hooks/index.d.ts +0 -12
  237. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  238. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  239. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  240. package/lib/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  241. package/lib/plugins/app-types/index.d.ts +0 -6
  242. package/lib/plugins/app-types/indexDB/index.d.ts +0 -178
  243. package/lib/plugins/app-types/locales/en.d.ts +0 -3
  244. package/lib/plugins/app-types/locales/index.d.ts +0 -37
  245. package/lib/plugins/app-types/locales/original.d.ts +0 -3
  246. package/lib/plugins/app-types/locales/type.d.ts +0 -19
  247. package/lib/plugins/app-types/locales/zh-CN.d.ts +0 -3
  248. package/lib/plugins/app-types/locales/zh-HK.d.ts +0 -3
  249. package/lib/plugins/app-types/logger/feishu.d.ts +0 -11
  250. package/lib/plugins/app-types/logger/index.d.ts +0 -122
  251. package/lib/plugins/app-types/menuManager/hooks.d.ts +0 -17
  252. package/lib/plugins/app-types/menuManager/index.d.ts +0 -28
  253. package/lib/plugins/app-types/models/global.d.ts +0 -32
  254. package/lib/plugins/app-types/models/index.d.ts +0 -45
  255. package/lib/plugins/app-types/models/type.d.ts +0 -2
  256. package/lib/plugins/app-types/package.json +0 -15
  257. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  258. package/lib/plugins/app-types/pubsub/example.d.ts +0 -5
  259. package/lib/plugins/app-types/pubsub/index.d.ts +0 -63
  260. package/lib/plugins/app-types/request/cache.d.ts +0 -46
  261. package/lib/plugins/app-types/request/cancelToken.d.ts +0 -38
  262. package/lib/plugins/app-types/request/config.d.ts +0 -3
  263. package/lib/plugins/app-types/request/constants.d.ts +0 -2
  264. package/lib/plugins/app-types/request/index.d.ts +0 -24
  265. package/lib/plugins/app-types/request/pisell2Request.d.ts +0 -6
  266. package/lib/plugins/app-types/request/type.d.ts +0 -41
  267. package/lib/plugins/app-types/request/utils.d.ts +0 -46
  268. package/lib/plugins/app-types/routes/config.d.ts +0 -7
  269. package/lib/plugins/app-types/routes/index.d.ts +0 -28
  270. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  271. package/lib/plugins/app-types/socket/components/index.d.ts +0 -2
  272. package/lib/plugins/app-types/socket/constants.d.ts +0 -33
  273. package/lib/plugins/app-types/socket/events.d.ts +0 -31
  274. package/lib/plugins/app-types/socket/heartbeat.d.ts +0 -66
  275. package/lib/plugins/app-types/socket/index.d.ts +0 -61
  276. package/lib/plugins/app-types/socket/monitor.d.ts +0 -169
  277. package/lib/plugins/app-types/socket/reconnect.d.ts +0 -61
  278. package/lib/plugins/app-types/socket/socket.d.ts +0 -129
  279. package/lib/plugins/app-types/socket/types.d.ts +0 -85
  280. package/lib/plugins/app-types/storage/index.d.ts +0 -17
  281. package/lib/plugins/app-types/tasks/index.d.ts +0 -77
  282. package/lib/plugins/app-types/tasks/type.d.ts +0 -62
  283. package/lib/plugins/app-types/tasks/useTasks.d.ts +0 -5
  284. package/lib/plugins/app-types/type.d.ts +0 -2
  285. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  286. package/lib/plugins/app-types/variables/config.d.ts +0 -3
  287. package/lib/plugins/app-types/variables/index.d.ts +0 -6
  288. package/lib/plugins/app-types/variables/type.d.ts +0 -2
  289. package/lib/plugins/app-types/website/index.d.ts +0 -6
  290. package/lib/plugins/app.d.ts +0 -8
  291. package/lib/plugins/app.js +0 -17
  292. package/lib/solution/BookingTicket/index.d.ts +0 -184
  293. package/lib/solution/BookingTicket/index.js +0 -426
  294. package/lib/solution/BookingTicket/types.d.ts +0 -68
  295. package/lib/solution/BookingTicket/types.js +0 -72
  296. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  297. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
  298. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
  299. package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -132
  300. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -85
  301. package/lib/solution/BookingTicket/utils/scan/index.js +0 -216
  302. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  303. package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
  304. package/lib/solution/Checkout/appointmentDemo.json +0 -1
  305. package/lib/solution/Checkout/index.d.ts +0 -432
  306. package/lib/solution/Checkout/index.js +0 -2776
  307. package/lib/solution/Checkout/types.d.ts +0 -727
  308. package/lib/solution/Checkout/types.js +0 -63
  309. package/lib/solution/Checkout/utils/index.d.ts +0 -121
  310. package/lib/solution/Checkout/utils/index.js +0 -362
  311. package/lib/utils/task.d.ts +0 -40
  312. package/lib/utils/task.js +0 -109
  313. package/lib/utils/watch.d.ts +0 -102
  314. package/lib/utils/watch.js +0 -217
@@ -1,37 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/modules/Customer/types.ts
20
- var types_exports = {};
21
- __export(types_exports, {
22
- CustomerHooks: () => CustomerHooks
23
- });
24
- module.exports = __toCommonJS(types_exports);
25
- var CustomerHooks = /* @__PURE__ */ ((CustomerHooks2) => {
26
- CustomerHooks2["OnCustomerListUpdate"] = "customer:onCustomerListUpdate";
27
- CustomerHooks2["OnCustomerListError"] = "customer:onError";
28
- CustomerHooks2["OnCustomerSelected"] = "customer:onCustomerSelected";
29
- CustomerHooks2["OnPaginationChange"] = "customer:onPaginationChange";
30
- CustomerHooks2["OnScrollLoadMore"] = "customer:onScrollLoadMore";
31
- CustomerHooks2["OnScrollLoadComplete"] = "customer:onScrollLoadComplete";
32
- return CustomerHooks2;
33
- })(CustomerHooks || {});
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- CustomerHooks
37
- });
@@ -1,19 +0,0 @@
1
- import { CashPayment } from './types';
2
- import type { PaymentModule } from './index';
3
- /**
4
- * 现金支付实现
5
- */
6
- export declare class CashPaymentImpl implements CashPayment {
7
- private paymentModule;
8
- constructor(paymentModule: PaymentModule);
9
- processCashPayment(amount: number, orderUuid: string): Promise<void>;
10
- getCashBalance(): Promise<number>;
11
- /**
12
- * 获取推荐支付金额
13
- * 基于目标金额和货币类型,返回最优支付金额建议
14
- * @param money 目标支付金额
15
- * @param currency 货币代码 (如: 'CNY', 'USD', 'EUR' 等)
16
- * @returns 推荐支付金额数组
17
- */
18
- getRecommendedAmount(money: number, currency: string): number[];
19
- }
@@ -1,64 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/modules/Payment/cash.ts
20
- var cash_exports = {};
21
- __export(cash_exports, {
22
- CashPaymentImpl: () => CashPaymentImpl
23
- });
24
- module.exports = __toCommonJS(cash_exports);
25
- var import_cashRecommendationAlgorithm = require("./cashRecommendationAlgorithm");
26
- var CashPaymentImpl = class {
27
- constructor(paymentModule) {
28
- this.paymentModule = paymentModule;
29
- }
30
- async processCashPayment(amount, orderUuid) {
31
- const cashMethod = await this.paymentModule.getCashPaymentMethod();
32
- if (!cashMethod) {
33
- throw new Error("现金支付方式未找到");
34
- }
35
- const paymentItem = {
36
- amount: amount.toString(),
37
- code: cashMethod.code,
38
- id: cashMethod.id,
39
- name: cashMethod.name,
40
- type: cashMethod.type,
41
- voucher_id: ""
42
- };
43
- await this.paymentModule.addPaymentItemAsync(orderUuid, paymentItem);
44
- }
45
- async getCashBalance() {
46
- return 0;
47
- }
48
- /**
49
- * 获取推荐支付金额
50
- * 基于目标金额和货币类型,返回最优支付金额建议
51
- * @param money 目标支付金额
52
- * @param currency 货币代码 (如: 'CNY', 'USD', 'EUR' 等)
53
- * @returns 推荐支付金额数组
54
- */
55
- getRecommendedAmount(money, currency) {
56
- const upperCurrency = currency.toUpperCase();
57
- const denominations = import_cashRecommendationAlgorithm.CURRENCY_DENOMINATIONS[upperCurrency] || import_cashRecommendationAlgorithm.CURRENCY_DENOMINATIONS["DEFAULT"];
58
- return (0, import_cashRecommendationAlgorithm.recommendOptimalPayments)(money, denominations);
59
- }
60
- };
61
- // Annotate the CommonJS export names for ESM import in node:
62
- 0 && (module.exports = {
63
- CashPaymentImpl
64
- });
@@ -1,22 +0,0 @@
1
- /**
2
- * 现金支付推荐算法
3
- *
4
- * 核心原理:
5
- * 1. 每个推荐金额都应该是独立的最优组合
6
- * 2. 不推荐在已有最优解基础上添加额外面额的组合
7
- * 3. 优先推荐使用不同数量币种的组合
8
- * 4. 根据组合判断去重,避免扩展组合
9
- */
10
- /**
11
- * 常见国家货币面额配置
12
- */
13
- export declare const CURRENCY_DENOMINATIONS: Record<string, number[]>;
14
- /**
15
- * 最优支付金额推荐算法
16
- * 推荐通过不同数量面额组合刚好足够支付的最小金额
17
- *
18
- * @param targetAmount 目标金额
19
- * @param denominations 币种面值数组
20
- * @returns 推荐支付金额数组
21
- */
22
- export declare function recommendOptimalPayments(targetAmount: number, denominations: number[]): number[];
@@ -1,342 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/modules/Payment/cashRecommendationAlgorithm.ts
20
- var cashRecommendationAlgorithm_exports = {};
21
- __export(cashRecommendationAlgorithm_exports, {
22
- CURRENCY_DENOMINATIONS: () => CURRENCY_DENOMINATIONS,
23
- recommendOptimalPayments: () => recommendOptimalPayments
24
- });
25
- module.exports = __toCommonJS(cashRecommendationAlgorithm_exports);
26
- var CURRENCY_DENOMINATIONS = {
27
- // 美元
28
- "USD": [100, 50, 20, 10, 5, 1, 0.5, 0.25, 0.1, 0.05, 0.01],
29
- // 人民币
30
- "CNY": [100, 50, 20, 10, 5, 1, 0.5, 0.1, 0.05, 0.01],
31
- "RMB": [100, 50, 20, 10, 5, 1, 0.5, 0.1, 0.05, 0.01],
32
- // 欧元
33
- "EUR": [500, 200, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.02, 0.01],
34
- // 日元
35
- "JPY": [1e4, 5e3, 2e3, 1e3, 500, 100, 50, 10, 5, 1],
36
- // 英镑
37
- "GBP": [50, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.02, 0.01],
38
- // 澳元
39
- "AUD": [100, 50, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1],
40
- // 加元
41
- "CAD": [100, 50, 20, 10, 5, 2, 1, 0.25, 0.1, 0.05],
42
- // 港元
43
- "HKD": [1e3, 500, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1],
44
- // 新台币
45
- "TWD": [2e3, 1e3, 500, 200, 100, 50, 10, 5, 1],
46
- // 韩元
47
- "KRW": [5e4, 1e4, 5e3, 1e3, 500, 100, 50, 10, 5, 1],
48
- // 新加坡元
49
- "SGD": [1e4, 1e3, 100, 50, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.01],
50
- // 瑞士法郎
51
- "CHF": [1e3, 200, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05],
52
- // 默认通用面额(如果币种不在列表中)
53
- "DEFAULT": [100, 50, 20, 10, 5, 1, 0.5, 0.25, 0.1, 0.05, 0.01]
54
- };
55
- function recommendOptimalPayments(targetAmount, denominations) {
56
- if (targetAmount <= 0 || !isFinite(targetAmount) || isNaN(targetAmount)) {
57
- return [];
58
- }
59
- if (!denominations || !Array.isArray(denominations) || denominations.length === 0) {
60
- return [Math.ceil(targetAmount)];
61
- }
62
- const maxReasonableDenom = targetAmount * 5;
63
- const validDenoms = denominations.filter((denom) => denom > 0 && isFinite(denom) && !isNaN(denom) && denom <= maxReasonableDenom).slice(0, 8);
64
- if (validDenoms.length === 0) {
65
- return [Math.ceil(targetAmount)];
66
- }
67
- try {
68
- const precision = 100;
69
- const target = Math.round(targetAmount * precision);
70
- const denoms = validDenoms.map((d) => Math.round(d * precision)).sort((a, b) => b - a);
71
- const paymentOptions = [];
72
- const exactCombination = findExactCombination(target, denoms, precision);
73
- if (exactCombination) {
74
- paymentOptions.push(exactCombination);
75
- }
76
- for (let i = 0; i < Math.min(denoms.length, 6); i++) {
77
- const denom = denoms[i];
78
- const count = Math.ceil(target / denom);
79
- const sum = count * denom;
80
- if (sum >= target && count <= 12) {
81
- paymentOptions.push({
82
- combination: Array(count).fill(denom / precision),
83
- sum: sum / precision,
84
- coinCount: count,
85
- denomTypes: 1
86
- });
87
- }
88
- }
89
- for (let i = 0; i < Math.min(denoms.length - 1, 5); i++) {
90
- for (let j = i + 1; j < Math.min(denoms.length, 6); j++) {
91
- const denom1 = denoms[i];
92
- const denom2 = denoms[j];
93
- const maxCount1 = Math.min(Math.ceil(target / denom1) + 1, 8);
94
- const maxCount2 = Math.min(Math.ceil(target / denom2) + 1, 10);
95
- for (let count1 = 1; count1 <= maxCount1; count1++) {
96
- for (let count2 = 1; count2 <= maxCount2; count2++) {
97
- const sum = count1 * denom1 + count2 * denom2;
98
- if (sum >= target) {
99
- const combination = [
100
- ...Array(count1).fill(denom1 / precision),
101
- ...Array(count2).fill(denom2 / precision)
102
- ];
103
- paymentOptions.push({
104
- combination,
105
- sum: sum / precision,
106
- coinCount: count1 + count2,
107
- denomTypes: 2
108
- });
109
- }
110
- }
111
- }
112
- }
113
- }
114
- for (let i = 0; i < Math.min(denoms.length - 2, 3); i++) {
115
- for (let j = i + 1; j < Math.min(denoms.length - 1, 4); j++) {
116
- for (let k = j + 1; k < Math.min(denoms.length, 5); k++) {
117
- const denom1 = denoms[i];
118
- const denom2 = denoms[j];
119
- const denom3 = denoms[k];
120
- const maxCount1 = Math.min(Math.ceil(target / denom1) + 1, 5);
121
- const maxCount2 = Math.min(Math.ceil(target / denom2) + 1, 6);
122
- const maxCount3 = Math.min(Math.ceil(target / denom3) + 1, 8);
123
- for (let count1 = 1; count1 <= maxCount1; count1++) {
124
- for (let count2 = 1; count2 <= maxCount2; count2++) {
125
- for (let count3 = 1; count3 <= maxCount3; count3++) {
126
- const sum = count1 * denom1 + count2 * denom2 + count3 * denom3;
127
- if (sum >= target) {
128
- const combination = [
129
- ...Array(count1).fill(denom1 / precision),
130
- ...Array(count2).fill(denom2 / precision),
131
- ...Array(count3).fill(denom3 / precision)
132
- ];
133
- paymentOptions.push({
134
- combination,
135
- sum: sum / precision,
136
- coinCount: count1 + count2 + count3,
137
- denomTypes: 3
138
- });
139
- }
140
- }
141
- }
142
- }
143
- }
144
- }
145
- }
146
- for (let i = 0; i < Math.min(denoms.length - 3, 2); i++) {
147
- for (let j = i + 1; j < Math.min(denoms.length - 2, 3); j++) {
148
- for (let k = j + 1; k < Math.min(denoms.length - 1, 4); k++) {
149
- for (let l = k + 1; l < Math.min(denoms.length, 5); l++) {
150
- const denom1 = denoms[i];
151
- const denom2 = denoms[j];
152
- const denom3 = denoms[k];
153
- const denom4 = denoms[l];
154
- const maxCount1 = Math.min(Math.ceil(target / denom1) + 1, 3);
155
- const maxCount2 = Math.min(Math.ceil(target / denom2) + 1, 4);
156
- const maxCount3 = Math.min(Math.ceil(target / denom3) + 1, 5);
157
- const maxCount4 = Math.min(Math.ceil(target / denom4) + 1, 6);
158
- for (let count1 = 1; count1 <= maxCount1; count1++) {
159
- for (let count2 = 1; count2 <= maxCount2; count2++) {
160
- for (let count3 = 1; count3 <= maxCount3; count3++) {
161
- for (let count4 = 1; count4 <= maxCount4; count4++) {
162
- const sum = count1 * denom1 + count2 * denom2 + count3 * denom3 + count4 * denom4;
163
- if (sum >= target) {
164
- const combination = [
165
- ...Array(count1).fill(denom1 / precision),
166
- ...Array(count2).fill(denom2 / precision),
167
- ...Array(count3).fill(denom3 / precision),
168
- ...Array(count4).fill(denom4 / precision)
169
- ];
170
- paymentOptions.push({
171
- combination,
172
- sum: sum / precision,
173
- coinCount: count1 + count2 + count3 + count4,
174
- denomTypes: 4
175
- });
176
- }
177
- }
178
- }
179
- }
180
- }
181
- }
182
- }
183
- }
184
- }
185
- if (paymentOptions.length === 0) {
186
- const minValidDenom = validDenoms.find((denom) => denom >= targetAmount);
187
- if (minValidDenom) {
188
- return [minValidDenom];
189
- } else {
190
- const maxDenom = Math.max(...validDenoms);
191
- const count = Math.ceil(targetAmount / maxDenom);
192
- return [count * maxDenom];
193
- }
194
- }
195
- const uniqueCombinations = removeDuplicateAndExtendedCombinations(paymentOptions, targetAmount);
196
- uniqueCombinations.sort((a, b) => {
197
- if (a.denomTypes !== b.denomTypes) {
198
- return a.denomTypes - b.denomTypes;
199
- }
200
- if (a.coinCount !== b.coinCount) {
201
- return a.coinCount - b.coinCount;
202
- }
203
- return a.sum - b.sum;
204
- });
205
- const uniqueAmounts = /* @__PURE__ */ new Set();
206
- const finalResults = [];
207
- for (const item of uniqueCombinations) {
208
- const roundedAmount = Math.round(item.sum * 100) / 100;
209
- if (!uniqueAmounts.has(roundedAmount) && finalResults.length < 10) {
210
- uniqueAmounts.add(roundedAmount);
211
- finalResults.push(roundedAmount);
212
- }
213
- }
214
- return finalResults.sort((a, b) => a - b);
215
- } catch (error) {
216
- console.warn("推荐支付金额计算出错:", error);
217
- const safeAmount = Math.ceil(targetAmount);
218
- return [targetAmount, safeAmount];
219
- }
220
- }
221
- function findExactCombination(target, denoms, precision) {
222
- function dfs(remaining, denomIndex, currentCombination) {
223
- if (remaining === 0) {
224
- return currentCombination;
225
- }
226
- if (remaining < 0 || denomIndex >= denoms.length || currentCombination.length > 10) {
227
- return null;
228
- }
229
- const denom = denoms[denomIndex];
230
- const maxCount = Math.min(Math.floor(remaining / denom), 8);
231
- for (let count = maxCount; count >= 0; count--) {
232
- const newCombination = [...currentCombination, ...Array(count).fill(denom)];
233
- const result = dfs(remaining - count * denom, denomIndex + 1, newCombination);
234
- if (result) {
235
- return result;
236
- }
237
- }
238
- return null;
239
- }
240
- const exactMatch = dfs(target, 0, []);
241
- if (exactMatch && exactMatch.length > 0) {
242
- const denomTypes = new Set(exactMatch).size;
243
- return {
244
- combination: exactMatch.map((d) => d / precision),
245
- sum: target / precision,
246
- coinCount: exactMatch.length,
247
- denomTypes
248
- };
249
- }
250
- return null;
251
- }
252
- function removeDuplicateAndExtendedCombinations(combinations, targetAmount) {
253
- const result = [];
254
- combinations.sort((a, b) => {
255
- if (a.denomTypes !== b.denomTypes) {
256
- return a.denomTypes - b.denomTypes;
257
- }
258
- if (a.coinCount !== b.coinCount) {
259
- return a.coinCount - b.coinCount;
260
- }
261
- return a.sum - b.sum;
262
- });
263
- for (let i = 0; i < combinations.length; i++) {
264
- const current = combinations[i];
265
- let shouldSkip = false;
266
- for (let j = 0; j < result.length; j++) {
267
- const existing = result[j];
268
- if (isSameCombination(current.combination, existing.combination)) {
269
- shouldSkip = true;
270
- break;
271
- }
272
- if (isExtensionOf(current.combination, existing.combination)) {
273
- shouldSkip = true;
274
- break;
275
- }
276
- }
277
- if (!shouldSkip) {
278
- for (let j = result.length - 1; j >= 0; j--) {
279
- if (isExtensionOf(result[j].combination, current.combination)) {
280
- result.splice(j, 1);
281
- }
282
- }
283
- result.push(current);
284
- }
285
- }
286
- return result;
287
- }
288
- function isExtensionOf(combinationA, combinationB) {
289
- if (combinationA.length <= combinationB.length) {
290
- return false;
291
- }
292
- const countA = {};
293
- const countB = {};
294
- combinationA.forEach((coin) => {
295
- countA[coin] = (countA[coin] || 0) + 1;
296
- });
297
- combinationB.forEach((coin) => {
298
- countB[coin] = (countB[coin] || 0) + 1;
299
- });
300
- for (const coin in countB) {
301
- if (!countA[coin] || countA[coin] < countB[coin]) {
302
- return false;
303
- }
304
- }
305
- let hasExtra = false;
306
- for (const coin in countA) {
307
- if (countA[coin] > (countB[coin] || 0)) {
308
- hasExtra = true;
309
- break;
310
- }
311
- }
312
- return hasExtra;
313
- }
314
- function isSameCombination(combinationA, combinationB) {
315
- if (combinationA.length !== combinationB.length) {
316
- return false;
317
- }
318
- const countA = {};
319
- const countB = {};
320
- combinationA.forEach((coin) => {
321
- countA[coin] = (countA[coin] || 0) + 1;
322
- });
323
- combinationB.forEach((coin) => {
324
- countB[coin] = (countB[coin] || 0) + 1;
325
- });
326
- for (const coin in countA) {
327
- if (countA[coin] !== (countB[coin] || 0)) {
328
- return false;
329
- }
330
- }
331
- for (const coin in countB) {
332
- if (countB[coin] !== (countA[coin] || 0)) {
333
- return false;
334
- }
335
- }
336
- return true;
337
- }
338
- // Annotate the CommonJS export names for ESM import in node:
339
- 0 && (module.exports = {
340
- CURRENCY_DENOMINATIONS,
341
- recommendOptimalPayments
342
- });
@@ -1,11 +0,0 @@
1
- import { EftposPayment } from './types';
2
- import type { PaymentModule } from './index';
3
- /**
4
- * Eftpos支付实现
5
- */
6
- export declare class EftposPaymentImpl implements EftposPayment {
7
- private paymentModule;
8
- constructor(paymentModule: PaymentModule);
9
- processEftposPayment(amount: number, orderUuid: string): Promise<void>;
10
- checkDeviceStatus(): Promise<boolean>;
11
- }
@@ -1,51 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/modules/Payment/eftpos.ts
20
- var eftpos_exports = {};
21
- __export(eftpos_exports, {
22
- EftposPaymentImpl: () => EftposPaymentImpl
23
- });
24
- module.exports = __toCommonJS(eftpos_exports);
25
- var EftposPaymentImpl = class {
26
- constructor(paymentModule) {
27
- this.paymentModule = paymentModule;
28
- }
29
- async processEftposPayment(amount, orderUuid) {
30
- const eftposMethod = await this.paymentModule.getEftposPaymentMethod();
31
- if (!eftposMethod) {
32
- throw new Error("Eftpos支付方式未找到");
33
- }
34
- const paymentItem = {
35
- amount: amount.toString(),
36
- code: eftposMethod.code,
37
- id: eftposMethod.id,
38
- name: eftposMethod.name,
39
- type: eftposMethod.type,
40
- voucher_id: ""
41
- };
42
- await this.paymentModule.addPaymentItemAsync(orderUuid, paymentItem);
43
- }
44
- async checkDeviceStatus() {
45
- return true;
46
- }
47
- };
48
- // Annotate the CommonJS export names for ESM import in node:
49
- 0 && (module.exports = {
50
- EftposPaymentImpl
51
- });
File without changes
File without changes
@@ -1,17 +0,0 @@
1
- export declare const getAvailableMaxAmount: (data: Record<string, any>) => any;
2
- /**
3
- * 将walletPass列表数据转换为prepare_payments需要的数据格式
4
- * @param list
5
- */
6
- export declare const formatWalletPassList2PreparePayments: (list?: any[]) => {
7
- voucher_id: any;
8
- amount: number;
9
- tag: any;
10
- }[];
11
- /**
12
- * 对用户识别码列表进行排序
13
- * 排序规则:正常数据 -> unified_available_status===1 -> 500601/500602 -> unified_available_status===0
14
- * @param list 用户识别码列表
15
- * @returns 排序后的列表
16
- */
17
- export declare const sortUserIdentificationCodeList: (list: any[]) => any[];
@@ -1,67 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/modules/Payment/utils.ts
20
- var utils_exports = {};
21
- __export(utils_exports, {
22
- formatWalletPassList2PreparePayments: () => formatWalletPassList2PreparePayments,
23
- getAvailableMaxAmount: () => getAvailableMaxAmount,
24
- sortUserIdentificationCodeList: () => sortUserIdentificationCodeList
25
- });
26
- module.exports = __toCommonJS(utils_exports);
27
- var getAvailableMaxAmount = (data) => {
28
- return data.tag !== "point_card" ? data.available_max_amount : data == null ? void 0 : data.recommended_usage_amount;
29
- };
30
- var formatWalletPassList2PreparePayments = (list) => {
31
- return (list || []).map((item) => {
32
- return {
33
- voucher_id: item.id || 0,
34
- amount: Number(item.edit_current_amount || getAvailableMaxAmount(item)) || 0,
35
- tag: item.tag || ""
36
- };
37
- });
38
- };
39
- var sortUserIdentificationCodeList = (list) => {
40
- if (!Array.isArray(list) || list.length === 0) {
41
- return list;
42
- }
43
- const middlePriorityErrorCodes = ["500601", "500602"];
44
- return list.sort((a, b) => {
45
- const getPriority = (item) => {
46
- var _a;
47
- const errorCode = (_a = item.unified_error_code) == null ? void 0 : _a.toString();
48
- const availableStatus = item.unified_available_status;
49
- if (errorCode && middlePriorityErrorCodes.includes(errorCode))
50
- return 2;
51
- if (availableStatus === 0)
52
- return 3;
53
- if (availableStatus === 1)
54
- return 1;
55
- return 0;
56
- };
57
- const aPriority = getPriority(a);
58
- const bPriority = getPriority(b);
59
- return aPriority - bPriority;
60
- });
61
- };
62
- // Annotate the CommonJS export names for ESM import in node:
63
- 0 && (module.exports = {
64
- formatWalletPassList2PreparePayments,
65
- getAvailableMaxAmount,
66
- sortUserIdentificationCodeList
67
- });