@mercurjs/vendor 2.2.0-canary.2 → 2.2.0-canary.21

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 (266) hide show
  1. package/dist/{[id]-KRLGIVLR.js → [id]-3JICOSAI.js} +133 -41
  2. package/dist/[id]-CR76L5TG.js +3102 -0
  3. package/dist/{[id]-7BAKUHUO.js → [id]-DDGHFRSB.js} +5 -5
  4. package/dist/{[id]-KVWYLDN3.js → [id]-E7DYRMMO.js} +162 -71
  5. package/dist/{[id]-4OBGG7OH.js → [id]-FIP4UMQ4.js} +197 -105
  6. package/dist/{[id]-3EC6HYXL.js → [id]-FZRXOJWL.js} +22 -21
  7. package/dist/{[id]-ZWWMJAKI.js → [id]-PD3ISUL5.js} +7 -7
  8. package/dist/{[id]-UUUQK22M.js → [id]-Q5AXQ5XO.js} +460 -581
  9. package/dist/{[id]-KJIQTFGE.js → [id]-VSNA6SV5.js} +15 -15
  10. package/dist/{[id]-Y2ISCLUD.js → [id]-XUKQKCDN.js} +3 -3
  11. package/dist/{[id]-K2CT7BXQ.js → [id]-YPCO3DJV.js} +1 -1
  12. package/dist/{[id]-LUFRJLAU.js → [id]-ZEFQ7FQQ.js} +36 -33
  13. package/dist/{[id]-COLO4TQJ.js → [id]-ZW7TBWDU.js} +24 -23
  14. package/dist/{[province_id]-H2QAPKVH.js → [province_id]-CHOO7ERP.js} +14 -14
  15. package/dist/{add-FIWTANZX.js → add-GYXNRUAE.js} +40 -37
  16. package/dist/{add-PBZQCIZQ.js → add-IC5R27X3.js} +95 -32
  17. package/dist/{add-customer-groups-RAHCP67U.js → add-customer-groups-KIGBZT5G.js} +20 -23
  18. package/dist/{add-products-N3V2MVLD.js → add-products-ALJVIFXU.js} +23 -22
  19. package/dist/{add-promotions-CSCAJZHV.js → add-promotions-EQ5MMQKG.js} +8 -8
  20. package/dist/{add-to-campaign-DLP7PSQB.js → add-to-campaign-C6JDNB6F.js} +4 -4
  21. package/dist/{address-7F5SN7PV.js → address-UKLDTSTP.js} +13 -13
  22. package/dist/{adjust-inventory-SZF4W7LR.js → adjust-inventory-5XPGE44Y.js} +2 -2
  23. package/dist/allocate-items-URVRAFPS.js +685 -0
  24. package/dist/{areas-7Y6BVS5A.js → areas-64VXOFYS.js} +6 -6
  25. package/dist/{attributes-MBZ76HVZ.js → attributes-YQNW5JBY.js} +2 -2
  26. package/dist/{breadcrumb-HND5FFWC.js → breadcrumb-26G7BS3Q.js} +3 -3
  27. package/dist/{breadcrumb-7PURSRTT.js → breadcrumb-2AYN2SV7.js} +12 -12
  28. package/dist/{breadcrumb-ZCG2RHIU.js → breadcrumb-4KKLMVC3.js} +12 -12
  29. package/dist/{breadcrumb-WRG4SITG.js → breadcrumb-4XSHX5RV.js} +13 -13
  30. package/dist/{breadcrumb-QV2IAX7N.js → breadcrumb-E5OF4L2J.js} +2 -2
  31. package/dist/breadcrumb-JC5FUQYF.js +28 -0
  32. package/dist/{breadcrumb-YBBYFQYG.js → breadcrumb-LBO2I4OJ.js} +1 -1
  33. package/dist/breadcrumb-PIDJ23EZ.js +13 -0
  34. package/dist/{breadcrumb-65SAGUUL.js → breadcrumb-RWYEU5JK.js} +3 -3
  35. package/dist/{breadcrumb-VWELWDB2.js → breadcrumb-VXKAO6GP.js} +1 -1
  36. package/dist/{breadcrumb-FLDHJRVY.js → breadcrumb-WMNG4P6C.js} +9 -8
  37. package/dist/{breadcrumb-EDPMEN2P.js → breadcrumb-XPQETVMM.js} +2 -2
  38. package/dist/{campaigns-L6ULR6KR.js → campaigns-4I2T6EDZ.js} +5 -5
  39. package/dist/{categories-FUZQKBXV.js → categories-3P2DRH5V.js} +10 -8
  40. package/dist/{chunk-EZ3JOAUS.js → chunk-22CIYLKO.js} +1 -1
  41. package/dist/{chunk-RZLN2Q6G.js → chunk-247L47JD.js} +1 -1
  42. package/dist/{chunk-SFQKKIHA.js → chunk-27WLUOI2.js} +1 -1
  43. package/dist/{chunk-M7KSRYRI.js → chunk-2ECD67FO.js} +2 -2
  44. package/dist/{chunk-36L54SQQ.js → chunk-2H4FGZ4U.js} +1 -1
  45. package/dist/{chunk-X2FVFUET.js → chunk-2NUZTTBU.js} +27 -8
  46. package/dist/chunk-2OY4NW7L.js +185 -0
  47. package/dist/{chunk-K4X324QP.js → chunk-36WXPGD2.js} +6 -5
  48. package/dist/{chunk-PXYDR7WQ.js → chunk-3BXCPHN6.js} +3 -2
  49. package/dist/chunk-3EDZQSKG.js +33 -0
  50. package/dist/{chunk-2DXNJURE.js → chunk-3L2DVCOC.js} +1 -1
  51. package/dist/chunk-42R54Z2X.js +8 -0
  52. package/dist/{chunk-CNMY5HVP.js → chunk-4EQIJMQT.js} +3 -3
  53. package/dist/{chunk-UAF2S447.js → chunk-4OIOYUQE.js} +3 -3
  54. package/dist/{chunk-UORPTGV2.js → chunk-4R5GESED.js} +10 -14
  55. package/dist/{chunk-WUPJADSO.js → chunk-4RFPRO2W.js} +2 -2
  56. package/dist/chunk-4YWKKCTT.js +32 -0
  57. package/dist/{chunk-XFQJU6FA.js → chunk-5QG6P6EU.js} +1 -1
  58. package/dist/{chunk-N4MVIBFM.js → chunk-5Y6RDTW2.js} +3 -3
  59. package/dist/{chunk-DZIXC7OE.js → chunk-6FLSBL4Q.js} +30 -85
  60. package/dist/{chunk-DVEKYLPV.js → chunk-6QS6IZC6.js} +1 -1
  61. package/dist/chunk-6ZGQ3SOR.js +127 -0
  62. package/dist/{chunk-NXNJQZCP.js → chunk-7FIPNQM2.js} +1 -1
  63. package/dist/{chunk-NSZQERLE.js → chunk-7GGWRJJF.js} +2 -2
  64. package/dist/{chunk-QS6RWIBL.js → chunk-7RGUD6PI.js} +34 -20
  65. package/dist/{chunk-5L2DCA4W.js → chunk-7ZPJGL4C.js} +57 -6
  66. package/dist/{chunk-KD7RYE6R.js → chunk-AG6KIAUD.js} +2 -2
  67. package/dist/{chunk-UCQKXXLD.js → chunk-AKKIZD2P.js} +32 -34
  68. package/dist/chunk-CHBURL76.js +438 -0
  69. package/dist/{chunk-PBD36EZJ.js → chunk-CI4YXVQF.js} +2 -2
  70. package/dist/{chunk-7LBY5JLV.js → chunk-DAV7WS53.js} +1 -1
  71. package/dist/{chunk-6BS2AVGJ.js → chunk-DNXMONCL.js} +6 -6
  72. package/dist/{chunk-TNVYTMBL.js → chunk-E4O5PARZ.js} +4 -4
  73. package/dist/{chunk-L7QKFC5N.js → chunk-E6W57UP3.js} +32 -122
  74. package/dist/chunk-EEBJYXWA.js +15 -0
  75. package/dist/chunk-FP6U6BPH.js +61 -0
  76. package/dist/{chunk-SGR4DMCW.js → chunk-FRYZRBLA.js} +1 -1
  77. package/dist/chunk-FWPGOIFA.js +22 -0
  78. package/dist/chunk-GL7F6NDU.js +30 -0
  79. package/dist/chunk-H7BVANDX.js +407 -0
  80. package/dist/{chunk-FDR22JMM.js → chunk-HFRHHT36.js} +8 -63
  81. package/dist/{chunk-FJUUGFXL.js → chunk-HOUDNM5M.js} +1 -1
  82. package/dist/{chunk-6Y53VZ3C.js → chunk-HZCSJLGH.js} +11 -11
  83. package/dist/chunk-I75SROQZ.js +315 -0
  84. package/dist/{chunk-JQV7CXEC.js → chunk-II3ACSV2.js} +17 -2
  85. package/dist/{chunk-DARJTN4I.js → chunk-IMJ62GAP.js} +10 -5
  86. package/dist/{chunk-PPLC4IKI.js → chunk-IV57G2CB.js} +14 -1
  87. package/dist/{chunk-7SLWXX6L.js → chunk-J434WDD3.js} +5 -6
  88. package/dist/chunk-J6XCRFBW.js +30 -0
  89. package/dist/{chunk-KAZ5BYTQ.js → chunk-KCHYLLVG.js} +6 -4
  90. package/dist/{chunk-YGRTRAWX.js → chunk-KDE4HKH2.js} +1 -0
  91. package/dist/{chunk-GXIAIITP.js → chunk-KZYRC3WR.js} +36 -39
  92. package/dist/chunk-L57USMYC.js +39 -0
  93. package/dist/chunk-LFX6WU4A.js +36 -0
  94. package/dist/{chunk-EROX26D4.js → chunk-LRMWYKSF.js} +1 -1
  95. package/dist/{chunk-LWJF63JW.js → chunk-LTQQRVZG.js} +89 -14
  96. package/dist/chunk-LYYM7H7H.js +59 -0
  97. package/dist/{chunk-NHFEY3EI.js → chunk-M3YUT5AY.js} +2 -2
  98. package/dist/{chunk-H6LZ77GX.js → chunk-MJCL3WID.js} +1 -1
  99. package/dist/{chunk-X4INVIWL.js → chunk-MZRZVLWD.js} +3 -3
  100. package/dist/{chunk-DDH7ULIQ.js → chunk-N6MGVXXQ.js} +1 -1
  101. package/dist/{chunk-QXLRABYH.js → chunk-O7VOGTLX.js} +1 -1
  102. package/dist/{chunk-35G3SZRN.js → chunk-P3SOE76R.js} +1 -1
  103. package/dist/{chunk-PZ44R4AS.js → chunk-P7Q5ZSZD.js} +1 -1
  104. package/dist/{chunk-5ATEALH7.js → chunk-PFJFS3F4.js} +1 -5
  105. package/dist/chunk-POOTMH3K.js +62 -0
  106. package/dist/{chunk-GGWUWT55.js → chunk-QJI4OET7.js} +23 -36
  107. package/dist/{chunk-NJMNYS7G.js → chunk-QS35HWC5.js} +1 -1
  108. package/dist/{chunk-RTBNJQOV.js → chunk-R4JLYNUA.js} +419 -538
  109. package/dist/{chunk-DIW4GRTI.js → chunk-RT3G3GEK.js} +47 -31
  110. package/dist/{chunk-QT7YFHCA.js → chunk-S23FD6FA.js} +12 -0
  111. package/dist/{chunk-U2ZFCAPX.js → chunk-SITRHMZZ.js} +11 -8
  112. package/dist/chunk-SPFLYPY6.js +6 -0
  113. package/dist/{chunk-EIUYXS7E.js → chunk-SZBERGA4.js} +1 -1
  114. package/dist/chunk-T6DSYOY5.js +173 -0
  115. package/dist/{chunk-4LVP635F.js → chunk-TKSKCYM3.js} +128 -126
  116. package/dist/{chunk-QNNJN4H6.js → chunk-TSTUAL6N.js} +59 -0
  117. package/dist/{chunk-LNM2D2I4.js → chunk-TZMNEN7A.js} +7 -6
  118. package/dist/chunk-UM7ZR3VU.js +14 -0
  119. package/dist/{chunk-X22KTLZ7.js → chunk-UO6IX5Y7.js} +1 -1
  120. package/dist/chunk-VCUUITW6.js +35 -0
  121. package/dist/{chunk-LQD232FW.js → chunk-WJ5EU3KW.js} +1 -1
  122. package/dist/{chunk-AIF2KTEE.js → chunk-WKRW5OPL.js} +12 -2
  123. package/dist/{chunk-6YA3C4NB.js → chunk-XBKWFLJG.js} +4 -13
  124. package/dist/{chunk-WBHFU3MG.js → chunk-XJYQ4SW5.js} +2 -2
  125. package/dist/chunk-XQUF3WIS.js +159 -0
  126. package/dist/chunk-YBF45CX5.js +23 -0
  127. package/dist/{chunk-AVOIZO63.js → chunk-YQZBAP3S.js} +4 -2
  128. package/dist/chunk-ZHFFTT3I.js +17 -0
  129. package/dist/{chunk-TODJFRLH.js → chunk-ZHR77OQI.js} +2 -2
  130. package/dist/chunk-ZUHIKMQL.js +353 -0
  131. package/dist/{chunk-44RQ5PTN.js → chunk-ZZIJSTXN.js} +225 -90
  132. package/dist/{collections-YCAAFGSW.js → collections-7M7O23NO.js} +28 -26
  133. package/dist/{configuration-UOSNP45I.js → configuration-5IDQRYJQ.js} +4 -4
  134. package/dist/{configuration-C4IGBNXH.js → configuration-TXRAYMI4.js} +1 -1
  135. package/dist/{create-BJ4OO6LS.js → create-2N73Y6FO.js} +14 -14
  136. package/dist/{create-R7K3ECN6.js → create-3MUVY3UY.js} +1 -1
  137. package/dist/{create-SFU3W3ZH.js → create-6DRXGPYA.js} +1 -1
  138. package/dist/{create-XAD5NMSJ.js → create-6KM5AZCG.js} +20 -20
  139. package/dist/{create-YDDBH4VQ.js → create-A6CPQMMH.js} +27 -26
  140. package/dist/create-B4EWCX7X.js +1798 -0
  141. package/dist/{create-YBF4YGWG.js → create-BHSMHOFN.js} +1 -1
  142. package/dist/{create-XVHOCZHJ.js → create-BVUZWMET.js} +1 -1
  143. package/dist/create-CJEZCYN6.js +1179 -0
  144. package/dist/create-DAVMJNC2.js +1931 -0
  145. package/dist/{create-35MYQPVM.js → create-E4HTVPP7.js} +17 -17
  146. package/dist/{create-JDGM5KXE.js → create-G4TF2M7G.js} +88 -42
  147. package/dist/{create-UQNYMVBM.js → create-LOP7AF5N.js} +6 -6
  148. package/dist/{create-UPYB65PD.js → create-MKFDE32U.js} +1 -1
  149. package/dist/{create-B5ZXTK3K.js → create-NR7ULWQS.js} +37 -34
  150. package/dist/{create-HI5UI2EZ.js → create-SJSLOXOW.js} +31 -26
  151. package/dist/{create-GB3ZA4LH.js → create-SYI6DVKM.js} +4 -4
  152. package/dist/{create-ORXYT74H.js → create-ZAGMLDR4.js} +13 -13
  153. package/dist/create-ZP4LSJYQ.js +216 -0
  154. package/dist/customer-group-add-customers-GTM556QA.js +251 -0
  155. package/dist/customer-group-create-OYHAXX2T.js +140 -0
  156. package/dist/customer-group-detail-KW62TLWA.js +58 -0
  157. package/dist/customer-group-edit-WH7O4N4L.js +137 -0
  158. package/dist/customer-groups-UJFZBZ2B.js +276 -0
  159. package/dist/{customers-ETXVNM3G.js → customers-4WKIFPUU.js} +7 -7
  160. package/dist/{edit-UGEC27HP.js → edit-3EN2H52W.js} +39 -36
  161. package/dist/{edit-ZMERG3L7.js → edit-3VNT35DW.js} +1 -1
  162. package/dist/{edit-ORXS3A2Y.js → edit-6DUTTLEV.js} +1 -1
  163. package/dist/edit-6K3NSVI7.js +103 -0
  164. package/dist/{edit-REDDBLTA.js → edit-6Z6RIJRZ.js} +4 -4
  165. package/dist/{edit-2Q7TRUTL.js → edit-CVSO5CX7.js} +14 -14
  166. package/dist/{edit-ZAHCMF5U.js → edit-FQDSESVI.js} +1 -1
  167. package/dist/edit-GZXLWSTL.js +176 -0
  168. package/dist/edit-LLNKSZR4.js +871 -0
  169. package/dist/{edit-O4JLGKQR.js → edit-MKVDAUA5.js} +1 -1
  170. package/dist/{edit-ZCXUG42Q.js → edit-NDUSRTWY.js} +13 -13
  171. package/dist/{edit-522DG3BY.js → edit-RBREBAQQ.js} +1 -1
  172. package/dist/{edit-Q3UQIOLS.js → edit-RQHOHZR6.js} +1 -1
  173. package/dist/{edit-VKT62KHG.js → edit-SAB6F3ZG.js} +36 -15
  174. package/dist/{edit-C4OCKQVU.js → edit-SM2GHVKW.js} +1 -1
  175. package/dist/{edit-KAKVPHZZ.js → edit-UVY3TEHD.js} +1 -1
  176. package/dist/{edit-SGUY2CCK.js → edit-V7WLYLOQ.js} +16 -16
  177. package/dist/{edit-FKXIQ6ZI.js → edit-XMZSLH4O.js} +16 -16
  178. package/dist/{edit-L5ZZLMAY.js → edit-YTS77SJS.js} +43 -32
  179. package/dist/{edit-budget-L3CCEWNF.js → edit-budget-4JMGEPNF.js} +1 -1
  180. package/dist/{edit-inventory-item-6B7ITDGD.js → edit-inventory-item-G22KFCYY.js} +2 -2
  181. package/dist/{edit-inventory-item-attributes-Y7MQZLXI.js → edit-inventory-item-attributes-RJSM4MEI.js} +2 -2
  182. package/dist/edit-price-K6K2FTMF.js +196 -0
  183. package/dist/edit-stock-6TUSJD5R.js +229 -0
  184. package/dist/fulfillment-VEF6HG6D.js +641 -0
  185. package/dist/{fulfillment-providers-DQAU43JZ.js → fulfillment-providers-VKBWFH45.js} +24 -24
  186. package/dist/index.css +107 -10
  187. package/dist/index.js +302 -183
  188. package/dist/{inventory-KAUVPMPZ.js → inventory-OCIGVZ4V.js} +6 -6
  189. package/dist/{offer-inventory-batch-page-WKCWNDNK.js → inventory-T7BRSFKY.js} +16 -16
  190. package/dist/{invite-CI2P4GF6.js → invite-J6L3Q7MQ.js} +12 -12
  191. package/dist/{invite-Q6EYDZVQ.js → invite-VWNUFOFI.js} +21 -21
  192. package/dist/loader-2EQ4ROTD.js +34 -0
  193. package/dist/loader-HYUC2XZX.js +33 -0
  194. package/dist/{login-KY342RMK.js → login-WOZMCEFY.js} +12 -12
  195. package/dist/{manage-locations-WNHEBS3A.js → manage-locations-R3ASMF5B.js} +1 -1
  196. package/dist/{media-B6ME2WXY.js → media-KIIJ6WSZ.js} +18 -17
  197. package/dist/media-RJHUSBXL.js +315 -0
  198. package/dist/{metadata-WR4RFXO5.js → metadata-45S6CFKY.js} +14 -14
  199. package/dist/{metadata-2CMH4I6U.js → metadata-FCATUWIZ.js} +14 -14
  200. package/dist/{metadata-GWI6R4ES.js → metadata-L5GBBXC4.js} +14 -14
  201. package/dist/{metadata-TLDUF5KV.js → metadata-R4ZRMAO6.js} +14 -14
  202. package/dist/{metadata-NUXUC2JA.js → metadata-RM5VVAOS.js} +14 -14
  203. package/dist/{offer-create-page-4Z6L63BU.js → offer-create-page-DV4JCIL2.js} +190 -195
  204. package/dist/offer-detail-page-TIBYGQBS.js +590 -0
  205. package/dist/offer-variant-detail-page-ORH56HZI.js +421 -0
  206. package/dist/offers-VA63KV3C.js +54 -0
  207. package/dist/{onboarding-43LQQQGQ.js → onboarding-L5RRKT65.js} +12 -12
  208. package/dist/{orders-ZV4D6L2V.js → orders-KKJD6EWZ.js} +27 -27
  209. package/dist/{organization-ZTQGRJWS.js → organization-6YPU2RQP.js} +53 -89
  210. package/dist/{organize-K6QMAMEN.js → organize-LR7FWK2J.js} +3 -3
  211. package/dist/{organize-HNJUHEEG.js → organize-SUG4SGVR.js} +3 -3
  212. package/dist/pages/index.d.ts +40 -16
  213. package/dist/pages/index.js +73 -73
  214. package/dist/{payment-details-64US5XWD.js → payment-details-UVEIHQA5.js} +13 -13
  215. package/dist/{payouts-UXJDTXDL.js → payouts-D4A4CILI.js} +8 -8
  216. package/dist/{price-lists-KBPUVSZI.js → price-lists-WJFXFGEV.js} +10 -10
  217. package/dist/{pricing-DF6C5XK4.js → pricing-QEVR2Z4K.js} +19 -19
  218. package/dist/{offer-pricing-edit-page-4TYGGSOE.js → pricing-XJUUCYL5.js} +24 -18
  219. package/dist/{product-tags-6MZB4W5R.js → product-tags-MW2JMRFY.js} +36 -33
  220. package/dist/{product-types-UUHBV4IZ.js → product-types-XXU7X42K.js} +6 -6
  221. package/dist/product-variant-detail-XZWTSH3H.js +369 -0
  222. package/dist/{product-variant-edit-YYNPHE4L.js → product-variant-edit-A2KO3E7B.js} +41 -44
  223. package/dist/{products-MZBU5MEV.js → products-TZS2OPK3.js} +37 -37
  224. package/dist/{products-IWKTGZS6.js → products-XSXEUKIB.js} +23 -22
  225. package/dist/{professional-details-5T2VS6MM.js → professional-details-ELUEJPOH.js} +13 -13
  226. package/dist/{profile-6XGHAT7H.js → profile-EDVGIBW6.js} +16 -16
  227. package/dist/{promotions-O7U4BTK6.js → promotions-JYO23G6N.js} +8 -8
  228. package/dist/receive-47SMYKIJ.js +578 -0
  229. package/dist/refund-IU7B77FV.js +268 -0
  230. package/dist/{register-N6WOSMLA.js → register-SR2SYX4Q.js} +14 -14
  231. package/dist/{reset-password-EICPAY2N.js → reset-password-N22YRMR3.js} +1 -1
  232. package/dist/{return-reasons-IX3LIOCU.js → return-reasons-POR5YPTF.js} +18 -15
  233. package/dist/{sales-channels-JW3QUYR7.js → sales-channels-ETB6QRRY.js} +8 -8
  234. package/dist/{sales-channels-B6FULRWI.js → sales-channels-YXRRARDL.js} +7 -7
  235. package/dist/{settings-MV53ZZ53.js → settings-MHBYIZ2I.js} +38 -35
  236. package/dist/shipment-ZX6PQ32L.js +241 -0
  237. package/dist/shipping-W4SPR3JO.js +122 -0
  238. package/dist/{shipping-profile-Y4SNEPZX.js → shipping-profile-L5CFXVEE.js} +4 -8
  239. package/dist/{shipping-profiles-2NWKCEJK.js → shipping-profiles-QBJUWXVQ.js} +17 -17
  240. package/dist/{stock-7CSVEJJU.js → stock-FW4DOVFV.js} +14 -14
  241. package/dist/{store-X23G3JCJ.js → store-NWWBV2UO.js} +75 -144
  242. package/dist/{store-closure-P5PD2RSV.js → store-closure-O3CBSOJD.js} +19 -14
  243. package/dist/{store-select-TREPDS3G.js → store-select-C7GI5MKK.js} +13 -13
  244. package/dist/{tax-regions-YXZW7UVX.js → tax-regions-2JCIB4T7.js} +2 -2
  245. package/dist/{team-SPP5OY5W.js → team-MY24J5WO.js} +20 -20
  246. package/package.json +2 -2
  247. package/dist/[id]-LTNOHLGE.js +0 -1219
  248. package/dist/allocate-items-SDFS5GYN.js +0 -533
  249. package/dist/chunk-432S4FGR.js +0 -0
  250. package/dist/chunk-AIZM66CG.js +0 -66
  251. package/dist/chunk-BDZOSMAX.js +0 -23
  252. package/dist/chunk-CFRWIQIZ.js +0 -43
  253. package/dist/chunk-GKZHBXZK.js +0 -426
  254. package/dist/chunk-RXZFEFNV.js +0 -73
  255. package/dist/chunk-T6LHVNWO.js +0 -27
  256. package/dist/chunk-WLT7K7K7.js +0 -63
  257. package/dist/create-FCKGCZSM.js +0 -210
  258. package/dist/edit-GQNIINRR.js +0 -192
  259. package/dist/fulfillment-75Z4H23W.js +0 -559
  260. package/dist/loader-FBB5OQRT.js +0 -31
  261. package/dist/metadata-5BPOBBU2.js +0 -45
  262. package/dist/offer-detail-page-6MAHNNIO.js +0 -488
  263. package/dist/offer-edit-page-DYQFU6JU.js +0 -151
  264. package/dist/offers-ZG6OTDZ2.js +0 -32
  265. package/dist/product-variant-detail-RVWEYVPC.js +0 -220
  266. package/dist/shipment-Q33QBMXX.js +0 -176
@@ -0,0 +1,871 @@
1
+ import {
2
+ useAddOrderEditItems,
3
+ useCancelOrderEdit,
4
+ useCreateOrderEdit,
5
+ useRemoveOrderEditAddedItem,
6
+ useRequestOrderEdit,
7
+ useUpdateOrderEditAddedItem,
8
+ useUpdateOrderEditOriginalItem
9
+ } from "./chunk-6ZGQ3SOR.js";
10
+ import {
11
+ MoneyAmountCell
12
+ } from "./chunk-L57USMYC.js";
13
+ import {
14
+ getStylizedAmount
15
+ } from "./chunk-3BXCPHN6.js";
16
+ import "./chunk-FQERBIVS.js";
17
+ import {
18
+ PlaceholderCell
19
+ } from "./chunk-PHOCVOZ5.js";
20
+ import {
21
+ _DataTable,
22
+ useDataTable
23
+ } from "./chunk-WKRW5OPL.js";
24
+ import "./chunk-YN3FGNJM.js";
25
+ import "./chunk-KCHYLLVG.js";
26
+ import "./chunk-3EF54XFY.js";
27
+ import "./chunk-IQPN4PZJ.js";
28
+ import "./chunk-TKGWSUEI.js";
29
+ import {
30
+ KeyboundForm
31
+ } from "./chunk-SITRHMZZ.js";
32
+ import {
33
+ RouteFocusModal,
34
+ StackedFocusModal,
35
+ useRouteModal,
36
+ useStackedModal
37
+ } from "./chunk-GDWBOQI5.js";
38
+ import {
39
+ Form
40
+ } from "./chunk-3QSRE5LS.js";
41
+ import {
42
+ useQueryParams
43
+ } from "./chunk-THHRRYRS.js";
44
+ import "./chunk-LRD242C7.js";
45
+ import {
46
+ Thumbnail
47
+ } from "./chunk-WIYFXWRI.js";
48
+ import "./chunk-INNFZYX2.js";
49
+ import {
50
+ useOffers
51
+ } from "./chunk-4R5GESED.js";
52
+ import {
53
+ useOrder,
54
+ useOrderPreview
55
+ } from "./chunk-7RGUD6PI.js";
56
+ import {
57
+ ActionMenu
58
+ } from "./chunk-BDGZ4EQO.js";
59
+ import "./chunk-LAVHRER2.js";
60
+ import "./chunk-QHQWEERJ.js";
61
+ import "./chunk-Y7QKP6QU.js";
62
+ import "./chunk-TSTUAL6N.js";
63
+ import "./chunk-A5DJIOHN.js";
64
+ import "./chunk-RHKRREUU.js";
65
+ import "./chunk-ZA2KFUFR.js";
66
+ import "./chunk-RIN4CBRB.js";
67
+ import "./chunk-NBMM2TZK.js";
68
+
69
+ // src/pages/orders/[id]/edit/index.tsx
70
+ import { toast as toast4 } from "@medusajs/ui";
71
+ import { useEffect } from "react";
72
+ import { useTranslation as useTranslation7 } from "react-i18next";
73
+ import { useNavigate, useParams } from "react-router-dom";
74
+
75
+ // src/pages/orders/[id]/edit/_components/order-edit-create-form/order-edit-create-form.tsx
76
+ import { zodResolver } from "@hookform/resolvers/zod";
77
+ import { Button as Button2, Heading as Heading2, Input as Input3, Switch, toast as toast3, usePrompt } from "@medusajs/ui";
78
+ import { useForm } from "react-hook-form";
79
+ import { useTranslation as useTranslation6 } from "react-i18next";
80
+
81
+ // src/pages/orders/[id]/edit/_components/order-edit-create-form/order-edit-items-section.tsx
82
+ import { Button, Heading, Input as Input2, toast as toast2 } from "@medusajs/ui";
83
+ import { useMemo as useMemo4, useState as useState2 } from "react";
84
+ import { useTranslation as useTranslation5 } from "react-i18next";
85
+
86
+ // src/pages/orders/[id]/edit/_components/add-order-edit-items-table/add-order-edit-items-table.tsx
87
+ import { useMemo as useMemo2, useState } from "react";
88
+ import { useTranslation as useTranslation3 } from "react-i18next";
89
+
90
+ // src/pages/orders/[id]/edit/_components/add-order-edit-items-table/use-order-edit-item-table-columns.tsx
91
+ import { Checkbox, Text } from "@medusajs/ui";
92
+ import { createColumnHelper } from "@tanstack/react-table";
93
+ import { useMemo } from "react";
94
+ import { useTranslation } from "react-i18next";
95
+ import { jsx, jsxs } from "react/jsx-runtime";
96
+ var columnHelper = createColumnHelper();
97
+ var useOrderEditItemsTableColumns = () => {
98
+ const { t } = useTranslation();
99
+ return useMemo(
100
+ () => [
101
+ columnHelper.display({
102
+ id: "select",
103
+ header: ({ table }) => /* @__PURE__ */ jsx(
104
+ Checkbox,
105
+ {
106
+ checked: table.getIsSomePageRowsSelected() ? "indeterminate" : table.getIsAllPageRowsSelected(),
107
+ onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value)
108
+ }
109
+ ),
110
+ cell: ({ row }) => {
111
+ const isSelectable = row.getCanSelect();
112
+ return /* @__PURE__ */ jsx(
113
+ Checkbox,
114
+ {
115
+ disabled: !isSelectable,
116
+ checked: row.getIsSelected(),
117
+ onCheckedChange: (value) => row.toggleSelected(!!value),
118
+ onClick: (e) => {
119
+ e.stopPropagation();
120
+ }
121
+ }
122
+ );
123
+ }
124
+ }),
125
+ columnHelper.display({
126
+ id: "product",
127
+ header: t("fields.product"),
128
+ cell: ({ row }) => {
129
+ const variant = row.original.product_variant;
130
+ const productTitle = variant?.product?.title;
131
+ if (!productTitle) {
132
+ return /* @__PURE__ */ jsx(PlaceholderCell, {});
133
+ }
134
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full max-w-[300px] items-center gap-x-3 overflow-hidden", children: [
135
+ /* @__PURE__ */ jsx(Thumbnail, { src: variant?.product?.thumbnail }),
136
+ /* @__PURE__ */ jsx(
137
+ Text,
138
+ {
139
+ size: "small",
140
+ leading: "compact",
141
+ className: "truncate",
142
+ title: productTitle,
143
+ children: productTitle
144
+ }
145
+ )
146
+ ] });
147
+ }
148
+ }),
149
+ columnHelper.accessor("sku", {
150
+ header: t("fields.sku"),
151
+ cell: ({ getValue }) => {
152
+ const sku = getValue();
153
+ if (!sku) return /* @__PURE__ */ jsx(PlaceholderCell, {});
154
+ return /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "truncate", children: sku });
155
+ }
156
+ }),
157
+ columnHelper.display({
158
+ id: "variant_title",
159
+ header: t("fields.title"),
160
+ cell: ({ row }) => {
161
+ const title = row.original.product_variant?.title;
162
+ if (!title) return /* @__PURE__ */ jsx(PlaceholderCell, {});
163
+ return /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "truncate", children: title });
164
+ }
165
+ })
166
+ ],
167
+ [t]
168
+ );
169
+ };
170
+
171
+ // src/pages/orders/[id]/edit/_components/add-order-edit-items-table/use-order-edit-item-table-filters.tsx
172
+ import { useTranslation as useTranslation2 } from "react-i18next";
173
+ var useOrderEditItemTableFilters = () => {
174
+ const { t } = useTranslation2();
175
+ const filters = [
176
+ {
177
+ key: "created_at",
178
+ label: t("fields.createdAt"),
179
+ type: "date"
180
+ },
181
+ {
182
+ key: "updated_at",
183
+ label: t("fields.updatedAt"),
184
+ type: "date"
185
+ }
186
+ ];
187
+ return filters;
188
+ };
189
+
190
+ // src/pages/orders/[id]/edit/_components/add-order-edit-items-table/use-order-edit-item-table-query.tsx
191
+ var useOrderEditItemTableQuery = ({
192
+ pageSize = 50,
193
+ prefix
194
+ }) => {
195
+ const raw = useQueryParams(
196
+ ["q", "offset", "order", "created_at", "updated_at"],
197
+ prefix
198
+ );
199
+ const { offset, created_at, updated_at, ...rest } = raw;
200
+ const searchParams = {
201
+ ...rest,
202
+ limit: pageSize,
203
+ offset: offset ? Number(offset) : 0,
204
+ created_at: created_at ? JSON.parse(created_at) : void 0,
205
+ updated_at: updated_at ? JSON.parse(updated_at) : void 0
206
+ };
207
+ return { searchParams, raw };
208
+ };
209
+
210
+ // src/pages/orders/[id]/edit/_components/add-order-edit-items-table/add-order-edit-items-table.tsx
211
+ import { jsx as jsx2 } from "react/jsx-runtime";
212
+ var PAGE_SIZE = 50;
213
+ var PREFIX = "rit";
214
+ var OFFER_PICKER_FIELDS = [
215
+ "id",
216
+ "sku",
217
+ "variant_id",
218
+ "seller_id",
219
+ "prices.amount",
220
+ "prices.currency_code",
221
+ "product_variant.id",
222
+ "product_variant.title",
223
+ "product_variant.product.id",
224
+ "product_variant.product.title",
225
+ "product_variant.product.thumbnail",
226
+ "product_variant.manage_inventory",
227
+ "product_variant.inventory_quantity",
228
+ "product_variant.inventory_items.required_quantity",
229
+ "product_variant.inventory_items.inventory.location_levels.available_quantity"
230
+ ].join(",");
231
+ var offerHasInventory = (offer) => {
232
+ const variant = offer.product_variant;
233
+ if (!variant) return false;
234
+ if (variant.manage_inventory === false) return true;
235
+ const links = variant.inventory_items ?? [];
236
+ if (!links.length) {
237
+ return (variant.inventory_quantity ?? 0) > 0;
238
+ }
239
+ return links.every((link) => {
240
+ const available = (link.inventory?.location_levels ?? []).reduce(
241
+ (acc, lvl) => acc + (lvl.available_quantity ?? 0),
242
+ 0
243
+ );
244
+ const required = link.required_quantity ?? 1;
245
+ return required > 0 && available >= required;
246
+ });
247
+ };
248
+ var AddOrderEditItemsTable = ({
249
+ currencyCode,
250
+ onSelectionChange
251
+ }) => {
252
+ const { t } = useTranslation3();
253
+ const [rowSelection, setRowSelection] = useState({});
254
+ const updater = (fn) => {
255
+ const newState = typeof fn === "function" ? fn(rowSelection) : fn;
256
+ setRowSelection(newState);
257
+ onSelectionChange(Object.keys(newState));
258
+ };
259
+ const { searchParams, raw } = useOrderEditItemTableQuery({
260
+ pageSize: PAGE_SIZE,
261
+ prefix: PREFIX
262
+ });
263
+ const offersResponse = useOffers({
264
+ ...searchParams,
265
+ fields: OFFER_PICKER_FIELDS
266
+ });
267
+ const rawOffersSource = offersResponse.offers;
268
+ const rawOffers = useMemo2(
269
+ () => rawOffersSource ?? [],
270
+ [rawOffersSource]
271
+ );
272
+ const rawCount = offersResponse.count ?? 0;
273
+ const offers = useMemo2(() => {
274
+ return rawOffers.filter((offer) => {
275
+ if (currencyCode) {
276
+ const hasPrice = (offer.prices ?? []).some(
277
+ (p) => p.currency_code === currencyCode
278
+ );
279
+ if (!hasPrice) return false;
280
+ }
281
+ return offerHasInventory(offer);
282
+ });
283
+ }, [rawOffers, currencyCode]);
284
+ const count = offers.length;
285
+ void rawCount;
286
+ const columns = useOrderEditItemsTableColumns();
287
+ const filters = useOrderEditItemTableFilters();
288
+ const { table } = useDataTable({
289
+ data: offers,
290
+ columns,
291
+ count,
292
+ enablePagination: true,
293
+ // Row id = offer id so onSelectionChange yields offer_ids that the modal
294
+ // layer sends to the backend item-add routes (which accept `offer_id` and
295
+ // resolve to variant_id + unit_price server-side).
296
+ getRowId: (row) => row.id,
297
+ pageSize: PAGE_SIZE,
298
+ enableRowSelection: () => true,
299
+ rowSelection: {
300
+ state: rowSelection,
301
+ updater
302
+ }
303
+ });
304
+ return /* @__PURE__ */ jsx2(
305
+ "div",
306
+ {
307
+ className: "flex size-full flex-col overflow-hidden",
308
+ "data-testid": "add-offers-picker",
309
+ children: /* @__PURE__ */ jsx2(
310
+ _DataTable,
311
+ {
312
+ table,
313
+ columns,
314
+ pageSize: PAGE_SIZE,
315
+ count,
316
+ filters,
317
+ pagination: true,
318
+ layout: "fill",
319
+ search: true,
320
+ orderBy: [
321
+ { key: "sku", label: t("fields.sku") },
322
+ { key: "created_at", label: t("fields.createdAt") },
323
+ { key: "updated_at", label: t("fields.updatedAt") }
324
+ ],
325
+ prefix: PREFIX,
326
+ queryObject: raw
327
+ }
328
+ )
329
+ }
330
+ );
331
+ };
332
+
333
+ // src/pages/orders/[id]/edit/_components/order-edit-create-form/order-edit-item.tsx
334
+ import { ArrowUturnLeft, ReceiptPercent, XCircle } from "@medusajs/icons";
335
+ import { Badge, Input, Text as Text2, toast, Tooltip } from "@medusajs/ui";
336
+ import { useMemo as useMemo3 } from "react";
337
+ import { useTranslation as useTranslation4 } from "react-i18next";
338
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
339
+ function OrderEditItem({ item, currencyCode, orderId }) {
340
+ const { t } = useTranslation4();
341
+ const { mutateAsync: updateAddedItem } = useUpdateOrderEditAddedItem(orderId);
342
+ const { mutateAsync: updateOriginalItem } = useUpdateOrderEditOriginalItem(orderId);
343
+ const { mutateAsync: undoAction } = useRemoveOrderEditAddedItem(orderId);
344
+ const actions = useMemo3(
345
+ () => item.actions ?? [],
346
+ [item.actions]
347
+ );
348
+ const isAddedItem = useMemo3(
349
+ () => !!actions.find((a) => a.action === "ITEM_ADD"),
350
+ [actions]
351
+ );
352
+ const isItemUpdated = useMemo3(
353
+ () => !!actions.find((a) => a.action === "ITEM_UPDATE"),
354
+ [actions]
355
+ );
356
+ const fulfilledQty = item.detail?.fulfilled_quantity ?? 0;
357
+ const returnedQty = item.detail?.returned_quantity ?? 0;
358
+ const floor = fulfilledQty + returnedQty;
359
+ const isItemRemoved = useMemo3(() => {
360
+ const updateAction = actions.find((a) => a.action === "ITEM_UPDATE");
361
+ return !!updateAction && item.quantity === floor;
362
+ }, [actions, item.quantity, floor]);
363
+ const appliedPromoCodes = useMemo3(() => {
364
+ return (item.adjustments || []).map((adjustment) => adjustment.code).filter((c) => !!c);
365
+ }, [item.adjustments]);
366
+ const onUpdate = async (quantity) => {
367
+ if (quantity < floor) {
368
+ toast.error(t("orders.edits.removeBlockedFulfilledOrReturned"));
369
+ return;
370
+ }
371
+ if (quantity === item.quantity) {
372
+ return;
373
+ }
374
+ const addItemAction = actions.find((a) => a.action === "ITEM_ADD");
375
+ try {
376
+ if (addItemAction) {
377
+ await updateAddedItem({ $actionId: addItemAction.id, quantity });
378
+ } else {
379
+ await updateOriginalItem({ $itemId: item.id, quantity });
380
+ }
381
+ } catch (e) {
382
+ toast.error(
383
+ e instanceof Error ? e.message : t("errorBoundary.defaultTitle")
384
+ );
385
+ }
386
+ };
387
+ const onRemove = async () => {
388
+ const addItemAction = actions.find((a) => a.action === "ITEM_ADD");
389
+ try {
390
+ if (addItemAction) {
391
+ await undoAction(addItemAction.id);
392
+ } else {
393
+ await updateOriginalItem({
394
+ $itemId: item.id,
395
+ quantity: floor
396
+ });
397
+ }
398
+ } catch (e) {
399
+ toast.error(
400
+ e instanceof Error ? e.message : t("errorBoundary.defaultTitle")
401
+ );
402
+ }
403
+ };
404
+ const onRemoveUndo = async () => {
405
+ const updateItemAction = actions.find((a) => a.action === "ITEM_UPDATE");
406
+ try {
407
+ if (updateItemAction) {
408
+ await undoAction(updateItemAction.id);
409
+ }
410
+ } catch (e) {
411
+ toast.error(
412
+ e instanceof Error ? e.message : t("errorBoundary.defaultTitle")
413
+ );
414
+ }
415
+ };
416
+ const isAtFloor = item.quantity === floor;
417
+ const qtyInput = /* @__PURE__ */ jsx3(
418
+ Input,
419
+ {
420
+ className: "bg-ui-bg-base txt-small w-[67px] rounded-lg [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
421
+ type: "number",
422
+ step: "any",
423
+ disabled: isAtFloor,
424
+ min: floor,
425
+ defaultValue: item.quantity,
426
+ "data-testid": `edit-item-${item.id}-qty`,
427
+ onBlur: (e) => {
428
+ const val = e.target.value;
429
+ const payload = val === "" ? null : Number(val);
430
+ if (payload !== null) {
431
+ onUpdate(payload);
432
+ }
433
+ }
434
+ }
435
+ );
436
+ return /* @__PURE__ */ jsx3(
437
+ "div",
438
+ {
439
+ className: "bg-ui-bg-subtle shadow-elevation-card-rest my-2 rounded-xl",
440
+ "data-testid": `edit-item-${item.id}`,
441
+ children: /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center gap-x-2 gap-y-2 p-3 text-sm md:flex-row", children: [
442
+ /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 items-center justify-between", children: [
443
+ /* @__PURE__ */ jsxs2("div", { className: "flex flex-row items-center gap-x-3", children: [
444
+ /* @__PURE__ */ jsx3(Thumbnail, { src: item.thumbnail }),
445
+ /* @__PURE__ */ jsxs2("div", { className: "flex flex-col", children: [
446
+ /* @__PURE__ */ jsxs2("div", { children: [
447
+ /* @__PURE__ */ jsxs2(Text2, { className: "txt-small", as: "span", weight: "plus", children: [
448
+ item.title,
449
+ " "
450
+ ] }),
451
+ item.variant_sku && /* @__PURE__ */ jsxs2("span", { children: [
452
+ "(",
453
+ item.variant_sku,
454
+ ")"
455
+ ] })
456
+ ] }),
457
+ /* @__PURE__ */ jsx3(Text2, { as: "div", className: "text-ui-fg-subtle txt-small", children: item.subtitle })
458
+ ] })
459
+ ] }),
460
+ isAddedItem && /* @__PURE__ */ jsx3(Badge, { size: "2xsmall", rounded: "full", color: "blue", className: "mr-1", children: t("general.new") }),
461
+ isItemRemoved ? /* @__PURE__ */ jsx3(Badge, { size: "2xsmall", rounded: "full", color: "red", className: "mr-1", children: t("general.removed") }) : isItemUpdated && /* @__PURE__ */ jsx3(
462
+ Badge,
463
+ {
464
+ size: "2xsmall",
465
+ rounded: "full",
466
+ color: "orange",
467
+ className: "mr-1",
468
+ children: t("general.modified")
469
+ }
470
+ )
471
+ ] }),
472
+ /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 items-center justify-between", children: [
473
+ /* @__PURE__ */ jsxs2("div", { className: "flex flex-grow items-center gap-2", children: [
474
+ floor > 0 && isAtFloor ? /* @__PURE__ */ jsx3(
475
+ Tooltip,
476
+ {
477
+ content: t("orders.edits.removeBlockedFulfilledOrReturned"),
478
+ children: qtyInput
479
+ }
480
+ ) : qtyInput,
481
+ /* @__PURE__ */ jsx3(Text2, { className: "txt-small text-ui-fg-subtle", children: t("fields.qty") }),
482
+ appliedPromoCodes.length > 0 && /* @__PURE__ */ jsx3("div", { className: "flex flex-shrink pt-[2px]", children: /* @__PURE__ */ jsx3(
483
+ Tooltip,
484
+ {
485
+ content: /* @__PURE__ */ jsx3("span", { className: "text-pretty", children: appliedPromoCodes.map((code) => /* @__PURE__ */ jsx3("div", { children: code }, code)) }),
486
+ children: /* @__PURE__ */ jsx3(ReceiptPercent, { className: "text-ui-fg-subtle font-normal" })
487
+ }
488
+ ) })
489
+ ] }),
490
+ /* @__PURE__ */ jsx3("div", { className: "text-ui-fg-subtle txt-small mr-2 flex flex-shrink-0", children: /* @__PURE__ */ jsx3(
491
+ MoneyAmountCell,
492
+ {
493
+ currencyCode,
494
+ amount: item.total ?? 0
495
+ }
496
+ ) }),
497
+ /* @__PURE__ */ jsx3(
498
+ ActionMenu,
499
+ {
500
+ groups: [
501
+ {
502
+ actions: [
503
+ !isItemRemoved ? {
504
+ label: t("actions.remove"),
505
+ onClick: onRemove,
506
+ icon: /* @__PURE__ */ jsx3(XCircle, {}),
507
+ disabled: isAtFloor
508
+ } : {
509
+ label: t("actions.undo"),
510
+ onClick: onRemoveUndo,
511
+ icon: /* @__PURE__ */ jsx3(ArrowUturnLeft, {})
512
+ }
513
+ ]
514
+ }
515
+ ]
516
+ }
517
+ )
518
+ ] })
519
+ ] })
520
+ },
521
+ item.quantity
522
+ );
523
+ }
524
+
525
+ // src/pages/orders/[id]/edit/_components/order-edit-create-form/order-edit-items-section.tsx
526
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
527
+ var addedOffers = [];
528
+ var OrderEditItemsSection = ({
529
+ order,
530
+ preview
531
+ }) => {
532
+ const { t } = useTranslation5();
533
+ const { setIsOpen } = useStackedModal();
534
+ const [filterTerm, setFilterTerm] = useState2("");
535
+ const { mutateAsync: addItems, isPending } = useAddOrderEditItems(order.id);
536
+ const onItemsSelected = async () => {
537
+ if (!addedOffers.length) {
538
+ setIsOpen("order-edit-add-items", false);
539
+ return;
540
+ }
541
+ try {
542
+ await addItems({
543
+ // Vendor route resolves `offer_id` → variant_id + unit_price
544
+ // server-side. Picker rows are keyed by offer id, not variant id.
545
+ items: addedOffers.map((offer_id) => ({
546
+ offer_id,
547
+ quantity: 1
548
+ }))
549
+ });
550
+ addedOffers = [];
551
+ setIsOpen("order-edit-add-items", false);
552
+ } catch (e) {
553
+ toast2.error(
554
+ e instanceof Error ? e.message : t("errorBoundary.defaultTitle")
555
+ );
556
+ }
557
+ };
558
+ const filteredItems = useMemo4(() => {
559
+ const term = filterTerm.toLowerCase();
560
+ if (!term) {
561
+ return preview.items;
562
+ }
563
+ return preview.items.filter(
564
+ (i) => i.title?.toLowerCase().includes(term) || i.product_title?.toLowerCase().includes(term)
565
+ );
566
+ }, [preview, filterTerm]);
567
+ return /* @__PURE__ */ jsxs3("div", { children: [
568
+ /* @__PURE__ */ jsxs3("div", { className: "mb-3 mt-8 flex items-center justify-between", children: [
569
+ /* @__PURE__ */ jsx4(Heading, { level: "h2", children: t("fields.items") }),
570
+ /* @__PURE__ */ jsxs3("div", { className: "flex gap-2", children: [
571
+ /* @__PURE__ */ jsx4(
572
+ Input2,
573
+ {
574
+ value: filterTerm,
575
+ onChange: (e) => setFilterTerm(e.target.value),
576
+ placeholder: t("fields.search"),
577
+ autoComplete: "off",
578
+ type: "search",
579
+ "data-testid": "edit-items-search"
580
+ }
581
+ ),
582
+ /* @__PURE__ */ jsxs3(StackedFocusModal, { id: "order-edit-add-items", children: [
583
+ /* @__PURE__ */ jsx4(StackedFocusModal.Trigger, { asChild: true, children: /* @__PURE__ */ jsx4(
584
+ Button,
585
+ {
586
+ variant: "secondary",
587
+ size: "small",
588
+ "data-testid": "edit-add-items-trigger",
589
+ children: t("actions.addItems")
590
+ }
591
+ ) }),
592
+ /* @__PURE__ */ jsxs3(StackedFocusModal.Content, { children: [
593
+ /* @__PURE__ */ jsx4(StackedFocusModal.Header, {}),
594
+ /* @__PURE__ */ jsx4(StackedFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx4("span", { className: "sr-only", children: t("orders.edits.addItems") }) }),
595
+ /* @__PURE__ */ jsx4(StackedFocusModal.Description, { className: "sr-only", children: t("orders.edits.addItemsDescription") }),
596
+ /* @__PURE__ */ jsx4(StackedFocusModal.Body, { className: "size-full overflow-hidden", children: /* @__PURE__ */ jsx4(
597
+ AddOrderEditItemsTable,
598
+ {
599
+ currencyCode: order.currency_code,
600
+ onSelectionChange: (finalSelection) => {
601
+ addedOffers = finalSelection;
602
+ }
603
+ }
604
+ ) }),
605
+ /* @__PURE__ */ jsx4(StackedFocusModal.Footer, { children: /* @__PURE__ */ jsx4("div", { className: "flex w-full items-center justify-end gap-x-4", children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-end gap-x-2", children: [
606
+ /* @__PURE__ */ jsx4(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx4(
607
+ Button,
608
+ {
609
+ type: "button",
610
+ variant: "secondary",
611
+ size: "small",
612
+ "data-testid": "edit-add-items-cancel",
613
+ children: t("actions.cancel")
614
+ }
615
+ ) }),
616
+ /* @__PURE__ */ jsx4(
617
+ Button,
618
+ {
619
+ type: "submit",
620
+ variant: "primary",
621
+ size: "small",
622
+ disabled: isPending,
623
+ onClick: async () => await onItemsSelected(),
624
+ "data-testid": "edit-add-items-save",
625
+ children: t("actions.save")
626
+ },
627
+ "submit-button"
628
+ )
629
+ ] }) }) })
630
+ ] })
631
+ ] })
632
+ ] })
633
+ ] }),
634
+ filteredItems.map((item) => /* @__PURE__ */ jsx4(
635
+ OrderEditItem,
636
+ {
637
+ item,
638
+ orderId: order.id,
639
+ currencyCode: order.currency_code
640
+ },
641
+ item.id
642
+ )),
643
+ filterTerm && !filteredItems.length && /* @__PURE__ */ jsx4(
644
+ "div",
645
+ {
646
+ style: {
647
+ background: "repeating-linear-gradient(-45deg, rgb(212, 212, 216, 0.15), rgb(212, 212, 216,.15) 10px, transparent 10px, transparent 20px)"
648
+ },
649
+ className: "bg-ui-bg-field mt-4 block h-[56px] w-full rounded-lg border border-dashed"
650
+ }
651
+ )
652
+ ] });
653
+ };
654
+
655
+ // src/pages/orders/[id]/edit/_components/order-edit-create-form/schema.ts
656
+ import { z } from "zod";
657
+ var OrderEditCreateSchema = z.object({
658
+ note: z.string().optional(),
659
+ send_notification: z.boolean().optional()
660
+ });
661
+
662
+ // src/pages/orders/[id]/edit/_components/order-edit-create-form/order-edit-create-form.tsx
663
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
664
+ var OrderEditCreateForm = ({
665
+ order,
666
+ preview
667
+ }) => {
668
+ const { t } = useTranslation6();
669
+ const { handleSuccess } = useRouteModal();
670
+ const { mutateAsync: cancelOrderEditRequest, isPending: isCanceling } = useCancelOrderEdit(order.id);
671
+ const { mutateAsync: requestOrderEdit, isPending: isRequesting } = useRequestOrderEdit(order.id);
672
+ const isRequestRunning = isCanceling || isRequesting;
673
+ const form = useForm({
674
+ defaultValues: () => {
675
+ return Promise.resolve({
676
+ note: "",
677
+ send_notification: false
678
+ });
679
+ },
680
+ resolver: zodResolver(OrderEditCreateSchema)
681
+ });
682
+ const prompt = usePrompt();
683
+ const handleSubmit = form.handleSubmit(async () => {
684
+ try {
685
+ const res = await prompt({
686
+ title: t("general.areYouSure"),
687
+ description: t("orders.edits.confirmText"),
688
+ confirmText: t("actions.continue"),
689
+ cancelText: t("actions.cancel"),
690
+ variant: "confirmation"
691
+ });
692
+ if (!res) {
693
+ return;
694
+ }
695
+ await requestOrderEdit();
696
+ toast3.success(t("orders.edits.createSuccessToast"));
697
+ handleSuccess(`/orders/${order.id}`);
698
+ } catch (e) {
699
+ toast3.error(t("general.error"), {
700
+ description: e instanceof Error ? e.message : t("errorBoundary.defaultTitle")
701
+ });
702
+ }
703
+ });
704
+ return /* @__PURE__ */ jsx5(
705
+ RouteFocusModal.Form,
706
+ {
707
+ form,
708
+ onClose: (isSubmitSuccessful) => {
709
+ if (!isSubmitSuccessful) {
710
+ cancelOrderEditRequest(void 0, {
711
+ onSuccess: () => {
712
+ toast3.success(t("orders.edits.toast.canceledSuccessfully"));
713
+ },
714
+ onError: (error) => {
715
+ toast3.error(error.message);
716
+ }
717
+ });
718
+ }
719
+ },
720
+ children: /* @__PURE__ */ jsxs4(KeyboundForm, { onSubmit: handleSubmit, className: "flex h-full flex-col", children: [
721
+ /* @__PURE__ */ jsx5(RouteFocusModal.Header, {}),
722
+ /* @__PURE__ */ jsx5(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx5("span", { className: "sr-only", children: t("orders.edits.title") }) }),
723
+ /* @__PURE__ */ jsx5(RouteFocusModal.Description, { className: "sr-only", children: t("orders.edits.title") }),
724
+ /* @__PURE__ */ jsx5(RouteFocusModal.Body, { className: "flex size-full justify-center overflow-y-auto", children: /* @__PURE__ */ jsxs4("div", { className: "mt-16 w-[720px] max-w-[100%] px-4 md:p-0", children: [
725
+ /* @__PURE__ */ jsx5(Heading2, { level: "h1", children: t("orders.edits.create") }),
726
+ /* @__PURE__ */ jsx5(OrderEditItemsSection, { preview, order }),
727
+ /* @__PURE__ */ jsxs4("div", { className: "mt-8 border-y border-dotted py-4", children: [
728
+ /* @__PURE__ */ jsxs4("div", { className: "mb-2 flex items-center justify-between", children: [
729
+ /* @__PURE__ */ jsx5("span", { className: "txt-small text-ui-fg-subtle", children: t("orders.edits.currentTotal") }),
730
+ /* @__PURE__ */ jsx5("span", { className: "txt-small text-ui-fg-subtle", children: getStylizedAmount(order.total, order.currency_code) })
731
+ ] }),
732
+ /* @__PURE__ */ jsxs4("div", { className: "mb-2 flex items-center justify-between", children: [
733
+ /* @__PURE__ */ jsx5("span", { className: "txt-small text-ui-fg-subtle", children: t("orders.edits.newTotal") }),
734
+ /* @__PURE__ */ jsx5("span", { className: "txt-small text-ui-fg-subtle", children: getStylizedAmount(preview.total, order.currency_code) })
735
+ ] }),
736
+ /* @__PURE__ */ jsxs4("div", { className: "mt-4 flex items-center justify-between border-t border-dotted pt-4", children: [
737
+ /* @__PURE__ */ jsx5("span", { className: "txt-small font-medium", children: t("orders.edits.differenceDue") }),
738
+ /* @__PURE__ */ jsx5("span", { className: "txt-small font-medium", children: getStylizedAmount(
739
+ preview.summary.pending_difference,
740
+ order.currency_code
741
+ ) })
742
+ ] })
743
+ ] }),
744
+ /* @__PURE__ */ jsx5(
745
+ Form.Field,
746
+ {
747
+ control: form.control,
748
+ name: "note",
749
+ render: ({ field }) => {
750
+ return /* @__PURE__ */ jsx5(Form.Item, { children: /* @__PURE__ */ jsxs4("div", { className: "mt-8 flex", children: [
751
+ /* @__PURE__ */ jsxs4("div", { className: "block flex-1", children: [
752
+ /* @__PURE__ */ jsx5(Form.Label, { optional: true, children: t("fields.note") }),
753
+ /* @__PURE__ */ jsx5(Form.Hint, { className: "!mt-1", children: t("orders.edits.noteHint") })
754
+ ] }),
755
+ /* @__PURE__ */ jsx5("div", { className: "w-full flex-1 flex-grow", children: /* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(Input3, { ...field, "data-testid": "edit-internal-note" }) }) })
756
+ ] }) });
757
+ }
758
+ }
759
+ ),
760
+ /* @__PURE__ */ jsx5("div", { className: "bg-ui-bg-field mt-8 rounded-lg border py-2 pl-2 pr-4", children: /* @__PURE__ */ jsx5(
761
+ Form.Field,
762
+ {
763
+ control: form.control,
764
+ name: "send_notification",
765
+ render: ({ field: { onChange, value, ...field } }) => {
766
+ return /* @__PURE__ */ jsxs4(Form.Item, { children: [
767
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center", children: [
768
+ /* @__PURE__ */ jsx5(Form.Control, { className: "mr-4 self-start", children: /* @__PURE__ */ jsx5(
769
+ Switch,
770
+ {
771
+ dir: "ltr",
772
+ className: "mt-[2px] rtl:rotate-180",
773
+ checked: !!value,
774
+ onCheckedChange: onChange,
775
+ ...field
776
+ }
777
+ ) }),
778
+ /* @__PURE__ */ jsxs4("div", { className: "block", children: [
779
+ /* @__PURE__ */ jsx5(Form.Label, { children: t("orders.edits.sendNotification") }),
780
+ /* @__PURE__ */ jsx5(Form.Hint, { className: "!mt-1", children: t("orders.edits.sendNotificationHint") })
781
+ ] })
782
+ ] }),
783
+ /* @__PURE__ */ jsx5(Form.ErrorMessage, {})
784
+ ] });
785
+ }
786
+ }
787
+ ) }),
788
+ /* @__PURE__ */ jsx5("div", { className: "p-8" })
789
+ ] }) }),
790
+ /* @__PURE__ */ jsx5(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsx5("div", { className: "flex w-full items-center justify-end gap-x-4", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-end gap-x-2", children: [
791
+ /* @__PURE__ */ jsx5(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx5(
792
+ Button2,
793
+ {
794
+ type: "button",
795
+ variant: "secondary",
796
+ size: "small",
797
+ "data-testid": "edit-cancel",
798
+ children: t("orders.edits.cancel")
799
+ }
800
+ ) }),
801
+ /* @__PURE__ */ jsx5(
802
+ Button2,
803
+ {
804
+ type: "submit",
805
+ variant: "primary",
806
+ size: "small",
807
+ isLoading: isRequestRunning,
808
+ "data-testid": "edit-confirm",
809
+ children: t("orders.edits.confirm")
810
+ },
811
+ "submit-button"
812
+ )
813
+ ] }) }) })
814
+ ] })
815
+ }
816
+ );
817
+ };
818
+
819
+ // src/pages/orders/[id]/edit/index.tsx
820
+ import { jsx as jsx6 } from "react/jsx-runtime";
821
+ var IS_REQUEST_RUNNING = false;
822
+ var Component = () => {
823
+ const { id } = useParams();
824
+ const navigate = useNavigate();
825
+ const { t } = useTranslation7();
826
+ const orderId = id ?? "";
827
+ const { order } = useOrder(orderId, {
828
+ // Use the `<rel>.*` suffix form. Combining `*foo` with `*foo.bar`
829
+ // (or the `+foo.bar.baz` form) makes Medusa's query parser try to
830
+ // look up a literal property called `*items` / `+items` on Order
831
+ // and 500. See packages/core/src/api/vendor/orders/query-config.ts
832
+ // for the matching guidance applied to the defaults.
833
+ fields: "currency_code,total,items.*,items.variant.*"
834
+ });
835
+ const { order: preview } = useOrderPreview(orderId);
836
+ const { mutateAsync: createOrderEdit } = useCreateOrderEdit(orderId);
837
+ useEffect(() => {
838
+ async function run() {
839
+ if (IS_REQUEST_RUNNING || !preview) {
840
+ return;
841
+ }
842
+ if (preview.order_change) {
843
+ if (preview.order_change.change_type !== "edit") {
844
+ navigate(`/orders/${preview.id}`, { replace: true });
845
+ toast4.error(t("orders.edits.activeChangeError"));
846
+ }
847
+ return;
848
+ }
849
+ IS_REQUEST_RUNNING = true;
850
+ try {
851
+ await createOrderEdit({
852
+ order_id: preview.id
853
+ });
854
+ } catch (e) {
855
+ toast4.error(
856
+ e instanceof Error ? e.message : t("errorBoundary.defaultTitle")
857
+ );
858
+ navigate(`/orders/${preview.id}`, { replace: true });
859
+ } finally {
860
+ IS_REQUEST_RUNNING = false;
861
+ }
862
+ }
863
+ run();
864
+ }, [preview, createOrderEdit, navigate, t]);
865
+ return /* @__PURE__ */ jsx6(RouteFocusModal, { children: preview && order && /* @__PURE__ */ jsx6(OrderEditCreateForm, { order, preview }) });
866
+ };
867
+ var edit_default = Component;
868
+ export {
869
+ Component,
870
+ edit_default as default
871
+ };