@mercurjs/admin 2.2.0-canary.18 → 2.2.0-canary.19

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 (173) hide show
  1. package/dist/{add-campaign-promotions-4QP4LF7G.js → add-campaign-promotions-KK4JMLSK.js} +3 -3
  2. package/dist/{adjust-inventory-AHIKDW7M.js → adjust-inventory-F3OTF6O6.js} +5 -5
  3. package/dist/{api-key-management-detail-ZRLG6YRB.js → api-key-management-detail-JMWPGN6M.js} +6 -6
  4. package/dist/{attribute-create-NIYUQEHQ.js → attribute-create-TJRNP5SK.js} +7 -7
  5. package/dist/{attribute-detail-GA4FDSAG.js → attribute-detail-7I2SQCDK.js} +6 -6
  6. package/dist/{attribute-edit-KJL36HQ4.js → attribute-edit-UBG6SMUF.js} +2 -2
  7. package/dist/{attribute-edit-possible-value-LGOD3ZKQ.js → attribute-edit-possible-value-3BYEPC4X.js} +2 -2
  8. package/dist/{attribute-list-A3RFO32Z.js → attribute-list-EFU4DPB5.js} +5 -5
  9. package/dist/{campaign-detail-A7ZM4Q7M.js → campaign-detail-H32E6EDD.js} +9 -9
  10. package/dist/{categories-metadata-FCV4YK74.js → categories-metadata-V37DXTVZ.js} +5 -5
  11. package/dist/{category-detail-CIEHVR4M.js → category-detail-5MRHPG6T.js} +10 -10
  12. package/dist/{category-products-AB3YAGSW.js → category-products-3KYY662O.js} +9 -9
  13. package/dist/{chunk-WUGV75DM.js → chunk-3F6U44M6.js} +1 -1
  14. package/dist/{chunk-IBX52HBP.js → chunk-3N7QXAMO.js} +1 -1
  15. package/dist/{chunk-K2C42QAV.js → chunk-4DYSSDAA.js} +4 -4
  16. package/dist/{chunk-2PUBUYFG.js → chunk-5GXPXVVD.js} +2 -2
  17. package/dist/{chunk-CIKXWLWE.js → chunk-6AYGDFNE.js} +2 -2
  18. package/dist/{chunk-G5DQCCPL.js → chunk-6LG3VL3Q.js} +2 -2
  19. package/dist/{chunk-A2GVK4VZ.js → chunk-AXVZ56UD.js} +2 -2
  20. package/dist/{chunk-2LKMOTLX.js → chunk-B7HIZN4V.js} +2 -2
  21. package/dist/{chunk-EOLSQKPV.js → chunk-BJQ4UBK7.js} +529 -480
  22. package/dist/{chunk-OMBP3YSV.js → chunk-CFBEBAQS.js} +1 -1
  23. package/dist/{chunk-FJRNNDZS.js → chunk-EASE3NLF.js} +1 -1
  24. package/dist/chunk-EG45GIE3.js +368 -0
  25. package/dist/{chunk-TWCYZF6X.js → chunk-EM5TF7YZ.js} +1 -1
  26. package/dist/{chunk-MEXH366L.js → chunk-FCLS6CKW.js} +2 -2
  27. package/dist/{chunk-ENFXIYIH.js → chunk-FYKG35MR.js} +1 -1
  28. package/dist/{chunk-VZ7GNMGX.js → chunk-GA4ZFAOV.js} +1 -1
  29. package/dist/{chunk-RZ5SFALB.js → chunk-GFUCELIZ.js} +2 -2
  30. package/dist/{chunk-OFOKVLV3.js → chunk-GHGOOZEL.js} +2 -2
  31. package/dist/{chunk-CVZA23ES.js → chunk-GNWWL47L.js} +3 -3
  32. package/dist/{chunk-MR3MLNWV.js → chunk-HYQPZADS.js} +1 -1
  33. package/dist/{chunk-DELK6EWH.js → chunk-IHTQOPB6.js} +1 -1
  34. package/dist/chunk-JEJQKTZO.js +191 -0
  35. package/dist/{chunk-5BF5JDWT.js → chunk-JWE2IW4R.js} +5 -5
  36. package/dist/chunk-KZB7LCF2.js +82 -0
  37. package/dist/{chunk-N6YOACEW.js → chunk-L5Z4JGRD.js} +1 -1
  38. package/dist/{chunk-3VDLE5GA.js → chunk-LVCIAKJI.js} +1 -1
  39. package/dist/{chunk-PE6JFXWU.js → chunk-MFIT2RX5.js} +1 -1
  40. package/dist/{chunk-ZB4TESPP.js → chunk-O62SUNK2.js} +16 -7
  41. package/dist/{chunk-Q5WTOVZZ.js → chunk-O63MLTQV.js} +71 -0
  42. package/dist/{chunk-WPVDACTL.js → chunk-OA24YN34.js} +1 -1
  43. package/dist/{chunk-3DMUKRIX.js → chunk-OXONMLRP.js} +2 -2
  44. package/dist/{chunk-LJDGVBOQ.js → chunk-PJR6W35H.js} +1 -1
  45. package/dist/chunk-PN5C4AND.js +115 -0
  46. package/dist/chunk-QR3GYYX6.js +0 -0
  47. package/dist/{chunk-VT6QIVZW.js → chunk-RMAQKNBA.js} +10 -1
  48. package/dist/{chunk-IEPH6A2W.js → chunk-RV7DWZZB.js} +2 -2
  49. package/dist/chunk-RXRDZ47F.js +103 -0
  50. package/dist/{chunk-623TMW36.js → chunk-T53YX34K.js} +1 -1
  51. package/dist/{chunk-EYFWEKFJ.js → chunk-TLOJG7LK.js} +2 -2
  52. package/dist/{chunk-7Y6A7XK6.js → chunk-UCHVBAUB.js} +2 -2
  53. package/dist/{chunk-47W2JHOE.js → chunk-UT2O7IS7.js} +2 -2
  54. package/dist/{chunk-B4K7H6DH.js → chunk-UUTACMA5.js} +1 -1
  55. package/dist/{chunk-JSMUFZZN.js → chunk-WHIYSLYW.js} +1 -1
  56. package/dist/{chunk-SEQJOCTT.js → chunk-X4N7EMFO.js} +2 -2
  57. package/dist/{chunk-RUSMGNQ6.js → chunk-X7E65HM2.js} +1 -1
  58. package/dist/{chunk-RWRL4AXD.js → chunk-XKD67CD4.js} +2 -2
  59. package/dist/{chunk-UCYSCKZV.js → chunk-Y7FNFQCU.js} +1 -6
  60. package/dist/{chunk-HEGPAGJT.js → chunk-YI7I7JFX.js} +2 -2
  61. package/dist/{chunk-EB6ZFOTO.js → chunk-YLK2WZU3.js} +2 -2
  62. package/dist/{chunk-OCRKS4Z7.js → chunk-ZDJWTF64.js} +2 -2
  63. package/dist/{chunk-T4GL73RP.js → chunk-ZG6DNI7O.js} +1 -1
  64. package/dist/{chunk-OHOWEMHO.js → chunk-ZIFHQXP3.js} +31 -25
  65. package/dist/{collection-add-products-KTUW23TD.js → collection-add-products-4EZ6W4N6.js} +9 -9
  66. package/dist/{collection-detail-TR7TDQZG.js → collection-detail-X22ZIM5S.js} +10 -10
  67. package/dist/{collection-list-FOWSOTS7.js → collection-list-6CUEOLUU.js} +9 -9
  68. package/dist/{collection-metadata-DS32TGOK.js → collection-metadata-AWJYPZKR.js} +5 -5
  69. package/dist/commission-rule-commission-edit-TA3H3EEN.js +196 -0
  70. package/dist/commission-rule-create-O7Z25SC7.js +412 -0
  71. package/dist/commission-rule-detail-I7LVSNAM.js +45 -0
  72. package/dist/commission-rule-edit-YSHDTYZY.js +342 -0
  73. package/dist/{commission-rate-list-Y5XLEO67.js → commissions-list-OUGVPED6.js} +13 -4
  74. package/dist/{customer-detail-5XGZ2K3H.js → customer-detail-6MBW3FHO.js} +6 -6
  75. package/dist/{customer-group-detail-JX3BEYFG.js → customer-group-detail-G53RB6EA.js} +5 -5
  76. package/dist/{customer-group-list-F5TFLDVH.js → customer-group-list-XDNCZ4K6.js} +5 -5
  77. package/dist/{customer-group-metadata-CHOTUAS2.js → customer-group-metadata-FWLKUHIZ.js} +5 -5
  78. package/dist/{customer-metadata-LG6HA56I.js → customer-metadata-KU4YWD3R.js} +5 -5
  79. package/dist/{customers-add-customer-group-3YKZEZKJ.js → customers-add-customer-group-5Y5XPN7C.js} +5 -5
  80. package/dist/{edit-inventory-item-5EYVQ6CM.js → edit-inventory-item-MBLHBGBH.js} +5 -5
  81. package/dist/{edit-inventory-item-attributes-7QM4YHAQ.js → edit-inventory-item-attributes-GTTGNBO4.js} +5 -5
  82. package/dist/{edit-rules-2S5H7MC2.js → edit-rules-UFGKSAJV.js} +5 -5
  83. package/dist/global-commission-edit-LCD6JJUX.js +194 -0
  84. package/dist/index.js +158 -150
  85. package/dist/{inventory-create-RBMMOSC3.js → inventory-create-4O4L6NXK.js} +5 -5
  86. package/dist/{inventory-detail-LSAJ3ZB5.js → inventory-detail-ZWHSLLLI.js} +5 -5
  87. package/dist/{inventory-metadata-OZAKLWNY.js → inventory-metadata-GZYYWU3S.js} +5 -5
  88. package/dist/{inventory-stock-WUAIUFQS.js → inventory-stock-S5B6ZZQW.js} +5 -5
  89. package/dist/{location-detail-PBCP7BBV.js → location-detail-QS7HM2KG.js} +5 -5
  90. package/dist/{location-fulfillment-providers-D4EFIF3Z.js → location-fulfillment-providers-6RUGYQ3W.js} +7 -7
  91. package/dist/{location-list-DM4WU57J.js → location-list-7RTDLHGR.js} +5 -5
  92. package/dist/{location-service-zone-shipping-option-create-T4LT4E6M.js → location-service-zone-shipping-option-create-UKULBDGM.js} +5 -5
  93. package/dist/{login-LTASZXSR.js → login-SFGV4QGP.js} +5 -5
  94. package/dist/{marketplace-detail-GSPPUVR7.js → marketplace-detail-7VPTFUPB.js} +5 -5
  95. package/dist/{marketplace-metadata-PB7JEK2K.js → marketplace-metadata-E25VT5TH.js} +5 -5
  96. package/dist/{offers-D2QQQD2F.js → offers-WYAJB75N.js} +9 -9
  97. package/dist/{order-create-claim-HND7RODU.js → order-create-claim-3AQK3FH2.js} +3 -3
  98. package/dist/{order-create-edit-LIQGALQ2.js → order-create-edit-UFD26FE2.js} +2 -2
  99. package/dist/{order-create-exchange-QE2TJ36U.js → order-create-exchange-QCYD3DC4.js} +7 -7
  100. package/dist/{order-create-refund-37JJA6MM.js → order-create-refund-TR4XMHRY.js} +5 -5
  101. package/dist/{order-create-return-AVVT3OUO.js → order-create-return-Y7QS52UL.js} +2 -2
  102. package/dist/{order-detail-A2WC2OZU.js → order-detail-FZT74HMD.js} +10 -10
  103. package/dist/{order-edit-billing-address-IPWVSYR2.js → order-edit-billing-address-OJZICMBN.js} +6 -6
  104. package/dist/{order-edit-email-ZQZNTV4P.js → order-edit-email-TH26N5HK.js} +5 -5
  105. package/dist/{order-edit-shipping-address-YPYWT3YN.js → order-edit-shipping-address-GBOUGZPD.js} +5 -5
  106. package/dist/{order-list-QR3ZVI4U.js → order-list-C5YOR6B5.js} +2 -2
  107. package/dist/{order-metadata-E25YHGCC.js → order-metadata-RT3BVTYZ.js} +5 -5
  108. package/dist/{order-request-transfer-XDNXRB66.js → order-request-transfer-3HTFPYFD.js} +5 -5
  109. package/dist/pages/index.d.ts +5 -23
  110. package/dist/pages/index.js +79 -77
  111. package/dist/{price-list-create-GBUUE3NP.js → price-list-create-XQWV352E.js} +10 -10
  112. package/dist/{price-list-detail-77FAEXXO.js → price-list-detail-347UU3LU.js} +10 -10
  113. package/dist/{price-list-prices-add-2XS5TX5X.js → price-list-prices-add-R656I6QF.js} +10 -10
  114. package/dist/{price-list-prices-edit-C2C3I64A.js → price-list-prices-edit-BOKBTLEI.js} +5 -5
  115. package/dist/{product-add-existing-attributes-NFXKW6SW.js → product-add-existing-attributes-MNGWZFGD.js} +7 -7
  116. package/dist/{product-create-AG4AYDM3.js → product-create-LMYR36NA.js} +9 -9
  117. package/dist/{product-create-variant-7DVYYUDX.js → product-create-variant-XETT2WJC.js} +3 -3
  118. package/dist/{product-detail-CNVETME5.js → product-detail-WSL4PXKK.js} +7 -7
  119. package/dist/{product-edit-attribute-GXFMVPCQ.js → product-edit-attribute-XEYHQJ6D.js} +2 -2
  120. package/dist/{product-list-KM37QJ6F.js → product-list-7YPGRGHX.js} +10 -10
  121. package/dist/{product-media-H5DAWUYR.js → product-media-H6SYBNLI.js} +2 -2
  122. package/dist/{product-metadata-4ZLL42UF.js → product-metadata-MGLJJ7QG.js} +5 -5
  123. package/dist/{product-tag-create-KKRQQT3A.js → product-tag-create-JCYAG42N.js} +5 -5
  124. package/dist/{product-tag-detail-R6UFJDCW.js → product-tag-detail-AUNKJJLP.js} +12 -12
  125. package/dist/{product-tag-edit-TISDF4FQ.js → product-tag-edit-2FREKKVN.js} +5 -5
  126. package/dist/{product-tag-list-NFPQVVMO.js → product-tag-list-IKL46JZT.js} +12 -12
  127. package/dist/{product-tag-metadata-GJFYX5HU.js → product-tag-metadata-UV3TBPXS.js} +5 -5
  128. package/dist/{product-type-detail-XJPSQDL2.js → product-type-detail-DKHKFADI.js} +13 -13
  129. package/dist/{product-type-metadata-GKVLFBF6.js → product-type-metadata-22OACFMD.js} +8 -8
  130. package/dist/{product-variant-detail-VCMC4BZP.js → product-variant-detail-MNMJBYIP.js} +5 -5
  131. package/dist/{product-variant-edit-QLDFN6LI.js → product-variant-edit-THZLEOGL.js} +7 -7
  132. package/dist/{product-variant-metadata-VZZMPRRG.js → product-variant-metadata-7N7PL7WY.js} +5 -5
  133. package/dist/{promotion-create-POBB7B23.js → promotion-create-RB3AA5GE.js} +5 -5
  134. package/dist/{promotion-detail-NSOGXQAY.js → promotion-detail-PEDTLXZ4.js} +8 -8
  135. package/dist/{promotion-list-7C3SQCSO.js → promotion-list-MCYWN5TF.js} +4 -4
  136. package/dist/{refund-reason-create-HPLJOL6S.js → refund-reason-create-YWA5XP4J.js} +5 -5
  137. package/dist/{refund-reason-edit-JI4U4RWO.js → refund-reason-edit-MBG5WL43.js} +5 -5
  138. package/dist/{refund-reason-list-SWU4B2ED.js → refund-reason-list-GPDRI2QM.js} +10 -10
  139. package/dist/{region-metadata-LDWMTB7G.js → region-metadata-WDZ7DRGU.js} +5 -5
  140. package/dist/{reservation-detail-BLPISKPA.js → reservation-detail-WTYOR6IB.js} +5 -5
  141. package/dist/{reservation-metadata-AZ265HZI.js → reservation-metadata-PJVHEJRU.js} +5 -5
  142. package/dist/{reset-password-6CAYNSJ6.js → reset-password-2NVKH6QA.js} +1 -1
  143. package/dist/{return-reason-list-7HTIV7NK.js → return-reason-list-E6L7VJY7.js} +5 -5
  144. package/dist/{sales-channel-add-products-S47CQCJF.js → sales-channel-add-products-BKT3CFLY.js} +9 -9
  145. package/dist/{sales-channel-detail-6JPHP4FZ.js → sales-channel-detail-MUBMJGQV.js} +10 -10
  146. package/dist/{sales-channel-list-D673ONK2.js → sales-channel-list-O5SFOGMA.js} +5 -5
  147. package/dist/{sales-channel-metadata-OY47MCFI.js → sales-channel-metadata-67RGBA7X.js} +5 -5
  148. package/dist/{shipping-option-type-create-H2YRDETZ.js → shipping-option-type-create-OBF6GG5W.js} +5 -5
  149. package/dist/{shipping-option-type-detail-NVSXILP4.js → shipping-option-type-detail-TJC2GBUA.js} +7 -7
  150. package/dist/{shipping-option-type-edit-KBPDYAUJ.js → shipping-option-type-edit-INKLJRSH.js} +5 -5
  151. package/dist/{shipping-option-type-list-OUKJZJ6R.js → shipping-option-type-list-WKA64NYE.js} +7 -7
  152. package/dist/{shipping-profile-metadata-CQCDC45M.js → shipping-profile-metadata-RI6Y2N6V.js} +5 -5
  153. package/dist/{store-bulk-edit-DXWHZMGL.js → store-bulk-edit-WML2DUA4.js} +1 -1
  154. package/dist/{store-create-MVHUY3I3.js → store-create-AGF2LZWR.js} +5 -5
  155. package/dist/{store-details-V3NMV665.js → store-details-3HWOCRYI.js} +11 -11
  156. package/dist/{store-edit-6CC2GBFY.js → store-edit-5WWOOSHT.js} +3 -3
  157. package/dist/{store-list-WV6XHGLU.js → store-list-YEEKX2AV.js} +9 -9
  158. package/dist/{store-member-invite-7YIXFC56.js → store-member-invite-TULPI3N5.js} +1 -1
  159. package/dist/{tax-region-create-RGE5ZIBR.js → tax-region-create-X2LAHX27.js} +6 -6
  160. package/dist/{tax-region-detail-OKEK6WNJ.js → tax-region-detail-3X3TNFJA.js} +5 -5
  161. package/dist/{tax-region-edit-QQ3LB74P.js → tax-region-edit-7ECYGXEA.js} +5 -5
  162. package/dist/{tax-region-metadata-GPTD6KZB.js → tax-region-metadata-FQLEYY2R.js} +5 -5
  163. package/dist/{tax-region-province-detail-WHO3RLUX.js → tax-region-province-detail-DIV5AAFQ.js} +5 -5
  164. package/dist/{tax-region-tax-override-create-223MPYUG.js → tax-region-tax-override-create-BV4O3QCU.js} +14 -16
  165. package/dist/{tax-region-tax-override-edit-WFOXP6A7.js → tax-region-tax-override-edit-QUA77YTI.js} +16 -18
  166. package/dist/{user-metadata-A3JS6O4K.js → user-metadata-64LX64QI.js} +5 -5
  167. package/package.json +1 -1
  168. package/dist/chunk-AKTAFKIU.js +0 -228
  169. package/dist/chunk-HLJ24XVH.js +0 -390
  170. package/dist/chunk-SWL7ZCP3.js +0 -11
  171. package/dist/commission-rate-create-G42ZUJPH.js +0 -782
  172. package/dist/commission-rate-detail-VGYTGWLH.js +0 -85
  173. package/dist/commission-rate-edit-3CYWYOMS.js +0 -767
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-J3AMUGGZ.js";
10
10
  import {
11
11
  useMemberTableQuery
12
- } from "./chunk-MR3MLNWV.js";
12
+ } from "./chunk-HYQPZADS.js";
13
13
  import {
14
14
  useOrderTableQuery
15
15
  } from "./chunk-QUHSHIAC.js";
@@ -21,10 +21,10 @@ import {
21
21
  } from "./chunk-MDABSESI.js";
22
22
  import {
23
23
  useProductTableColumns
24
- } from "./chunk-OMBP3YSV.js";
24
+ } from "./chunk-CFBEBAQS.js";
25
25
  import {
26
26
  useProductTableFilters
27
- } from "./chunk-RZ5SFALB.js";
27
+ } from "./chunk-GFUCELIZ.js";
28
28
  import {
29
29
  useProductTableQuery
30
30
  } from "./chunk-LYZDVZWA.js";
@@ -43,7 +43,7 @@ import {
43
43
  } from "./chunk-E74OUNA3.js";
44
44
  import {
45
45
  require_dist
46
- } from "./chunk-UCYSCKZV.js";
46
+ } from "./chunk-Y7FNFQCU.js";
47
47
  import {
48
48
  useApproveSeller,
49
49
  useDeleteSellerInvite,
@@ -57,7 +57,7 @@ import {
57
57
  } from "./chunk-LEG67A2R.js";
58
58
  import {
59
59
  useOrders
60
- } from "./chunk-VT6QIVZW.js";
60
+ } from "./chunk-RMAQKNBA.js";
61
61
  import {
62
62
  ActionMenu
63
63
  } from "./chunk-BDGZ4EQO.js";
@@ -0,0 +1,82 @@
1
+ import {
2
+ PercentageInput
3
+ } from "./chunk-MAEP2UCK.js";
4
+ import {
5
+ getCurrencySymbol
6
+ } from "./chunk-IQPN4PZJ.js";
7
+ import {
8
+ Form
9
+ } from "./chunk-3QSRE5LS.js";
10
+ import {
11
+ useStore
12
+ } from "./chunk-FXWKGNRV.js";
13
+
14
+ // src/pages/commissions/common/hooks/use-store-currencies.tsx
15
+ var useStoreCurrencies = () => {
16
+ const { store, isPending } = useStore();
17
+ const currencies = (store?.supported_currencies ?? []).slice().sort((a, b) => a.is_default === b.is_default ? 0 : a.is_default ? -1 : 1).map((c) => c.currency_code.toLowerCase());
18
+ return { currencies, isPending };
19
+ };
20
+
21
+ // src/pages/commissions/common/components/commission-value-fields.tsx
22
+ import { CurrencyInput, Label } from "@medusajs/ui";
23
+ import { useTranslation } from "react-i18next";
24
+ import { jsx, jsxs } from "react/jsx-runtime";
25
+ var CommissionValueFields = ({
26
+ control,
27
+ type,
28
+ currencies
29
+ }) => {
30
+ const { t } = useTranslation();
31
+ if (type === "percentage") {
32
+ return /* @__PURE__ */ jsx(
33
+ Form.Field,
34
+ {
35
+ control,
36
+ name: "value",
37
+ render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
38
+ /* @__PURE__ */ jsx(Form.Label, { children: t("commissions.fields.value", "Value") }),
39
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
40
+ PercentageInput,
41
+ {
42
+ ...field,
43
+ value,
44
+ onValueChange: (_v, _n, values) => onChange(values?.float ?? 0)
45
+ }
46
+ ) }),
47
+ /* @__PURE__ */ jsx(Form.ErrorMessage, {})
48
+ ] })
49
+ }
50
+ );
51
+ }
52
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-2", children: [
53
+ /* @__PURE__ */ jsx(Label, { size: "small", weight: "plus", children: t("commissions.fields.value", "Value") }),
54
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-y-2", children: currencies.map((code) => /* @__PURE__ */ jsx(
55
+ Form.Field,
56
+ {
57
+ control,
58
+ name: `fixed_values.${code}`,
59
+ render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
60
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
61
+ CurrencyInput,
62
+ {
63
+ min: 0,
64
+ code,
65
+ symbol: getCurrencySymbol(code),
66
+ onValueChange: (val) => onChange(val ? parseFloat(val) : 0),
67
+ ...field,
68
+ value: value ?? ""
69
+ }
70
+ ) }),
71
+ /* @__PURE__ */ jsx(Form.ErrorMessage, {})
72
+ ] })
73
+ },
74
+ code
75
+ )) })
76
+ ] });
77
+ };
78
+
79
+ export {
80
+ useStoreCurrencies,
81
+ CommissionValueFields
82
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useDeleteShippingOptionType
3
- } from "./chunk-LJDGVBOQ.js";
3
+ } from "./chunk-PJR6W35H.js";
4
4
 
5
5
  // src/pages/shipping-option-types/common/hooks/use-delete-shipping-option-type-action.tsx
6
6
  import { useNavigate } from "react-router-dom";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  require_dist
3
- } from "./chunk-UCYSCKZV.js";
3
+ } from "./chunk-Y7FNFQCU.js";
4
4
  import {
5
5
  __toESM
6
6
  } from "./chunk-NBMM2TZK.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-RK5N3XIX.js";
4
4
  import {
5
5
  getPromotionStatus
6
- } from "./chunk-RUSMGNQ6.js";
6
+ } from "./chunk-X7E65HM2.js";
7
7
  import {
8
8
  formatPercentage
9
9
  } from "./chunk-QDPLZDMX.js";
@@ -1,9 +1,9 @@
1
- import {
2
- useProductTypeTableColumns
3
- } from "./chunk-O5VKW5FL.js";
4
1
  import {
5
2
  TaxRateRuleReferenceType
6
3
  } from "./chunk-LTBX54CI.js";
4
+ import {
5
+ useProductTypeTableColumns
6
+ } from "./chunk-O5VKW5FL.js";
7
7
  import {
8
8
  useShippingOptionTableFilters
9
9
  } from "./chunk-KOURHC2N.js";
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-HC25LNX7.js";
16
16
  import {
17
17
  useShippingOptionTableQuery
18
- } from "./chunk-MR3MLNWV.js";
18
+ } from "./chunk-HYQPZADS.js";
19
19
  import {
20
20
  useProductTypeTableQuery
21
21
  } from "./chunk-VOHEQ7B5.js";
@@ -27,10 +27,10 @@ import {
27
27
  } from "./chunk-JHIMVLB2.js";
28
28
  import {
29
29
  useProductTableColumns
30
- } from "./chunk-OMBP3YSV.js";
30
+ } from "./chunk-CFBEBAQS.js";
31
31
  import {
32
32
  useProductTableFilters
33
- } from "./chunk-RZ5SFALB.js";
33
+ } from "./chunk-GFUCELIZ.js";
34
34
  import {
35
35
  useProductTableQuery
36
36
  } from "./chunk-LYZDVZWA.js";
@@ -593,8 +593,17 @@ var TaxRateRuleTargetSchema = z.object({
593
593
  references: z.array(TaxRateRuleReferenceSchema)
594
594
  });
595
595
 
596
+ // src/pages/tax-regions/common/utils.ts
597
+ var createTaxRulePayload = (target) => {
598
+ return target.references.map((reference) => ({
599
+ reference: target.reference_type,
600
+ reference_id: reference.value
601
+ }));
602
+ };
603
+
596
604
  export {
597
605
  TargetForm,
598
606
  TargetItem,
599
- TaxRateRuleReferenceSchema
607
+ TaxRateRuleReferenceSchema,
608
+ createTaxRulePayload
600
609
  };
@@ -12559,6 +12559,77 @@ var en_default = {
12559
12559
  commissionLines: {
12560
12560
  domain: "Commission Lines"
12561
12561
  },
12562
+ commissions: {
12563
+ domain: "Commissions",
12564
+ create: {
12565
+ header: "Create Commission Rule",
12566
+ details: "Details",
12567
+ commission: "Commission",
12568
+ successToast: "Commission rule created"
12569
+ },
12570
+ edit: {
12571
+ header: "Edit Commission Rule",
12572
+ successToast: "Commission rule updated"
12573
+ },
12574
+ delete: {
12575
+ description: "Are you sure you want to delete this commission rule?",
12576
+ successToast: "Commission rule deleted"
12577
+ },
12578
+ fields: {
12579
+ code: "Code",
12580
+ value: "Value",
12581
+ enabled: "Enabled",
12582
+ enabledHint: "Enable or disable this commission rule.",
12583
+ stores: "Stores",
12584
+ productTypes: "Product Types",
12585
+ categories: "Categories",
12586
+ taxIncluded: "Tax included",
12587
+ taxIncludedHint: "If checked, commission is calculated on the total including tax. If unchecked, tax is excluded and goes entirely to the store.",
12588
+ shippingIncluded: "Shipping included",
12589
+ shippingIncludedHint: "If checked, commission is calculated on the total including shipping. If unchecked, shipping fees go entirely to the store.",
12590
+ type: {
12591
+ label: "Type",
12592
+ percentage: "Percentage",
12593
+ fixed: "Fixed"
12594
+ },
12595
+ scopeType: {
12596
+ label: "Type",
12597
+ store: "Store",
12598
+ productType: "Product Type",
12599
+ category: "Category",
12600
+ storeProductType: "Store + Product Type",
12601
+ storeCategory: "Store + Category"
12602
+ }
12603
+ },
12604
+ global: {
12605
+ title: "Global Commission",
12606
+ code: "Code",
12607
+ type: "Type",
12608
+ value: "Value",
12609
+ tax: "Tax",
12610
+ shipping: "Shipping",
12611
+ included: "Included in commission",
12612
+ notIncluded: "Not included in commission",
12613
+ edit: {
12614
+ header: "Edit Global Commission",
12615
+ successToast: "Global commission updated"
12616
+ }
12617
+ },
12618
+ rules: {
12619
+ title: "Commission Rules",
12620
+ columns: {
12621
+ rule: "Rule",
12622
+ scope: "Scope",
12623
+ type: "Type",
12624
+ value: "Value",
12625
+ status: "Status"
12626
+ }
12627
+ },
12628
+ status: {
12629
+ enabled: "Active",
12630
+ disabled: "Inactive"
12631
+ }
12632
+ },
12562
12633
  commissionRates: {
12563
12634
  domain: "Commission Rates",
12564
12635
  description: "Manage commission rates and rules for your marketplace.",
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-PHOCVOZ5.js";
7
7
  import {
8
8
  require_dist
9
- } from "./chunk-UCYSCKZV.js";
9
+ } from "./chunk-Y7FNFQCU.js";
10
10
  import {
11
11
  __toESM
12
12
  } from "./chunk-NBMM2TZK.js";
@@ -12,10 +12,10 @@ import {
12
12
  } from "./chunk-Y456KVIN.js";
13
13
  import {
14
14
  useProductTableColumns
15
- } from "./chunk-OMBP3YSV.js";
15
+ } from "./chunk-CFBEBAQS.js";
16
16
  import {
17
17
  useProductTableFilters
18
- } from "./chunk-RZ5SFALB.js";
18
+ } from "./chunk-GFUCELIZ.js";
19
19
  import {
20
20
  useProductTableQuery
21
21
  } from "./chunk-LYZDVZWA.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ordersQueryKeys
3
- } from "./chunk-VT6QIVZW.js";
3
+ } from "./chunk-RMAQKNBA.js";
4
4
  import {
5
5
  queryClient
6
6
  } from "./chunk-RHKRREUU.js";
@@ -0,0 +1,115 @@
1
+ // src/pages/commissions/common/types.ts
2
+ var SCOPE_TYPE_DIMENSIONS = {
3
+ store: ["seller"],
4
+ product_type: ["product_type"],
5
+ category: ["product_category"],
6
+ store_product_type: ["seller", "product_type"],
7
+ store_category: ["seller", "product_category"]
8
+ };
9
+
10
+ // src/pages/commissions/common/utils.ts
11
+ var buildRulesFromScope = (scopeType, { stores, productTypes, categories }) => {
12
+ const dimensions = SCOPE_TYPE_DIMENSIONS[scopeType];
13
+ const rules = [];
14
+ if (dimensions.includes("seller")) {
15
+ stores.forEach((id) => rules.push({ reference: "seller", reference_id: id }));
16
+ }
17
+ if (dimensions.includes("product_type")) {
18
+ productTypes.forEach(
19
+ (id) => rules.push({ reference: "product_type", reference_id: id })
20
+ );
21
+ }
22
+ if (dimensions.includes("product_category")) {
23
+ categories.forEach(
24
+ (id) => rules.push({ reference: "product_category", reference_id: id })
25
+ );
26
+ }
27
+ return rules;
28
+ };
29
+ var diffScopeRules = (existing = [], desired = []) => {
30
+ const key = (r) => `${r.reference}:${r.reference_id}`;
31
+ const existingByKey = new Map(existing.map((r) => [key(r), r]));
32
+ const desiredKeys = new Set(desired.map(key));
33
+ const create = desired.filter((r) => !existingByKey.has(key(r)));
34
+ const remove = existing.filter((r) => !desiredKeys.has(key(r))).map((r) => r.id);
35
+ return { create, delete: remove };
36
+ };
37
+ var deriveScopeType = (rules = []) => {
38
+ const refs = new Set(rules.map((r) => r.reference));
39
+ const hasSeller = refs.has("seller");
40
+ const hasType = refs.has("product_type");
41
+ const hasCategory = refs.has("product_category");
42
+ if (hasSeller && hasType) return "store_product_type";
43
+ if (hasSeller && hasCategory) return "store_category";
44
+ if (hasSeller) return "store";
45
+ if (hasType) return "product_type";
46
+ if (hasCategory) return "category";
47
+ return null;
48
+ };
49
+ var SCOPE_TYPE_LABEL_KEY = {
50
+ store: "commissions.fields.scopeType.store",
51
+ product_type: "commissions.fields.scopeType.productType",
52
+ category: "commissions.fields.scopeType.category",
53
+ store_product_type: "commissions.fields.scopeType.storeProductType",
54
+ store_category: "commissions.fields.scopeType.storeCategory"
55
+ };
56
+ var SCOPE_TYPE_FALLBACK = {
57
+ store: "Store",
58
+ product_type: "Product Type",
59
+ category: "Category",
60
+ store_product_type: "Store + Product Type",
61
+ store_category: "Store + Category"
62
+ };
63
+ var getScopeTypeLabel = (rules = [], t) => {
64
+ const scopeType = deriveScopeType(rules);
65
+ if (!scopeType) return "-";
66
+ return t(SCOPE_TYPE_LABEL_KEY[scopeType], SCOPE_TYPE_FALLBACK[scopeType]);
67
+ };
68
+ var referenceIds = (rules = [], reference) => rules.filter((r) => r.reference === reference).map((r) => r.reference_id);
69
+ var getScopeSummary = (rules = [], names) => {
70
+ if (!rules.length) return "-";
71
+ const labels = rules.map((r) => names?.[r.reference_id] ?? r.reference_id);
72
+ const head = labels.slice(0, 2).join(", ");
73
+ const extra = labels.length - 2;
74
+ return extra > 0 ? `${head} +${extra}` : head;
75
+ };
76
+ var formatCommissionValue = (rate) => {
77
+ if (rate.type === "percentage") {
78
+ return `${rate.value}%`;
79
+ }
80
+ const values = rate.values ?? [];
81
+ if (!values.length) {
82
+ return rate.currency_code ? `${rate.value} ${rate.currency_code.toUpperCase()}` : `${rate.value}`;
83
+ }
84
+ const head = values.slice(0, 2).map((v) => `${v.amount} ${v.currency_code.toUpperCase()}`).join(" / ");
85
+ const extra = values.length - 2;
86
+ return extra > 0 ? `${head} / +${extra}` : head;
87
+ };
88
+ var getIsActiveProps = (isEnabled, t) => isEnabled ? {
89
+ color: "green",
90
+ label: t("commissions.status.enabled", "Active")
91
+ } : {
92
+ color: "grey",
93
+ label: t("commissions.status.disabled", "Inactive")
94
+ };
95
+ var buildValuesPayload = (currencies, fixedValues = {}) => currencies.map((code) => ({
96
+ currency_code: code,
97
+ amount: Number(fixedValues[code] ?? 0)
98
+ }));
99
+ var fixedValuesFromRate = (rate) => Object.fromEntries(
100
+ (rate.values ?? []).map((v) => [v.currency_code, v.amount])
101
+ );
102
+
103
+ export {
104
+ SCOPE_TYPE_DIMENSIONS,
105
+ buildRulesFromScope,
106
+ diffScopeRules,
107
+ deriveScopeType,
108
+ getScopeTypeLabel,
109
+ referenceIds,
110
+ getScopeSummary,
111
+ formatCommissionValue,
112
+ getIsActiveProps,
113
+ buildValuesPayload,
114
+ fixedValuesFromRate
115
+ };
File without changes
@@ -136,6 +136,14 @@ var useCancelOrderTransfer = (orderId, options) => {
136
136
  ...options
137
137
  });
138
138
  };
139
+ var useOrderCommissionLines = (id, options) => {
140
+ const { data, ...rest } = useQuery({
141
+ queryFn: async () => sdk.admin.orders.$id.commissionLines.query({ $id: id }),
142
+ queryKey: ordersQueryKeys.detail(`${id}/commission-lines`),
143
+ ...options
144
+ });
145
+ return { commission_lines: data?.commission_lines ?? [], ...rest };
146
+ };
139
147
 
140
148
  export {
141
149
  ordersQueryKeys,
@@ -148,5 +156,6 @@ export {
148
156
  useOrderLineItems,
149
157
  useCancelOrder,
150
158
  useRequestTransferOrder,
151
- useCancelOrderTransfer
159
+ useCancelOrderTransfer,
160
+ useOrderCommissionLines
152
161
  };
@@ -27,10 +27,10 @@ import {
27
27
  } from "./chunk-THHRRYRS.js";
28
28
  import {
29
29
  require_dist
30
- } from "./chunk-UCYSCKZV.js";
30
+ } from "./chunk-Y7FNFQCU.js";
31
31
  import {
32
32
  useProductTag
33
- } from "./chunk-LJDGVBOQ.js";
33
+ } from "./chunk-PJR6W35H.js";
34
34
  import {
35
35
  productAttributesQueryKeys,
36
36
  useProductAttribute
@@ -0,0 +1,103 @@
1
+ import {
2
+ useProductTypes
3
+ } from "./chunk-46M463BR.js";
4
+ import {
5
+ useDeleteCommissionRule
6
+ } from "./chunk-ZIFHQXP3.js";
7
+ import {
8
+ useSellers
9
+ } from "./chunk-LEG67A2R.js";
10
+ import {
11
+ useProductCategories
12
+ } from "./chunk-KYFWVLWO.js";
13
+
14
+ // src/pages/commissions/common/hooks/use-delete-commission-rule-action.tsx
15
+ import { toast, usePrompt } from "@medusajs/ui";
16
+ import { useTranslation } from "react-i18next";
17
+ import { useNavigate } from "react-router-dom";
18
+ var useDeleteCommissionRuleAction = (rule) => {
19
+ const { t } = useTranslation();
20
+ const prompt = usePrompt();
21
+ const navigate = useNavigate();
22
+ const { mutateAsync } = useDeleteCommissionRule(rule.id);
23
+ return async () => {
24
+ const confirmed = await prompt({
25
+ title: t("general.areYouSure"),
26
+ description: t("commissions.delete.description", {
27
+ name: rule.name,
28
+ defaultValue: `Are you sure you want to delete the commission rule "${rule.name}"?`
29
+ }),
30
+ confirmText: t("actions.delete"),
31
+ cancelText: t("actions.cancel")
32
+ });
33
+ if (!confirmed) {
34
+ return;
35
+ }
36
+ await mutateAsync(void 0, {
37
+ onSuccess: () => {
38
+ toast.success(
39
+ t("commissions.delete.successToast", {
40
+ defaultValue: "Commission rule deleted"
41
+ })
42
+ );
43
+ navigate("/settings/commissions");
44
+ },
45
+ onError: (e) => {
46
+ toast.error(e.message);
47
+ }
48
+ });
49
+ };
50
+ };
51
+
52
+ // src/pages/commissions/common/hooks/use-scope-reference-names.tsx
53
+ import { useMemo } from "react";
54
+ var idsFor = (rules = [], reference) => rules.filter((r) => r.reference === reference).map((r) => r.reference_id);
55
+ var useScopeReferenceNames = (rules = []) => {
56
+ const sellerIds = useMemo(() => idsFor(rules, "seller"), [rules]);
57
+ const productTypeIds = useMemo(
58
+ () => idsFor(rules, "product_type"),
59
+ [rules]
60
+ );
61
+ const categoryIds = useMemo(
62
+ () => idsFor(rules, "product_category"),
63
+ [rules]
64
+ );
65
+ const { sellers, isLoading: sellersLoading } = useSellers(
66
+ { id: sellerIds, fields: "id,name", limit: sellerIds.length || 1 },
67
+ { enabled: sellerIds.length > 0 }
68
+ );
69
+ const { product_types: productTypes, isLoading: typesLoading } = useProductTypes(
70
+ { id: productTypeIds, fields: "id,value", limit: productTypeIds.length || 1 },
71
+ { enabled: productTypeIds.length > 0 }
72
+ );
73
+ const { product_categories: categories, isLoading: categoriesLoading } = useProductCategories(
74
+ {
75
+ id: categoryIds,
76
+ fields: "id,name",
77
+ limit: categoryIds.length || 1
78
+ },
79
+ { enabled: categoryIds.length > 0 }
80
+ );
81
+ const names = useMemo(() => {
82
+ const map = {};
83
+ for (const s of sellers ?? []) {
84
+ map[s.id] = s.name;
85
+ }
86
+ for (const pt of productTypes ?? []) {
87
+ map[pt.id] = pt.value;
88
+ }
89
+ for (const c of categories ?? []) {
90
+ map[c.id] = c.name;
91
+ }
92
+ return map;
93
+ }, [sellers, productTypes, categories]);
94
+ return {
95
+ names,
96
+ isLoading: sellerIds.length > 0 && sellersLoading || productTypeIds.length > 0 && typesLoading || categoryIds.length > 0 && categoriesLoading
97
+ };
98
+ };
99
+
100
+ export {
101
+ useDeleteCommissionRuleAction,
102
+ useScopeReferenceNames
103
+ };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-5A4JNOK3.js";
4
4
  import {
5
5
  useReturnReasonTableQuery
6
- } from "./chunk-MR3MLNWV.js";
6
+ } from "./chunk-HYQPZADS.js";
7
7
  import {
8
8
  useDeleteReturnReason,
9
9
  useReturnReasons
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useDeleteShippingOptionTypeAction
3
- } from "./chunk-N6YOACEW.js";
3
+ } from "./chunk-L5Z4JGRD.js";
4
4
  import {
5
5
  SingleColumnPage
6
6
  } from "./chunk-H6MYB7GB.js";
7
7
  import {
8
8
  useShippingOptionType
9
- } from "./chunk-LJDGVBOQ.js";
9
+ } from "./chunk-PJR6W35H.js";
10
10
  import {
11
11
  ActionMenu
12
12
  } from "./chunk-BDGZ4EQO.js";
@@ -10,7 +10,7 @@ import {
10
10
  decorateVariantsWithDefaultValues,
11
11
  generateVariantsFromAttributes,
12
12
  normalizeProductFormValues
13
- } from "./chunk-T4GL73RP.js";
13
+ } from "./chunk-ZG6DNI7O.js";
14
14
  import {
15
15
  HandleInput
16
16
  } from "./chunk-HJ56YXBU.js";
@@ -58,7 +58,7 @@ import {
58
58
  } from "./chunk-C4XKPQ6T.js";
59
59
  import {
60
60
  require_dist
61
- } from "./chunk-UCYSCKZV.js";
61
+ } from "./chunk-Y7FNFQCU.js";
62
62
  import {
63
63
  useProductAttributes
64
64
  } from "./chunk-533GMKEG.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  useProductTableColumns
3
- } from "./chunk-OMBP3YSV.js";
3
+ } from "./chunk-CFBEBAQS.js";
4
4
  import {
5
5
  useProductTableFilters
6
- } from "./chunk-RZ5SFALB.js";
6
+ } from "./chunk-GFUCELIZ.js";
7
7
  import {
8
8
  useProductTableQuery
9
9
  } from "./chunk-LYZDVZWA.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-XGUUM3S6.js";
4
4
  import {
5
5
  ordersQueryKeys
6
- } from "./chunk-VT6QIVZW.js";
6
+ } from "./chunk-RMAQKNBA.js";
7
7
  import {
8
8
  inventoryItemsQueryKeys
9
9
  } from "./chunk-M2E3PKA4.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-AW77UWCZ.js";
4
4
  import {
5
5
  require_dist
6
- } from "./chunk-UCYSCKZV.js";
6
+ } from "./chunk-Y7FNFQCU.js";
7
7
  import {
8
8
  __toESM
9
9
  } from "./chunk-NBMM2TZK.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  useProductTableColumns
3
- } from "./chunk-OMBP3YSV.js";
3
+ } from "./chunk-CFBEBAQS.js";
4
4
  import {
5
5
  useProductTableFilters
6
- } from "./chunk-RZ5SFALB.js";
6
+ } from "./chunk-GFUCELIZ.js";
7
7
  import {
8
8
  useProductTableQuery
9
9
  } from "./chunk-LYZDVZWA.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  i18n
3
- } from "./chunk-Q5WTOVZZ.js";
3
+ } from "./chunk-O63MLTQV.js";
4
4
 
5
5
  // src/lib/promotions.ts
6
6
  var getPromotionStatusMap = () => ({