@mercurjs/admin 2.2.0 → 2.2.1-canary.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 (275) hide show
  1. package/dist/{add-campaign-promotions-KXVCLUG2.js → add-campaign-promotions-ARQN65B6.js} +9 -8
  2. package/dist/{adjust-inventory-5ZJJUEMJ.js → adjust-inventory-4ZOZCMSO.js} +10 -10
  3. package/dist/{api-key-management-create-OXI6OTIU.js → api-key-management-create-KJAP6KDX.js} +3 -3
  4. package/dist/{api-key-management-detail-ZTFHZK2W.js → api-key-management-detail-RV5Q45EV.js} +12 -12
  5. package/dist/{api-key-management-edit-QF5SAQE5.js → api-key-management-edit-N75HXUJF.js} +3 -3
  6. package/dist/{api-key-management-list-44HTIZDU.js → api-key-management-list-NGPTRNEE.js} +6 -6
  7. package/dist/{api-key-management-sales-channels-7HNHPB4N.js → api-key-management-sales-channels-A5F3D42D.js} +4 -4
  8. package/dist/{attribute-create-AGLZ6QOX.js → attribute-create-WDI2GMPM.js} +15 -15
  9. package/dist/{attribute-detail-62HLJFM3.js → attribute-detail-ZNPHAIL7.js} +18 -18
  10. package/dist/{attribute-edit-ZJS7KNRQ.js → attribute-edit-LBMZVL3O.js} +2 -2
  11. package/dist/{attribute-edit-possible-value-XK6DK7C3.js → attribute-edit-possible-value-RWG3U7IG.js} +2 -2
  12. package/dist/{attribute-list-VKAQ6254.js → attribute-list-QXNNF3NN.js} +13 -13
  13. package/dist/{breadcrumb-OF67XUWE.js → breadcrumb-2NHCSFUI.js} +1 -1
  14. package/dist/{campaign-budget-edit-TCWGNELH.js → campaign-budget-edit-7NXMWE2S.js} +1 -1
  15. package/dist/{campaign-configuration-AFGSG3MV.js → campaign-configuration-67I6NQNR.js} +1 -1
  16. package/dist/{campaign-create-OZV25GTH.js → campaign-create-NCJ4NA2B.js} +2 -2
  17. package/dist/{campaign-detail-G7DKPI5W.js → campaign-detail-MM5I4RGN.js} +18 -18
  18. package/dist/{campaign-edit-F6V6FWKS.js → campaign-edit-Z6A5J2G4.js} +1 -1
  19. package/dist/{campaign-list-QMEX7LES.js → campaign-list-FHPFFEM5.js} +4 -4
  20. package/dist/{categories-metadata-EKGY5IY2.js → categories-metadata-UN7P2PDA.js} +10 -10
  21. package/dist/{category-create-K452J7D3.js → category-create-3F6PHBRW.js} +3 -3
  22. package/dist/{category-detail-HUZ7MHT5.js → category-detail-RSGX5IKI.js} +18 -18
  23. package/dist/{category-edit-KP2ZSV6X.js → category-edit-YIGHQ442.js} +2 -2
  24. package/dist/{category-icon-edit-NNA7WVQV.js → category-icon-edit-6ZVXC4ID.js} +2 -2
  25. package/dist/{category-list-PXL4RTYP.js → category-list-SUER3DE3.js} +6 -6
  26. package/dist/{category-media-RFMA5Y5K.js → category-media-IEIIXESO.js} +2 -2
  27. package/dist/{category-organize-NNIYSZJT.js → category-organize-7QJ4MAA4.js} +2 -2
  28. package/dist/{category-products-RR5RFHYX.js → category-products-NOZYZHP7.js} +16 -16
  29. package/dist/chunk-2IDWFEKH.js +30 -0
  30. package/dist/{chunk-GS7VNGVP.js → chunk-2W4YIJYV.js} +1 -1
  31. package/dist/{chunk-4EM4RG5L.js → chunk-34AHGPLC.js} +1 -1
  32. package/dist/{chunk-46WFUTZ7.js → chunk-3FOZERFM.js} +4 -4
  33. package/dist/{chunk-XQ5IRC23.js → chunk-3PWLO7XZ.js} +4 -4
  34. package/dist/{chunk-TBZRRZP2.js → chunk-3RM44AH4.js} +2 -2
  35. package/dist/{chunk-GPACCA4B.js → chunk-4DHTLLPG.js} +2 -2
  36. package/dist/{chunk-XYLQODIX.js → chunk-4DWSG7TM.js} +2 -2
  37. package/dist/{chunk-6FZTLQKQ.js → chunk-4JNQHJKX.js} +4 -4
  38. package/dist/{chunk-52KJSIHS.js → chunk-4UQMRTSC.js} +1393 -1359
  39. package/dist/{chunk-BAW3F2JM.js → chunk-52C7Q74T.js} +2 -2
  40. package/dist/{chunk-FEEYWP65.js → chunk-5346HYMP.js} +1 -1
  41. package/dist/{chunk-2TTWEY5U.js → chunk-53KPM2IF.js} +1 -1
  42. package/dist/{chunk-EU2CV4TC.js → chunk-5P2YBCU4.js} +1 -1
  43. package/dist/{chunk-ZYW5QC2S.js → chunk-5SJGXU6J.js} +1 -1
  44. package/dist/{chunk-H6PRFXGU.js → chunk-5WJ6LPXM.js} +1 -1
  45. package/dist/{chunk-4TW5RTWO.js → chunk-5YT4OYMI.js} +2 -2
  46. package/dist/{chunk-IEYTK56D.js → chunk-6AUFNHJ4.js} +1 -1
  47. package/dist/{chunk-Z6KZDJNZ.js → chunk-6C5EXVG7.js} +4 -4
  48. package/dist/{chunk-N2WNCZLR.js → chunk-6L6HRSV7.js} +2 -2
  49. package/dist/{chunk-MSUG6ERE.js → chunk-6ZVLQ4IK.js} +3 -3
  50. package/dist/{chunk-WRAOTX6G.js → chunk-AJJSAJWK.js} +8 -4
  51. package/dist/{chunk-PQYZXLKV.js → chunk-AYK22LJU.js} +3 -3
  52. package/dist/{chunk-NHKZJMNX.js → chunk-BEHI3OYC.js} +2 -2
  53. package/dist/{chunk-XH2SXM7F.js → chunk-BIMJMDKU.js} +1 -1
  54. package/dist/{chunk-NGKC43E3.js → chunk-BNT2LEY5.js} +4 -4
  55. package/dist/{chunk-LAS6SXKB.js → chunk-C3SCJHQN.js} +1 -1
  56. package/dist/{chunk-3WT5O2NN.js → chunk-COH2G4BO.js} +2 -2
  57. package/dist/{chunk-LEHORJ76.js → chunk-CZN2FPHR.js} +1 -1
  58. package/dist/{chunk-TDDEAQ3T.js → chunk-EJNYP4ZP.js} +286 -229
  59. package/dist/{chunk-6QXSN5IG.js → chunk-EKLQ3PFC.js} +1 -1
  60. package/dist/{chunk-L2HIQAOS.js → chunk-EXZFNGEH.js} +11 -1
  61. package/dist/{chunk-CRKA4PUH.js → chunk-F5TGLYES.js} +3 -3
  62. package/dist/{chunk-PZRHF4NZ.js → chunk-FGHHNTWJ.js} +1 -1
  63. package/dist/{chunk-Y5RHBN7J.js → chunk-FRUJ3RNF.js} +1 -1
  64. package/dist/{chunk-P73BQ56H.js → chunk-GAHJUTEI.js} +6 -6
  65. package/dist/{chunk-D24Q3XHG.js → chunk-GBSL5JTZ.js} +1 -1
  66. package/dist/{chunk-IHO6OGWR.js → chunk-GINON6FD.js} +1 -1
  67. package/dist/{chunk-5JHHADVY.js → chunk-GUXBEXAN.js} +1 -1
  68. package/dist/{chunk-6RMCSQBI.js → chunk-GXKT2GQ7.js} +445 -211
  69. package/dist/{chunk-6XYDJWNG.js → chunk-GXYCGT7P.js} +1 -1
  70. package/dist/{chunk-4EBW73IY.js → chunk-GYMFTVB4.js} +1 -1
  71. package/dist/{chunk-U7XBLL2L.js → chunk-H3PH7ZYY.js} +5 -5
  72. package/dist/{chunk-HC2TEEKQ.js → chunk-HKHDRY5B.js} +4 -1
  73. package/dist/{chunk-IB7PFZNA.js → chunk-HRDRZOL4.js} +2 -2
  74. package/dist/{chunk-XIB2KDE7.js → chunk-HRPM4HIB.js} +1 -1
  75. package/dist/{chunk-QYPNC3U5.js → chunk-IPC6RQQ7.js} +1 -1
  76. package/dist/{chunk-QSB2PR6Y.js → chunk-IWS4FEAA.js} +3 -3
  77. package/dist/{chunk-GRFWCCUW.js → chunk-IZYVY2QV.js} +1 -1
  78. package/dist/{chunk-ICAXGUPY.js → chunk-J37PJ6OX.js} +15 -44
  79. package/dist/chunk-JU5ALCEN.js +82 -0
  80. package/dist/{chunk-7CAQDCJ4.js → chunk-JZZLMXG4.js} +1 -1
  81. package/dist/{chunk-PYNVCRQK.js → chunk-K4LPEHOH.js} +1 -1
  82. package/dist/{chunk-3C5EMQWG.js → chunk-LKGRPE3Y.js} +4 -4
  83. package/dist/{chunk-VWT7NSJO.js → chunk-LU7SPDKK.js} +89 -252
  84. package/dist/{chunk-YCAPN5F6.js → chunk-LUPIJMZB.js} +56 -26
  85. package/dist/{chunk-S2ZNHDPO.js → chunk-MUAEOX6S.js} +6 -6
  86. package/dist/{chunk-YBMTMG47.js → chunk-MXLSIF5V.js} +1 -1
  87. package/dist/{chunk-XVHXE7GQ.js → chunk-MXVWKV4Z.js} +2 -2
  88. package/dist/{chunk-JXMEDALI.js → chunk-MZNO6GSW.js} +1 -1
  89. package/dist/{chunk-7LSEDXCB.js → chunk-NGJUDYMP.js} +1 -1
  90. package/dist/{chunk-QF22CPST.js → chunk-NSCHKQQL.js} +4 -4
  91. package/dist/{chunk-O4X3FYQ2.js → chunk-NUD4H2VZ.js} +2 -2
  92. package/dist/{chunk-QD5I3ZC4.js → chunk-OADEOZJ3.js} +6 -6
  93. package/dist/{chunk-GSWFRYKT.js → chunk-OPIRMBSK.js} +5 -5
  94. package/dist/{chunk-O3Q2YJNR.js → chunk-OT323T4H.js} +5 -5
  95. package/dist/{chunk-SZCQUPC6.js → chunk-OY5QD46V.js} +1 -1
  96. package/dist/{chunk-HI2UJ43B.js → chunk-OZEICR2S.js} +3 -3
  97. package/dist/{chunk-CC7MG2B7.js → chunk-PBIJMBAE.js} +2 -2
  98. package/dist/{chunk-EDCGEQ4V.js → chunk-PEPANIBF.js} +1 -1
  99. package/dist/{chunk-EITNWVKQ.js → chunk-PVNB7ETQ.js} +1 -1
  100. package/dist/{chunk-ZNEC7NSD.js → chunk-PW64YRH4.js} +9 -9
  101. package/dist/{chunk-QRN63LUS.js → chunk-QE57IFSR.js} +1 -20
  102. package/dist/{chunk-R6433WFI.js → chunk-QMEFPNCA.js} +1 -1
  103. package/dist/{chunk-2O6SLX2J.js → chunk-R55WKWFH.js} +1 -1
  104. package/dist/{chunk-BVVZLZBO.js → chunk-R7Q23SWH.js} +3 -3
  105. package/dist/{chunk-4OMNDHD2.js → chunk-RDDZLUKZ.js} +18 -12
  106. package/dist/{chunk-AQCA7HGL.js → chunk-RKGGKEPI.js} +5 -5
  107. package/dist/{chunk-42BAC3EV.js → chunk-RLOKMTTN.js} +11 -0
  108. package/dist/{chunk-6TJPMF7U.js → chunk-RPWO23NX.js} +2 -2
  109. package/dist/{chunk-FU6XA7IT.js → chunk-SNRPPG3Z.js} +3 -3
  110. package/dist/{chunk-LZSUKT5X.js → chunk-TF74ITJS.js} +6 -6
  111. package/dist/{chunk-UCA7UES2.js → chunk-U4BIWWRA.js} +1 -1
  112. package/dist/{chunk-I6T244NF.js → chunk-U6EIJREE.js} +1 -1
  113. package/dist/{chunk-XRSHPAED.js → chunk-UNNSF2VP.js} +1 -1
  114. package/dist/chunk-UST2RGWB.js +37 -0
  115. package/dist/{chunk-KX6C5FDB.js → chunk-V52NWX56.js} +1 -1
  116. package/dist/{chunk-7PPT3477.js → chunk-VBEQXZ2Z.js} +19 -10
  117. package/dist/{chunk-J5CQ6F6U.js → chunk-VKHGNAFW.js} +1 -1
  118. package/dist/{chunk-LNBYVXJX.js → chunk-VQN77LKF.js} +59 -10
  119. package/dist/{chunk-NLLX6JO6.js → chunk-WE4RBSHT.js} +3 -3
  120. package/dist/{chunk-XJAMGFC5.js → chunk-WIFK6L7P.js} +2 -2
  121. package/dist/{chunk-HPFFEXS6.js → chunk-WJJBIAJI.js} +2 -2
  122. package/dist/{chunk-5NC3VFXY.js → chunk-WR3WSUIV.js} +1 -1
  123. package/dist/{chunk-GNBUH5DG.js → chunk-WX5UZZZD.js} +1 -1
  124. package/dist/{chunk-GTFDJLHW.js → chunk-Y2UMDTV4.js} +22 -17
  125. package/dist/{chunk-HEXXU3V3.js → chunk-Y3IDGFA4.js} +3 -3
  126. package/dist/{chunk-CRHUF6Q6.js → chunk-YG65LX2W.js} +2 -2
  127. package/dist/{chunk-QHVRUP4S.js → chunk-YNPIZEWG.js} +2 -2
  128. package/dist/{chunk-4XRTTHJZ.js → chunk-YTBPZ5MO.js} +1 -1
  129. package/dist/{collection-add-products-CJEX5A53.js → collection-add-products-HPEJTRYI.js} +16 -16
  130. package/dist/{collection-create-TBEK75Y3.js → collection-create-3ZCR6VGP.js} +2 -2
  131. package/dist/{collection-detail-H2Q6WOUM.js → collection-detail-W6CGGW5S.js} +17 -17
  132. package/dist/{collection-edit-7RBQZNQ6.js → collection-edit-LIIDFJ6T.js} +2 -2
  133. package/dist/{collection-icon-edit-JQZXC2S3.js → collection-icon-edit-GMWBV5EA.js} +2 -2
  134. package/dist/{collection-list-ZMDJT77J.js → collection-list-AFDLBBLJ.js} +18 -18
  135. package/dist/{collection-media-H3CQH6DM.js → collection-media-FHD3IAES.js} +2 -2
  136. package/dist/{collection-metadata-7FOQ22FA.js → collection-metadata-PEBMVFM3.js} +10 -10
  137. package/dist/{commission-rule-detail-ISEXGPY6.js → commission-rule-detail-FSV6PA6Y.js} +4 -4
  138. package/dist/{commissions-list-OJ44UKGL.js → commissions-list-PRA3DROC.js} +6 -6
  139. package/dist/{customer-detail-LB5A5RDI.js → customer-detail-Z63YC3CC.js} +14 -14
  140. package/dist/{customer-group-add-customers-DK32GSHX.js → customer-group-add-customers-ZROAA2ZG.js} +2 -2
  141. package/dist/{customer-group-detail-TABEQDDU.js → customer-group-detail-K6TMJ66E.js} +13 -13
  142. package/dist/{customer-group-list-FLSK5QJD.js → customer-group-list-TJFAFJJA.js} +13 -13
  143. package/dist/{customer-group-metadata-V5S6BIXN.js → customer-group-metadata-2GHR645Q.js} +10 -10
  144. package/dist/{customer-list-E72FR2HJ.js → customer-list-BK2SAQES.js} +3 -3
  145. package/dist/{customer-metadata-4LLZ4ZMR.js → customer-metadata-H2BVMMPM.js} +10 -10
  146. package/dist/{customers-add-customer-group-FCZYSHXJ.js → customers-add-customer-group-YFNPS2EL.js} +12 -12
  147. package/dist/{edit-inventory-item-46KQFZVA.js → edit-inventory-item-DD5ZG32Y.js} +10 -10
  148. package/dist/{edit-inventory-item-attributes-ELHT4C2Y.js → edit-inventory-item-attributes-VNLOF6NO.js} +10 -10
  149. package/dist/{edit-reservation-PCKNMHXC.js → edit-reservation-CA6SMY3V.js} +2 -2
  150. package/dist/{edit-rules-GDQHJ3YV.js → edit-rules-F42247KN.js} +20 -12
  151. package/dist/extension-targets.d.ts +2 -2
  152. package/dist/index.css +14 -5
  153. package/dist/index.d.ts +4 -5
  154. package/dist/index.js +215 -215
  155. package/dist/{inventory-create-POFYTZXF.js → inventory-create-VDO4OWZJ.js} +11 -11
  156. package/dist/{inventory-detail-BKRLIEBM.js → inventory-detail-CBGHNIHH.js} +13 -13
  157. package/dist/{inventory-list-FEV27NU6.js → inventory-list-YRGVDHKT.js} +4 -4
  158. package/dist/{inventory-metadata-63TI6TPT.js → inventory-metadata-SVEEQKIY.js} +10 -10
  159. package/dist/{inventory-stock-KUNNVL4K.js → inventory-stock-3WSWPSMT.js} +10 -10
  160. package/dist/{loader-MD6G3UZA.js → loader-5VHWG2HX.js} +1 -1
  161. package/dist/{location-detail-MHJK22BY.js → location-detail-TIHXQBZW.js} +12 -12
  162. package/dist/{location-fulfillment-providers-5LMLVCH3.js → location-fulfillment-providers-XULTKWDA.js} +16 -16
  163. package/dist/{location-list-DRCT7MJW.js → location-list-4RNLWRLN.js} +12 -11
  164. package/dist/{location-sales-channels-5ONDOTKC.js → location-sales-channels-MMRCF6QT.js} +3 -3
  165. package/dist/{location-service-zone-create-SSMZUELJ.js → location-service-zone-create-AC2PAK2X.js} +3 -3
  166. package/dist/{location-service-zone-manage-areas-QP3WONCG.js → location-service-zone-manage-areas-WXBQAEGB.js} +3 -3
  167. package/dist/{location-service-zone-shipping-option-create-QBGIX2IS.js → location-service-zone-shipping-option-create-CJI2IDS2.js} +10 -10
  168. package/dist/{login-BJNN5BDP.js → login-7R2QVOMB.js} +10 -10
  169. package/dist/{manage-locations-X76IQE2V.js → manage-locations-E2ODEJC5.js} +1 -1
  170. package/dist/{marketplace-add-currencies-DNI3AV3A.js → marketplace-add-currencies-GSR5IFFC.js} +2 -2
  171. package/dist/{marketplace-detail-73DJFMI7.js → marketplace-detail-CYNEUPOG.js} +13 -13
  172. package/dist/{marketplace-metadata-PSMQ7E3O.js → marketplace-metadata-75DPIUID.js} +10 -10
  173. package/dist/{offer-detail-page-XJFDKX4Z.js → offer-detail-page-GHSCR452.js} +16 -23
  174. package/dist/{offer-variant-detail-page-6QPGQSLY.js → offer-variant-detail-page-JLUJ7FQ4.js} +3 -3
  175. package/dist/{offers-7IRUIP7L.js → offers-NKMURHLM.js} +15 -15
  176. package/dist/{order-create-claim-UJKXA37S.js → order-create-claim-LF23TJ2Z.js} +2 -2
  177. package/dist/{order-create-edit-5U2QNJ5S.js → order-create-edit-ZF6YEUAW.js} +5 -5
  178. package/dist/{order-create-exchange-R5TOVSJZ.js → order-create-exchange-NM2JT5OF.js} +12 -12
  179. package/dist/{order-create-refund-MEAXQVIZ.js → order-create-refund-FWRG3VIW.js} +10 -10
  180. package/dist/{order-create-return-MEUIY4VU.js → order-create-return-YV5HXMY7.js} +2 -2
  181. package/dist/{order-detail-QE4HBQ5W.js → order-detail-S3ENSWQ3.js} +14 -14
  182. package/dist/{order-edit-billing-address-7S2QIRSZ.js → order-edit-billing-address-UYZNY77G.js} +11 -11
  183. package/dist/{order-edit-email-EE26NWGK.js → order-edit-email-GVGQLXNK.js} +10 -10
  184. package/dist/{order-edit-shipping-address-7G5JUVKW.js → order-edit-shipping-address-RS3PRPVM.js} +10 -10
  185. package/dist/{order-list-QILNDFBC.js → order-list-JBCU6ZZD.js} +9 -9
  186. package/dist/{order-metadata-UBUSPFTW.js → order-metadata-2TOR4BJY.js} +10 -10
  187. package/dist/{order-request-transfer-EO76XRGE.js → order-request-transfer-6JJ2FQPA.js} +10 -10
  188. package/dist/pages/index.d.ts +320 -41
  189. package/dist/pages/index.js +98 -96
  190. package/dist/{payout-list-R6ESKT7V.js → payout-list-N6L7HNA5.js} +3 -3
  191. package/dist/{price-list-configuration-D6IS7UY5.js → price-list-configuration-BGV74K6U.js} +6 -6
  192. package/dist/{price-list-create-4TDXQ7UF.js → price-list-create-T4P2TWFS.js} +18 -18
  193. package/dist/{price-list-detail-TUKXO5WG.js → price-list-detail-JBXWXU7K.js} +18 -18
  194. package/dist/{price-list-edit-YCR47ZXS.js → price-list-edit-FQVZW4FT.js} +2 -2
  195. package/dist/{price-list-list-TSK3TWUX.js → price-list-list-KINPGGQQ.js} +6 -6
  196. package/dist/{price-list-prices-add-VEQQYNEA.js → price-list-prices-add-2R4A2UVP.js} +17 -17
  197. package/dist/{price-list-prices-edit-ANLZGAY4.js → price-list-prices-edit-PZN63VWV.js} +10 -10
  198. package/dist/{product-add-existing-attributes-3S3E3TDO.js → product-add-existing-attributes-LQ3S5RBE.js} +16 -16
  199. package/dist/{product-attributes-SY656CC5.js → product-attributes-JUEMRL5V.js} +1 -1
  200. package/dist/{product-bulk-edit-XU2MFL4U.js → product-bulk-edit-7GWRXFUC.js} +1 -1
  201. package/dist/{product-create-KILMAWD7.js → product-create-RUMS2AIE.js} +17 -17
  202. package/dist/{product-create-attribute-XM47T3D6.js → product-create-attribute-7P4LZP5R.js} +2 -2
  203. package/dist/{product-create-variant-3XVP5IWI.js → product-create-variant-74KLCMEU.js} +4 -4
  204. package/dist/{product-detail-B4HVVOY3.js → product-detail-XHT5SGCW.js} +15 -15
  205. package/dist/{product-edit-ZX33LEQM.js → product-edit-GAYL53YC.js} +1 -1
  206. package/dist/product-edit-attribute-EBES4PJ3.js +90 -0
  207. package/dist/{product-list-DNZVZ3NC.js → product-list-JQRCIWTE.js} +17 -17
  208. package/dist/{product-media-QY4RFTYZ.js → product-media-4LDPBVQ5.js} +4 -4
  209. package/dist/{product-metadata-TGAAEG4O.js → product-metadata-YZKS2MQV.js} +10 -10
  210. package/dist/{product-organization-JPPQYC5E.js → product-organization-6TQ4HKB2.js} +4 -4
  211. package/dist/{product-sales-channels-CVAXZ7C7.js → product-sales-channels-K7VOMWUP.js} +3 -3
  212. package/dist/{product-shipping-profile-7F5GW6PQ.js → product-shipping-profile-SYGR4IF7.js} +1 -1
  213. package/dist/{product-tag-create-MZV3LCQT.js → product-tag-create-J6SUTGLF.js} +10 -10
  214. package/dist/{product-tag-detail-SANSVX5Z.js → product-tag-detail-MCHNANH4.js} +20 -20
  215. package/dist/{product-tag-edit-3BSAEN4H.js → product-tag-edit-XTCRJPYD.js} +10 -10
  216. package/dist/{product-tag-list-NFOAK7II.js → product-tag-list-4SEHT2NG.js} +20 -20
  217. package/dist/{product-tag-metadata-VNH5GXMK.js → product-tag-metadata-UMQPCGKY.js} +10 -10
  218. package/dist/{product-type-detail-ZIGX5HUJ.js → product-type-detail-SHU5N2RG.js} +17 -17
  219. package/dist/{product-type-list-D7GAIR2E.js → product-type-list-AVAO26QW.js} +3 -3
  220. package/dist/{product-type-metadata-6KXQSYK5.js → product-type-metadata-RIRSRMDO.js} +10 -10
  221. package/dist/{product-variant-detail-LIXWU3V2.js → product-variant-detail-XWREJ4EK.js} +11 -11
  222. package/dist/{product-variant-edit-GK5A2XMB.js → product-variant-edit-PCD66JBM.js} +12 -12
  223. package/dist/{product-variant-metadata-4BULTZ3M.js → product-variant-metadata-UJOLOTCQ.js} +10 -10
  224. package/dist/{promotion-add-campaign-AU43PI2F.js → promotion-add-campaign-KS5SSTMP.js} +8 -3
  225. package/dist/{promotion-create-5BJ4EVAI.js → promotion-create-XYXVAF67.js} +14 -14
  226. package/dist/{promotion-detail-S5R5UXJ6.js → promotion-detail-EFW4P6N6.js} +21 -37
  227. package/dist/{promotion-edit-details-GURXKLSK.js → promotion-edit-details-SH27X7GF.js} +293 -143
  228. package/dist/{promotion-list-22NDDYPQ.js → promotion-list-MVXEOO5I.js} +10 -9
  229. package/dist/{refund-reason-create-SUJIXZMY.js → refund-reason-create-XEBLTB3C.js} +10 -10
  230. package/dist/{refund-reason-edit-B3Q2DGXR.js → refund-reason-edit-J3KQ2FVF.js} +10 -10
  231. package/dist/{refund-reason-list-JLKMODL4.js → refund-reason-list-I2EACZ64.js} +15 -15
  232. package/dist/{region-add-countries-LF3AV6GE.js → region-add-countries-GKKZVGKH.js} +2 -2
  233. package/dist/{region-create-CVQVVWVA.js → region-create-2XEJLBWS.js} +2 -2
  234. package/dist/{region-detail-JGSC4A2U.js → region-detail-LILWL7FN.js} +3 -3
  235. package/dist/{region-list-ZZJNZWOP.js → region-list-E6OMK3OU.js} +3 -3
  236. package/dist/{region-metadata-EFQS2FU6.js → region-metadata-GDKM4ND5.js} +10 -10
  237. package/dist/{reservation-create-WC7RIX5E.js → reservation-create-77EYD2ZZ.js} +2 -2
  238. package/dist/{reservation-detail-XYRHURYY.js → reservation-detail-M7ZAEO3G.js} +11 -11
  239. package/dist/{reservation-list-IKDEV3JB.js → reservation-list-EJMYXNZV.js} +5 -5
  240. package/dist/{reservation-metadata-44QNS5IN.js → reservation-metadata-E6WP6SHE.js} +10 -10
  241. package/dist/{reset-password-CCHTZ4YX.js → reset-password-P45OKOT4.js} +1 -1
  242. package/dist/{return-reason-list-6WUNAHM6.js → return-reason-list-QWQUXSXO.js} +7 -7
  243. package/dist/{sales-channel-add-products-PYO5W5KK.js → sales-channel-add-products-Q6YXGNQB.js} +16 -16
  244. package/dist/{sales-channel-create-WSROI4MD.js → sales-channel-create-BYCHXO7N.js} +2 -2
  245. package/dist/{sales-channel-detail-DBVRTBF7.js → sales-channel-detail-EQMYYPW6.js} +17 -17
  246. package/dist/{sales-channel-edit-SNXG34Z3.js → sales-channel-edit-KHHDBZQG.js} +2 -2
  247. package/dist/{sales-channel-list-VWXBOQYJ.js → sales-channel-list-J4624AXE.js} +12 -12
  248. package/dist/{sales-channel-metadata-2LJBDKYI.js → sales-channel-metadata-QAXDOSPG.js} +10 -10
  249. package/dist/{shipping-option-type-create-ZRWS4PGU.js → shipping-option-type-create-AULMQGRN.js} +10 -10
  250. package/dist/{shipping-option-type-detail-KUGZH5YF.js → shipping-option-type-detail-EQDAW4GJ.js} +10 -10
  251. package/dist/{shipping-option-type-edit-24XNCOIH.js → shipping-option-type-edit-NVXGY32I.js} +10 -10
  252. package/dist/{shipping-option-type-list-4XTVL3AD.js → shipping-option-type-list-PW44GDWO.js} +13 -13
  253. package/dist/{shipping-profile-metadata-O3AG4LS4.js → shipping-profile-metadata-OW5IGIW3.js} +10 -10
  254. package/dist/{shipping-profiles-list-4SBV3D52.js → shipping-profiles-list-HP3GZTW6.js} +3 -3
  255. package/dist/{store-bulk-edit-J5G2TKVA.js → store-bulk-edit-KOBCPVNM.js} +1 -1
  256. package/dist/{store-create-VKLIAHQL.js → store-create-YPCF45XH.js} +10 -10
  257. package/dist/{store-details-DWV3WMKC.js → store-details-KDCMXPK2.js} +18 -18
  258. package/dist/{store-edit-WIAZLSHU.js → store-edit-BGQJW7GH.js} +3 -3
  259. package/dist/{store-list-HZCRXW5L.js → store-list-SBY73JTY.js} +18 -18
  260. package/dist/{store-member-invite-6ZIH6B7U.js → store-member-invite-2WGAJVIX.js} +1 -1
  261. package/dist/{tax-region-create-2NPI4MUT.js → tax-region-create-7UUVKDZM.js} +11 -11
  262. package/dist/{tax-region-detail-W4RAVJVN.js → tax-region-detail-B2AIDTXD.js} +14 -14
  263. package/dist/{tax-region-edit-RZRSLGFZ.js → tax-region-edit-UQAMWLO5.js} +10 -10
  264. package/dist/{tax-region-list-Y2XSQSCD.js → tax-region-list-MVDXWVIK.js} +3 -3
  265. package/dist/{tax-region-metadata-OQX67IIE.js → tax-region-metadata-UONPCPC6.js} +10 -10
  266. package/dist/{tax-region-province-detail-BS7INZML.js → tax-region-province-detail-XFUAN2R7.js} +13 -13
  267. package/dist/{tax-region-tax-override-create-NRO7QCVL.js → tax-region-tax-override-create-7TQVZLLY.js} +20 -20
  268. package/dist/{tax-region-tax-override-edit-POJATJRW.js → tax-region-tax-override-edit-ZJ6TFQRV.js} +20 -20
  269. package/dist/{user-detail-RNP7ADME.js → user-detail-IYB2LYGS.js} +1 -1
  270. package/dist/{user-invite-TUDDN7KP.js → user-invite-ZGB23H4G.js} +2 -2
  271. package/dist/{user-list-JT3HWEGY.js → user-list-FZ7CGJ5N.js} +3 -3
  272. package/dist/{user-metadata-PNIWSBYP.js → user-metadata-OXHKB6LT.js} +10 -10
  273. package/package.json +15 -15
  274. package/dist/chunk-S2WEYEQR.js +0 -14
  275. package/dist/product-edit-attribute-QC22TRX4.js +0 -336
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  DeprecatedPercentageInput
3
3
  } from "./chunk-MAEP2UCK.js";
4
+ import {
5
+ PROMOTION_DETAIL_BASE_FIELDS
6
+ } from "./chunk-2IDWFEKH.js";
4
7
  import {
5
8
  SwitchBox
6
9
  } from "./chunk-2EME4AWX.js";
@@ -21,8 +24,9 @@ import {
21
24
  } from "./chunk-3QSRE5LS.js";
22
25
  import {
23
26
  usePromotion,
24
- useUpdatePromotion
25
- } from "./chunk-42BAC3EV.js";
27
+ useUpdatePromotion,
28
+ useUpsertPromotionCost
29
+ } from "./chunk-RLOKMTTN.js";
26
30
  import {
27
31
  useDocumentDirection
28
32
  } from "./chunk-Y7QKP6QU.js";
@@ -38,7 +42,16 @@ import { useTranslation as useTranslation2 } from "react-i18next";
38
42
  import { useParams } from "react-router-dom";
39
43
 
40
44
  // src/pages/promotions/promotion-edit-details/components/edit-promotion-form/edit-promotion-details-form.tsx
41
- import { Button, CurrencyInput, Input, RadioGroup, Text } from "@medusajs/ui";
45
+ import {
46
+ Button,
47
+ CurrencyInput,
48
+ Divider,
49
+ InlineTip,
50
+ Input,
51
+ RadioGroup,
52
+ Text,
53
+ toast
54
+ } from "@medusajs/ui";
42
55
  import { useWatch } from "react-hook-form";
43
56
  import { Trans, useTranslation } from "react-i18next";
44
57
  import { useEffect } from "react";
@@ -57,19 +70,11 @@ var EditPromotionSchema = zod.object({
57
70
  value: zod.number().min(0).or(zod.string().min(1)),
58
71
  allocation: zod.enum(["each", "across", "once"]),
59
72
  max_quantity: zod.number().optional().nullable(),
60
- target_type: zod.enum(["order", "shipping_methods", "items"])
61
- }).refine(
62
- (data) => {
63
- if (data.allocation === "across") {
64
- return true;
65
- }
66
- return typeof data.max_quantity === "number";
67
- },
68
- {
69
- path: ["max_quantity"],
70
- message: `required field`
71
- }
72
- );
73
+ target_type: zod.enum(["order", "shipping_methods", "items"]),
74
+ cost_bearer: zod.enum(["store", "marketplace", "shared"]),
75
+ shared_marketplace_percentage: zod.number().min(0).max(100).nullable(),
76
+ limit: zod.number().int().min(1).nullable().optional()
77
+ });
73
78
  var EditPromotionDetailsForm = ({
74
79
  promotion
75
80
  }) => {
@@ -77,6 +82,10 @@ var EditPromotionDetailsForm = ({
77
82
  const { handleSuccess } = useRouteModal();
78
83
  const allocationRaw = promotion.application_method?.allocation;
79
84
  const allocationDefault = allocationRaw === "once" ? "once" : allocationRaw === "across" ? "across" : "each";
85
+ const promotionWithLinks = promotion;
86
+ const isMercurOwned = !promotionWithLinks.seller;
87
+ const costDefault = promotionWithLinks.promotion_cost?.cost_bearer ?? "store";
88
+ const sharedPercentageDefault = promotionWithLinks.promotion_cost?.shared_marketplace_percentage ?? null;
80
89
  const form = useExtendableForm({
81
90
  schema: EditPromotionSchema,
82
91
  model: "promotion",
@@ -91,7 +100,10 @@ var EditPromotionDetailsForm = ({
91
100
  allocation: allocationDefault,
92
101
  max_quantity: promotion.application_method?.max_quantity ?? null,
93
102
  value_type: promotion.application_method.type,
94
- target_type: promotion.application_method.target_type
103
+ target_type: promotion.application_method.target_type,
104
+ cost_bearer: costDefault,
105
+ shared_marketplace_percentage: sharedPercentageDefault,
106
+ limit: promotion.limit ?? null
95
107
  }
96
108
  });
97
109
  const watchValueType = useWatch({
@@ -102,20 +114,40 @@ var EditPromotionDetailsForm = ({
102
114
  control: form.control,
103
115
  name: "allocation"
104
116
  });
117
+ const watchCostBearer = useWatch({
118
+ control: form.control,
119
+ name: "cost_bearer"
120
+ });
105
121
  const isFixedValueType = watchValueType === "fixed";
122
+ const isSharedCost = watchCostBearer === "shared";
123
+ const isOrderTargetType = promotion.application_method?.target_type === "order";
106
124
  const { mutateAsync, isPending } = useUpdatePromotion(promotion.id);
125
+ const { mutateAsync: upsertPromotionCost } = useUpsertPromotionCost();
107
126
  const handleSubmit = form.handleSubmit(async (data) => {
108
127
  const value = typeof data.value === "number" ? data.value : parseFloat(data.value);
109
128
  if (isNaN(value) || value < 0) {
110
129
  form.setError("value", { message: t("promotions.form.value.invalid") });
111
130
  return;
112
131
  }
132
+ if (!isOrderTargetType && data.allocation !== "across" && typeof data.max_quantity !== "number") {
133
+ form.setError("max_quantity", {
134
+ message: t("validation.requiredField")
135
+ });
136
+ return;
137
+ }
138
+ if (isMercurOwned && data.cost_bearer === "shared" && typeof data.shared_marketplace_percentage !== "number") {
139
+ form.setError("shared_marketplace_percentage", {
140
+ message: t("validation.requiredField")
141
+ });
142
+ return;
143
+ }
113
144
  await mutateAsync(
114
145
  {
115
146
  is_automatic: data.is_automatic === "true",
116
147
  code: data.code,
117
148
  status: data.status,
118
149
  is_tax_inclusive: data.is_tax_inclusive,
150
+ limit: data.limit ?? null,
119
151
  application_method: {
120
152
  value,
121
153
  type: data.value_type,
@@ -124,21 +156,27 @@ var EditPromotionDetailsForm = ({
124
156
  }
125
157
  },
126
158
  {
127
- onSuccess: () => {
159
+ onSuccess: async () => {
160
+ if (isMercurOwned) {
161
+ try {
162
+ await upsertPromotionCost({
163
+ id: promotion.id,
164
+ cost_bearer: data.cost_bearer,
165
+ shared_marketplace_percentage: data.cost_bearer === "shared" ? data.shared_marketplace_percentage : null
166
+ });
167
+ } catch (e) {
168
+ toast.error(e.message);
169
+ }
170
+ }
171
+ toast.success(t("promotions.toasts.promotionUpdateSuccess"));
128
172
  handleSuccess();
173
+ },
174
+ onError: (e) => {
175
+ toast.error(e.message);
129
176
  }
130
177
  }
131
178
  );
132
179
  });
133
- const allocationWatchValue = useWatch({
134
- control: form.control,
135
- name: "value_type"
136
- });
137
- useEffect(() => {
138
- if (!(allocationWatchValue === "fixed" && promotion.type === "standard")) {
139
- form.setValue("is_tax_inclusive", false);
140
- }
141
- }, [allocationWatchValue, form, promotion]);
142
180
  useEffect(() => {
143
181
  if (watchAllocation === "once" && !form.getValues("max_quantity")) {
144
182
  form.setValue("max_quantity", 1);
@@ -156,11 +194,11 @@ var EditPromotionDetailsForm = ({
156
194
  Form.Field,
157
195
  {
158
196
  control: form.control,
159
- name: "status",
197
+ name: "is_automatic",
160
198
  render: ({ field }) => {
161
- return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-edit-details-form-status-item", children: [
162
- /* @__PURE__ */ jsx(Form.Label, { "data-testid": "promotion-edit-details-form-status-label", children: t("promotions.form.status.label") }),
163
- /* @__PURE__ */ jsx(Form.Control, { "data-testid": "promotion-edit-details-form-status-control", children: /* @__PURE__ */ jsxs(
199
+ return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-edit-details-form-method-item", children: [
200
+ /* @__PURE__ */ jsx(Form.Label, { "data-testid": "promotion-edit-details-form-method-label", children: t("promotions.form.method.label") }),
201
+ /* @__PURE__ */ jsx(Form.Control, { "data-testid": "promotion-edit-details-form-method-control", children: /* @__PURE__ */ jsxs(
164
202
  RadioGroup,
165
203
  {
166
204
  dir: direction,
@@ -168,45 +206,34 @@ var EditPromotionDetailsForm = ({
168
206
  ...field,
169
207
  value: field.value,
170
208
  onValueChange: field.onChange,
171
- "data-testid": "promotion-edit-details-form-status-radio-group",
209
+ "data-testid": "promotion-edit-details-form-method-radio-group",
172
210
  children: [
173
211
  /* @__PURE__ */ jsx(
174
212
  RadioGroup.ChoiceBox,
175
213
  {
176
- value: "draft",
177
- label: t("promotions.form.status.draft.title"),
178
- description: t(
179
- "promotions.form.status.draft.description"
180
- ),
181
- "data-testid": "promotion-edit-details-form-status-option-draft"
182
- }
183
- ),
184
- /* @__PURE__ */ jsx(
185
- RadioGroup.ChoiceBox,
186
- {
187
- value: "active",
188
- label: t("promotions.form.status.active.title"),
214
+ value: "false",
215
+ label: t("promotions.form.method.code.title"),
189
216
  description: t(
190
- "promotions.form.status.active.description"
217
+ "promotions.form.method.code.description"
191
218
  ),
192
- "data-testid": "promotion-edit-details-form-status-option-active"
219
+ "data-testid": "promotion-edit-details-form-method-option-code"
193
220
  }
194
221
  ),
195
222
  /* @__PURE__ */ jsx(
196
223
  RadioGroup.ChoiceBox,
197
224
  {
198
- value: "inactive",
199
- label: t("promotions.form.status.inactive.title"),
225
+ value: "true",
226
+ label: t("promotions.form.method.automatic.title"),
200
227
  description: t(
201
- "promotions.form.status.inactive.description"
228
+ "promotions.form.method.automatic.description"
202
229
  ),
203
- "data-testid": "promotion-edit-details-form-status-option-inactive"
230
+ "data-testid": "promotion-edit-details-form-method-option-automatic"
204
231
  }
205
232
  )
206
233
  ]
207
234
  }
208
235
  ) }),
209
- /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "promotion-edit-details-form-status-error" })
236
+ /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "promotion-edit-details-form-method-error" })
210
237
  ] });
211
238
  }
212
239
  }
@@ -215,11 +242,11 @@ var EditPromotionDetailsForm = ({
215
242
  Form.Field,
216
243
  {
217
244
  control: form.control,
218
- name: "is_automatic",
245
+ name: "status",
219
246
  render: ({ field }) => {
220
- return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-edit-details-form-method-item", children: [
221
- /* @__PURE__ */ jsx(Form.Label, { "data-testid": "promotion-edit-details-form-method-label", children: t("promotions.form.method.label") }),
222
- /* @__PURE__ */ jsx(Form.Control, { "data-testid": "promotion-edit-details-form-method-control", children: /* @__PURE__ */ jsxs(
247
+ return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-edit-details-form-status-item", children: [
248
+ /* @__PURE__ */ jsx(Form.Label, { "data-testid": "promotion-edit-details-form-status-label", children: t("promotions.form.status.label") }),
249
+ /* @__PURE__ */ jsx(Form.Control, { "data-testid": "promotion-edit-details-form-status-control", children: /* @__PURE__ */ jsxs(
223
250
  RadioGroup,
224
251
  {
225
252
  dir: direction,
@@ -227,47 +254,49 @@ var EditPromotionDetailsForm = ({
227
254
  ...field,
228
255
  value: field.value,
229
256
  onValueChange: field.onChange,
230
- "data-testid": "promotion-edit-details-form-method-radio-group",
257
+ "data-testid": "promotion-edit-details-form-status-radio-group",
231
258
  children: [
232
259
  /* @__PURE__ */ jsx(
233
260
  RadioGroup.ChoiceBox,
234
261
  {
235
- value: "false",
236
- label: t("promotions.form.method.code.title"),
262
+ value: "draft",
263
+ label: t("promotions.form.status.draft.title"),
237
264
  description: t(
238
- "promotions.form.method.code.description"
265
+ "promotions.form.status.draft.description"
239
266
  ),
240
- "data-testid": "promotion-edit-details-form-method-option-code"
267
+ "data-testid": "promotion-edit-details-form-status-option-draft"
241
268
  }
242
269
  ),
243
270
  /* @__PURE__ */ jsx(
244
271
  RadioGroup.ChoiceBox,
245
272
  {
246
- value: "true",
247
- label: t("promotions.form.method.automatic.title"),
273
+ value: "active",
274
+ label: t("promotions.form.status.active.title"),
248
275
  description: t(
249
- "promotions.form.method.automatic.description"
276
+ "promotions.form.status.active.description"
250
277
  ),
251
- "data-testid": "promotion-edit-details-form-method-option-automatic"
278
+ "data-testid": "promotion-edit-details-form-status-option-active"
279
+ }
280
+ ),
281
+ /* @__PURE__ */ jsx(
282
+ RadioGroup.ChoiceBox,
283
+ {
284
+ value: "inactive",
285
+ label: t("promotions.form.status.inactive.title"),
286
+ description: t(
287
+ "promotions.form.status.inactive.description"
288
+ ),
289
+ "data-testid": "promotion-edit-details-form-status-option-inactive"
252
290
  }
253
291
  )
254
292
  ]
255
293
  }
256
294
  ) }),
257
- /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "promotion-edit-details-form-method-error" })
295
+ /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "promotion-edit-details-form-status-error" })
258
296
  ] });
259
297
  }
260
298
  }
261
299
  ),
262
- allocationWatchValue === "fixed" && promotion.type === "standard" && /* @__PURE__ */ jsx(
263
- SwitchBox,
264
- {
265
- control: form.control,
266
- name: "is_tax_inclusive",
267
- label: t("promotions.form.taxInclusive.title"),
268
- description: t("promotions.form.taxInclusive.description")
269
- }
270
- ),
271
300
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
272
301
  /* @__PURE__ */ jsx(
273
302
  Form.Field,
@@ -300,54 +329,164 @@ var EditPromotionDetailsForm = ({
300
329
  }
301
330
  )
302
331
  ] }),
332
+ /* @__PURE__ */ jsx(
333
+ SwitchBox,
334
+ {
335
+ control: form.control,
336
+ name: "is_tax_inclusive",
337
+ label: t("promotions.form.taxInclusive.title"),
338
+ description: t("promotions.form.taxInclusive.description")
339
+ }
340
+ ),
341
+ /* @__PURE__ */ jsx(Divider, {}),
342
+ isMercurOwned && /* @__PURE__ */ jsxs(Fragment, { children: [
343
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
344
+ /* @__PURE__ */ jsx(
345
+ Form.Field,
346
+ {
347
+ control: form.control,
348
+ name: "cost_bearer",
349
+ render: ({ field }) => {
350
+ return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-edit-details-form-cost-bearer-item", children: [
351
+ /* @__PURE__ */ jsx(Form.Label, { "data-testid": "promotion-edit-details-form-cost-bearer-label", children: t("promotions.fields.coverage") }),
352
+ /* @__PURE__ */ jsx(Form.Control, { "data-testid": "promotion-edit-details-form-cost-bearer-control", children: /* @__PURE__ */ jsxs(
353
+ RadioGroup,
354
+ {
355
+ dir: direction,
356
+ className: "flex-col gap-y-3",
357
+ ...field,
358
+ value: field.value,
359
+ onValueChange: field.onChange,
360
+ "data-testid": "promotion-edit-details-form-cost-bearer-radio-group",
361
+ children: [
362
+ /* @__PURE__ */ jsx(
363
+ RadioGroup.ChoiceBox,
364
+ {
365
+ value: "store",
366
+ label: t("promotions.form.costBearer.store.title"),
367
+ description: t(
368
+ "promotions.form.costBearer.store.description"
369
+ ),
370
+ "data-testid": "promotion-edit-details-form-cost-bearer-option-store"
371
+ }
372
+ ),
373
+ /* @__PURE__ */ jsx(
374
+ RadioGroup.ChoiceBox,
375
+ {
376
+ value: "marketplace",
377
+ label: t(
378
+ "promotions.form.costBearer.marketplace.title"
379
+ ),
380
+ description: t(
381
+ "promotions.form.costBearer.marketplace.description"
382
+ ),
383
+ "data-testid": "promotion-edit-details-form-cost-bearer-option-marketplace"
384
+ }
385
+ ),
386
+ /* @__PURE__ */ jsx(
387
+ RadioGroup.ChoiceBox,
388
+ {
389
+ value: "shared",
390
+ label: t(
391
+ "promotions.form.costBearer.shared.title"
392
+ ),
393
+ description: t(
394
+ "promotions.form.costBearer.shared.description"
395
+ ),
396
+ "data-testid": "promotion-edit-details-form-cost-bearer-option-shared"
397
+ }
398
+ )
399
+ ]
400
+ }
401
+ ) }),
402
+ /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "promotion-edit-details-form-cost-bearer-error" })
403
+ ] });
404
+ }
405
+ }
406
+ ),
407
+ isSharedCost && /* @__PURE__ */ jsx(
408
+ Form.Field,
409
+ {
410
+ control: form.control,
411
+ name: "shared_marketplace_percentage",
412
+ render: ({ field: { onChange, value, ...field } }) => {
413
+ return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-edit-details-form-shared-percentage-item", children: [
414
+ /* @__PURE__ */ jsx(Form.Label, { "data-testid": "promotion-edit-details-form-shared-percentage-label", children: t("promotions.form.costBearer.sharedPercentage.title") }),
415
+ /* @__PURE__ */ jsx(Form.Control, { "data-testid": "promotion-edit-details-form-shared-percentage-control", children: /* @__PURE__ */ jsx(
416
+ DeprecatedPercentageInput,
417
+ {
418
+ className: "text-right",
419
+ min: 0,
420
+ max: 100,
421
+ ...field,
422
+ value: value ?? "",
423
+ onChange: (e) => {
424
+ onChange(
425
+ e.target.value === "" ? null : parseFloat(e.target.value)
426
+ );
427
+ },
428
+ "data-testid": "promotion-edit-details-form-shared-percentage-input"
429
+ },
430
+ "shared-percentage"
431
+ ) }),
432
+ /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "promotion-edit-details-form-shared-percentage-error" })
433
+ ] });
434
+ }
435
+ }
436
+ ),
437
+ /* @__PURE__ */ jsx(
438
+ InlineTip,
439
+ {
440
+ label: t("general.tip"),
441
+ "data-testid": "promotion-edit-details-form-cost-bearer-tip",
442
+ children: t("promotions.form.costBearer.tip")
443
+ }
444
+ )
445
+ ] }),
446
+ /* @__PURE__ */ jsx(Divider, {})
447
+ ] }),
303
448
  promotion.application_method?.target_type !== "shipping_methods" && /* @__PURE__ */ jsxs(Fragment, { children: [
304
- /* @__PURE__ */ jsx(
449
+ promotion.application_method?.target_type !== "order" && /* @__PURE__ */ jsx(
305
450
  Form.Field,
306
451
  {
307
452
  control: form.control,
308
- name: "value_type",
453
+ name: "allocation",
309
454
  render: ({ field }) => {
310
- return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-edit-details-form-value-type-item", children: [
311
- /* @__PURE__ */ jsx(Form.Label, { "data-testid": "promotion-edit-details-form-value-type-label", children: t("promotions.fields.value_type") }),
312
- /* @__PURE__ */ jsx(Form.Control, { "data-testid": "promotion-edit-details-form-value-type-control", children: /* @__PURE__ */ jsxs(
455
+ return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-edit-details-form-allocation-item", children: [
456
+ /* @__PURE__ */ jsx(Form.Label, { "data-testid": "promotion-edit-details-form-allocation-label", children: t("promotions.fields.allocation") }),
457
+ /* @__PURE__ */ jsx(Form.Control, { "data-testid": "promotion-edit-details-form-allocation-control", children: /* @__PURE__ */ jsxs(
313
458
  RadioGroup,
314
459
  {
315
460
  dir: direction,
316
461
  className: "flex-col gap-y-3",
317
462
  ...field,
318
463
  onValueChange: field.onChange,
319
- "data-testid": "promotion-edit-details-form-value-type-radio-group",
464
+ "data-testid": "promotion-edit-details-form-allocation-radio-group",
320
465
  children: [
321
466
  /* @__PURE__ */ jsx(
322
467
  RadioGroup.ChoiceBox,
323
468
  {
324
- value: "fixed",
325
- label: t(
326
- "promotions.form.value_type.fixed.title"
327
- ),
469
+ value: "each",
470
+ label: t("promotions.form.allocation.each.title"),
328
471
  description: t(
329
- "promotions.form.value_type.fixed.description"
472
+ "promotions.form.allocation.each.description"
330
473
  ),
331
- "data-testid": "promotion-edit-details-form-value-type-option-fixed"
474
+ "data-testid": "promotion-edit-details-form-allocation-option-each"
332
475
  }
333
476
  ),
334
477
  /* @__PURE__ */ jsx(
335
478
  RadioGroup.ChoiceBox,
336
479
  {
337
- value: "percentage",
338
- label: t(
339
- "promotions.form.value_type.percentage.title"
340
- ),
341
- description: t(
342
- "promotions.form.value_type.percentage.description"
343
- ),
344
- "data-testid": "promotion-edit-details-form-value-type-option-percentage"
480
+ value: "once",
481
+ label: t("promotions.form.allocation.once.title"),
482
+ description: t("promotions.form.allocation.once.description"),
483
+ "data-testid": "promotion-edit-details-form-allocation-option-once"
345
484
  }
346
485
  )
347
486
  ]
348
487
  }
349
488
  ) }),
350
- /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "promotion-edit-details-form-value-type-error" })
489
+ /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "promotion-edit-details-form-allocation-error" })
351
490
  ] });
352
491
  }
353
492
  }
@@ -361,7 +500,7 @@ var EditPromotionDetailsForm = ({
361
500
  const currencyCode = promotion.application_method?.currency_code ?? "USD";
362
501
  const currencyInfo = currencies[currencyCode?.toUpperCase() || "USD"];
363
502
  return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-edit-details-form-value-item", children: [
364
- /* @__PURE__ */ jsx(Form.Label, { "data-testid": "promotion-edit-details-form-value-label", children: isFixedValueType ? t("fields.amount") : t("fields.percentage") }),
503
+ /* @__PURE__ */ jsx(Form.Label, { "data-testid": "promotion-edit-details-form-value-label", children: isFixedValueType ? t("promotions.fields.promotion_value") : t("fields.percentage") }),
365
504
  /* @__PURE__ */ jsx(Form.Control, { "data-testid": "promotion-edit-details-form-value-control", children: isFixedValueType ? /* @__PURE__ */ jsx(
366
505
  CurrencyInput,
367
506
  {
@@ -393,57 +532,22 @@ var EditPromotionDetailsForm = ({
393
532
  },
394
533
  "amount"
395
534
  ) }),
396
- /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "promotion-edit-details-form-value-error" })
397
- ] });
398
- }
399
- }
400
- ),
401
- /* @__PURE__ */ jsx(
402
- Form.Field,
403
- {
404
- control: form.control,
405
- name: "allocation",
406
- render: ({ field }) => {
407
- return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-edit-details-form-allocation-item", children: [
408
- /* @__PURE__ */ jsx(Form.Label, { "data-testid": "promotion-edit-details-form-allocation-label", children: t("promotions.fields.allocation") }),
409
- /* @__PURE__ */ jsx(Form.Control, { "data-testid": "promotion-edit-details-form-allocation-control", children: /* @__PURE__ */ jsxs(
410
- RadioGroup,
535
+ isFixedValueType && /* @__PURE__ */ jsx(
536
+ Text,
411
537
  {
412
- dir: direction,
413
- className: "flex-col gap-y-3",
414
- ...field,
415
- onValueChange: field.onChange,
416
- "data-testid": "promotion-edit-details-form-allocation-radio-group",
417
- children: [
418
- /* @__PURE__ */ jsx(
419
- RadioGroup.ChoiceBox,
420
- {
421
- value: "each",
422
- label: t("promotions.form.allocation.each.title"),
423
- description: t(
424
- "promotions.form.allocation.each.description"
425
- ),
426
- "data-testid": "promotion-edit-details-form-allocation-option-each"
427
- }
428
- ),
429
- /* @__PURE__ */ jsx(
430
- RadioGroup.ChoiceBox,
431
- {
432
- value: "once",
433
- label: t("promotions.form.allocation.once.title"),
434
- description: t("promotions.form.allocation.once.description"),
435
- "data-testid": "promotion-edit-details-form-allocation-option-once"
436
- }
437
- )
438
- ]
538
+ size: "small",
539
+ leading: "compact",
540
+ className: "text-ui-fg-subtle",
541
+ "data-testid": "promotion-edit-details-form-value-description",
542
+ children: t("promotions.form.value.description")
439
543
  }
440
- ) }),
441
- /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "promotion-edit-details-form-allocation-error" })
544
+ ),
545
+ /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "promotion-edit-details-form-value-error" })
442
546
  ] });
443
547
  }
444
548
  }
445
549
  ),
446
- (watchAllocation === "each" || watchAllocation === "once") && /* @__PURE__ */ jsx(
550
+ !isOrderTargetType && (watchAllocation === "each" || watchAllocation === "once") && /* @__PURE__ */ jsx(
447
551
  Form.Field,
448
552
  {
449
553
  control: form.control,
@@ -486,6 +590,52 @@ var EditPromotionDetailsForm = ({
486
590
  }
487
591
  )
488
592
  ] }),
593
+ /* @__PURE__ */ jsx(Divider, {}),
594
+ /* @__PURE__ */ jsx(
595
+ Form.Field,
596
+ {
597
+ control: form.control,
598
+ name: "limit",
599
+ render: ({ field: { onChange, value, ...field } }) => {
600
+ return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-edit-details-form-limit-item", children: [
601
+ /* @__PURE__ */ jsx(
602
+ Form.Label,
603
+ {
604
+ optional: true,
605
+ "data-testid": "promotion-edit-details-form-limit-label",
606
+ children: t("promotions.form.limit.title")
607
+ }
608
+ ),
609
+ /* @__PURE__ */ jsx(Form.Control, { "data-testid": "promotion-edit-details-form-limit-control", children: /* @__PURE__ */ jsx(
610
+ Input,
611
+ {
612
+ ...field,
613
+ type: "number",
614
+ min: 1,
615
+ value: value ?? "",
616
+ onChange: (e) => {
617
+ const val = e.target.value;
618
+ onChange(val === "" ? null : parseInt(val, 10));
619
+ },
620
+ placeholder: "100",
621
+ "data-testid": "promotion-edit-details-form-limit-input"
622
+ }
623
+ ) }),
624
+ /* @__PURE__ */ jsx(
625
+ Text,
626
+ {
627
+ size: "small",
628
+ leading: "compact",
629
+ className: "text-ui-fg-subtle",
630
+ "data-testid": "promotion-edit-details-form-limit-description",
631
+ children: t("promotions.form.limit.description")
632
+ }
633
+ ),
634
+ /* @__PURE__ */ jsx(Form.ErrorMessage, { "data-testid": "promotion-edit-details-form-limit-error" })
635
+ ] });
636
+ }
637
+ }
638
+ ),
489
639
  /* @__PURE__ */ jsx(
490
640
  FormExtensionZone,
491
641
  {
@@ -510,7 +660,7 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
510
660
  var PromotionEditDetails = () => {
511
661
  const { id } = useParams();
512
662
  const { t } = useTranslation2();
513
- const linkQuery = useLinkQuery("promotion");
663
+ const linkQuery = useLinkQuery("promotion", PROMOTION_DETAIL_BASE_FIELDS);
514
664
  const { promotion, isLoading, isError, error } = usePromotion(id, linkQuery);
515
665
  if (isError) {
516
666
  throw error;