@mercurjs/vendor 2.2.1 → 2.3.0-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 (204) hide show
  1. package/dist/{[id]-47SUX5X3.js → [id]-3IFUEMOA.js} +12 -9
  2. package/dist/{[id]-PIB2DEVI.js → [id]-3NM7G2QP.js} +11 -8
  3. package/dist/[id]-3TCOLUQH.js +197 -0
  4. package/dist/{[id]-SKU5SFBG.js → [id]-4IWSF6TW.js} +137 -204
  5. package/dist/{[id]-BPQNQFVE.js → [id]-AMZFAAJ3.js} +75 -124
  6. package/dist/[id]-C3TB6V2O.js +286 -0
  7. package/dist/{[id]-NGRV5I2A.js → [id]-HEDNHQ5Z.js} +8 -6
  8. package/dist/[id]-KFACDZAI.js +949 -0
  9. package/dist/{[id]-BHU5BSQT.js → [id]-KFRGBNLH.js} +19 -16
  10. package/dist/{[id]-OE5TUWNF.js → [id]-OVWD6DNG.js} +8 -6
  11. package/dist/{[id]-RJRAZN3T.js → [id]-PJ2K4O3C.js} +7 -5
  12. package/dist/{[id]-ZD5HBP2R.js → [id]-ROMWNPJA.js} +13 -10
  13. package/dist/[id]-UPNI3OCU.js +697 -0
  14. package/dist/{[id]-YB3DBBXT.js → [id]-YFLQXZGC.js} +12 -9
  15. package/dist/{[province_id]-CUWKNPBW.js → [province_id]-IM22PLJP.js} +8 -6
  16. package/dist/{add-YEUSE5QA.js → add-AUSWWCA3.js} +9 -7
  17. package/dist/{add-MYV5IOGP.js → add-MBCWT6XT.js} +157 -227
  18. package/dist/{add-customer-groups-Q3F357F2.js → add-customer-groups-3FD754Z2.js} +7 -5
  19. package/dist/{add-products-WVNYODC6.js → add-products-IS22SHHN.js} +12 -9
  20. package/dist/{add-promotions-F62YE3BE.js → add-promotions-VDD5PKMN.js} +27 -9
  21. package/dist/{add-to-campaign-WBSCTSKW.js → add-to-campaign-B3PGGNFA.js} +3 -2
  22. package/dist/{address-ZMZ4ST5T.js → address-7HSQSXUS.js} +6 -4
  23. package/dist/{adjust-inventory-QUGKDXOC.js → adjust-inventory-2OKDFVLK.js} +2 -3
  24. package/dist/{allocate-items-7NSBGXSF.js → allocate-items-QAYROQMK.js} +4 -2
  25. package/dist/{areas-EJCZBY2E.js → areas-WQ44GWQO.js} +2 -2
  26. package/dist/{breadcrumb-M657ZCG6.js → breadcrumb-4I7MU2QY.js} +1 -1
  27. package/dist/{breadcrumb-KNBZ3JNR.js → breadcrumb-7ZFC43R4.js} +1 -1
  28. package/dist/{breadcrumb-C7M5PG2Q.js → breadcrumb-IDLCUHX3.js} +6 -4
  29. package/dist/{breadcrumb-MXYWEBK6.js → breadcrumb-OXRGEOVL.js} +6 -4
  30. package/dist/{breadcrumb-JWFTKHLE.js → breadcrumb-RQ52GELM.js} +2 -1
  31. package/dist/{breadcrumb-QPV566YX.js → breadcrumb-UDSK4EUS.js} +7 -5
  32. package/dist/breadcrumb-XCPUUZUO.js +26 -0
  33. package/dist/{campaigns-BPLAE6QQ.js → campaigns-LIPKZKI7.js} +5 -4
  34. package/dist/{categories-H2XAJCGC.js → categories-D2U6VLH5.js} +2 -2
  35. package/dist/{chunk-4RVWITM2.js → chunk-3JWHERV7.js} +76 -23
  36. package/dist/{chunk-BCXREBMV.js → chunk-4ATO577Q.js} +1 -1
  37. package/dist/{chunk-VHFKJLDH.js → chunk-4JVORTN4.js} +1 -1
  38. package/dist/{chunk-HHD2VUED.js → chunk-4UKAKFKL.js} +1 -1
  39. package/dist/{chunk-3L7WHWKB.js → chunk-5DRYAIOY.js} +3 -3
  40. package/dist/{chunk-7TIZP4YG.js → chunk-5RWK4U4V.js} +26 -0
  41. package/dist/{chunk-UEKRQS5Q.js → chunk-6ECHPZS3.js} +2 -2
  42. package/dist/{chunk-IWAL74YU.js → chunk-6GQLSWOO.js} +1 -1
  43. package/dist/{chunk-HCUIYIIY.js → chunk-6OZQTHCR.js} +1 -1
  44. package/dist/chunk-6XMUN2BZ.js +0 -0
  45. package/dist/{chunk-RLRWDHME.js → chunk-6YQR2AWM.js} +3 -20
  46. package/dist/{chunk-26OOAKQ6.js → chunk-7H6NMQ6U.js} +8 -1
  47. package/dist/{chunk-SVYBMLVN.js → chunk-7J2QRH4V.js} +1 -1
  48. package/dist/chunk-7LIENHWP.js +26 -0
  49. package/dist/{chunk-EPSRO7C5.js → chunk-7LIT4GXO.js} +2 -2
  50. package/dist/chunk-7POOMBIN.js +108 -0
  51. package/dist/{chunk-SDFZUBS3.js → chunk-CDZALZ5E.js} +1 -1
  52. package/dist/{chunk-72HQFLZI.js → chunk-CSEB2RNO.js} +1 -1
  53. package/dist/{chunk-X6ZQMFCT.js → chunk-DAOSTHVB.js} +44 -25
  54. package/dist/chunk-FKKI62AC.js +282 -0
  55. package/dist/{chunk-VBKW4GWP.js → chunk-FPBXQIFJ.js} +1 -1
  56. package/dist/{chunk-SI55QRZ4.js → chunk-G5NNOOHR.js} +59 -6
  57. package/dist/chunk-G6J5ZKM3.js +31 -0
  58. package/dist/{chunk-U5V6HNVW.js → chunk-GL3XVUAY.js} +1 -1
  59. package/dist/{chunk-RJE4MAYB.js → chunk-GYLRZXWS.js} +1 -1
  60. package/dist/{chunk-3XW55FZY.js → chunk-IYQHEISY.js} +6 -6
  61. package/dist/chunk-IZI2PKL7.js +27 -0
  62. package/dist/chunk-JN6MHI6V.js +334 -0
  63. package/dist/{chunk-YUQA6TUA.js → chunk-JOCO7JOB.js} +3 -3
  64. package/dist/{chunk-OGUTFP6B.js → chunk-JYUHDM23.js} +13 -51
  65. package/dist/{chunk-QB7BI4B7.js → chunk-K2DXXPNA.js} +153 -86
  66. package/dist/{chunk-XG76XXM2.js → chunk-KKMA6VPG.js} +1 -1
  67. package/dist/chunk-KVAD5JGS.js +11 -0
  68. package/dist/{chunk-YRZ53SAN.js → chunk-L26J5MO2.js} +2 -2
  69. package/dist/{chunk-FEVCBT24.js → chunk-LOSVZJXS.js} +2 -2
  70. package/dist/{chunk-63XYNXUL.js → chunk-LYP7XK5O.js} +1 -1
  71. package/dist/chunk-MVVFD2JT.js +51 -0
  72. package/dist/{chunk-RVFPWOR2.js → chunk-MY5H7C3A.js} +2 -2
  73. package/dist/{chunk-GTNCNKTC.js → chunk-NP5TISFX.js} +1 -1
  74. package/dist/{chunk-3GSR455R.js → chunk-NQMHP2LC.js} +1 -1
  75. package/dist/{chunk-2S2WK2OG.js → chunk-NV2RZAHW.js} +1 -10
  76. package/dist/{chunk-4IIATKG7.js → chunk-O7OWHKWA.js} +6 -6
  77. package/dist/{chunk-GIKVFOQL.js → chunk-OJCMHDZI.js} +2 -2
  78. package/dist/chunk-QLOJNFUE.js +53 -0
  79. package/dist/{chunk-OKJHUQBY.js → chunk-QSS7ATY3.js} +15 -27
  80. package/dist/{chunk-XVBONKRV.js → chunk-RCMKDW6O.js} +1 -1
  81. package/dist/{chunk-WJF24CGA.js → chunk-RDLVH6CM.js} +33 -5
  82. package/dist/chunk-SF5N2HX4.js +268 -0
  83. package/dist/{chunk-MQR26KYT.js → chunk-SYHA2RVL.js} +1 -1
  84. package/dist/{chunk-ZXDMPIXN.js → chunk-U3OEGBHH.js} +2 -2
  85. package/dist/{chunk-EJBOBB4B.js → chunk-V3N2Y4OL.js} +46 -46
  86. package/dist/{chunk-UUBGLS7U.js → chunk-V43BEBDT.js} +187 -35
  87. package/dist/{chunk-VBRTC2VU.js → chunk-VAFGNDAP.js} +4 -3
  88. package/dist/{chunk-4UQMRTSC.js → chunk-VH3TGSWE.js} +46 -2
  89. package/dist/{chunk-ZEKV7LGF.js → chunk-VV2K3EBF.js} +1 -1
  90. package/dist/{chunk-S2VYK3YC.js → chunk-WI2ZAFZF.js} +1 -1
  91. package/dist/chunk-WP3B4NEU.js +32 -0
  92. package/dist/{chunk-DY3XQPHC.js → chunk-WW2XYOHJ.js} +5 -3
  93. package/dist/{chunk-IVYIMGQC.js → chunk-X44P463Q.js} +45 -10
  94. package/dist/{chunk-R5KN6IFB.js → chunk-XHWBTV72.js} +2 -2
  95. package/dist/{chunk-OVHIUZ3K.js → chunk-XQ47NZJC.js} +1 -1
  96. package/dist/{chunk-LN7XHEPJ.js → chunk-YT4RAUWM.js} +2 -2
  97. package/dist/{chunk-6VKJM537.js → chunk-ZK4DIDXG.js} +1 -1
  98. package/dist/{collections-52DJLHWW.js → collections-3MEKABDT.js} +13 -12
  99. package/dist/{configuration-UMRBE5RQ.js → configuration-QK2FW2CV.js} +2 -2
  100. package/dist/{configuration-QEDVL2WF.js → configuration-RYH3VUBV.js} +15 -48
  101. package/dist/{create-ALUKAFJS.js → create-5M66YUYY.js} +2 -2
  102. package/dist/{create-ABRPUMHQ.js → create-75C65ZIS.js} +6 -5
  103. package/dist/{create-6IRD2CVC.js → create-A3CQXIRQ.js} +11 -9
  104. package/dist/{create-LYNWCP2N.js → create-GYNDVCY2.js} +5 -4
  105. package/dist/create-ICCAEOSA.js +343 -0
  106. package/dist/{create-5RQ32XPT.js → create-KBDT33O2.js} +287 -287
  107. package/dist/{create-GEYXN6SW.js → create-L5HMOVY5.js} +6 -4
  108. package/dist/{create-MFGMTZ5A.js → create-M2W5N6QV.js} +7 -5
  109. package/dist/{create-NTZH45DW.js → create-NSJGRO4L.js} +13 -11
  110. package/dist/{create-H77ZUZG5.js → create-O4K6TO4G.js} +9 -7
  111. package/dist/{create-S7VYYTUD.js → create-PW5L3MJI.js} +9 -7
  112. package/dist/{create-7SJ5DSQK.js → create-UQ26QTPQ.js} +19 -16
  113. package/dist/{create-2I3GAX4C.js → create-WIGBFSRH.js} +15 -6
  114. package/dist/{create-7FT7N2NH.js → create-WPN3OUJU.js} +3 -2
  115. package/dist/{create-G76MVCJU.js → create-ZVGYET6W.js} +5 -4
  116. package/dist/customer-availability-VAOKKCTK.js +164 -0
  117. package/dist/{customer-group-add-customers-T7OYWJCB.js → customer-group-add-customers-BSMUKWVO.js} +1 -1
  118. package/dist/{customer-group-detail-E7HRZ3LE.js → customer-group-detail-QCPC2YWK.js} +2 -2
  119. package/dist/{customer-groups-26HJ55MF.js → customer-groups-6WGUNFHG.js} +2 -2
  120. package/dist/{customers-EXFRZX5F.js → customers-7OGYQSGA.js} +2 -2
  121. package/dist/edit-2BKYNGYL.js +262 -0
  122. package/dist/{edit-M4AP65HO.js → edit-32ZGQUWZ.js} +7 -5
  123. package/dist/{edit-MPOTIGUY.js → edit-3OXHBHY4.js} +22 -38
  124. package/dist/{edit-2RN3OT27.js → edit-7T2JMZG3.js} +7 -56
  125. package/dist/{edit-6VJWRZHQ.js → edit-AFWQY3BZ.js} +6 -4
  126. package/dist/{edit-NB5VN2E4.js → edit-EDXF3T7F.js} +4 -3
  127. package/dist/edit-GJCXPD5A.js +81 -0
  128. package/dist/{edit-WHGYNDEB.js → edit-KOLDPZ4H.js} +19 -16
  129. package/dist/{edit-TIBQEQVV.js → edit-LZFD3RSY.js} +9 -7
  130. package/dist/{edit-QBUYHSE7.js → edit-QVK3BEPA.js} +7 -5
  131. package/dist/{edit-EGBVEWXS.js → edit-ZLZR7F33.js} +8 -6
  132. package/dist/{edit-H5FJ45ZT.js → edit-ZM7NJVRE.js} +1 -1
  133. package/dist/{edit-budget-PYPHUJPW.js → edit-budget-MOZETGZV.js} +1 -1
  134. package/dist/{edit-inventory-item-BCVECCLT.js → edit-inventory-item-HFGHS732.js} +17 -14
  135. package/dist/{edit-inventory-item-attributes-GWEMP67O.js → edit-inventory-item-attributes-5ORZJF4I.js} +18 -1
  136. package/dist/edit-reservation-LSYQUDYQ.js +294 -0
  137. package/dist/extension-targets.d.ts +6 -3
  138. package/dist/{fulfillment-HDU7GATG.js → fulfillment-TVRF5TID.js} +6 -4
  139. package/dist/{fulfillment-providers-6RZNNT7U.js → fulfillment-providers-TEV23LGB.js} +11 -10
  140. package/dist/index.css +14 -14
  141. package/dist/index.js +252 -146
  142. package/dist/{inventory-XJ2E6DPC.js → inventory-CMIRAJJY.js} +2 -2
  143. package/dist/{invite-755AJC3M.js → invite-K3R2GRYF.js} +6 -4
  144. package/dist/{invite-FD2TXZTW.js → invite-ZMIYLOWJ.js} +9 -7
  145. package/dist/{login-UGKYRKMD.js → login-LG3XH6B2.js} +8 -6
  146. package/dist/{manage-locations-PRQI5TI4.js → manage-locations-5B4HP6NQ.js} +24 -5
  147. package/dist/{media-TGFAHFBV.js → media-DY2XDZYT.js} +7 -5
  148. package/dist/{media-2KEHXPRU.js → media-OGO6M3CP.js} +10 -8
  149. package/dist/{metadata-BQQFHVKF.js → metadata-AW5Y72BI.js} +6 -4
  150. package/dist/metadata-HS6CLO4Z.js +69 -0
  151. package/dist/{metadata-5TVRCKWX.js → metadata-HXXVD3VP.js} +6 -4
  152. package/dist/{metadata-7JWZ4VFM.js → metadata-TXNUZBPX.js} +6 -4
  153. package/dist/{metadata-G73TILNE.js → metadata-UVOHT2VF.js} +6 -4
  154. package/dist/{metadata-4ZZ4ZIWJ.js → metadata-ZBSZL74N.js} +6 -4
  155. package/dist/{offer-create-page-PPXRYET4.js → offer-create-page-53P65U2V.js} +11 -8
  156. package/dist/{offer-detail-page-BFGKAS4L.js → offer-detail-page-BGFLDXO7.js} +1 -1
  157. package/dist/{offer-variant-detail-page-BLHRF4MK.js → offer-variant-detail-page-DCTRZUTM.js} +1 -1
  158. package/dist/{offers-7I67VSHI.js → offers-5776XUH5.js} +13 -9
  159. package/dist/{onboarding-7MURQYXX.js → onboarding-ROLIHG3L.js} +6 -4
  160. package/dist/{orders-D7NZNDUS.js → orders-VA3HNJAY.js} +12 -11
  161. package/dist/{organization-T6ZTYMMW.js → organization-UH4IUA62.js} +8 -6
  162. package/dist/pages/index.d.ts +9 -1
  163. package/dist/pages/index.js +53 -44
  164. package/dist/{payment-details-UQ65D5AY.js → payment-details-CD4GZEUL.js} +6 -4
  165. package/dist/{payouts-A336D2HG.js → payouts-26ZOYDRP.js} +2 -2
  166. package/dist/{price-lists-3WRT4TR2.js → price-lists-U5ASDHMI.js} +5 -8
  167. package/dist/{pricing-CPPIL627.js → pricing-SWUZSQL3.js} +8 -6
  168. package/dist/{product-tags-7DTA73YT.js → product-tags-4V65LOJJ.js} +19 -16
  169. package/dist/{product-types-OB26NF2D.js → product-types-CMI33S32.js} +3 -4
  170. package/dist/{product-variant-detail-4DDE6RJ5.js → product-variant-detail-NW3LQZE7.js} +6 -4
  171. package/dist/{product-variant-edit-SAZUI4E3.js → product-variant-edit-MNYFEZND.js} +9 -7
  172. package/dist/{products-RYXTZFGT.js → products-L2H6HOL2.js} +18 -15
  173. package/dist/{products-GJ2KTGBZ.js → products-YIF6FPBO.js} +12 -9
  174. package/dist/{professional-details-UN5B4YDJ.js → professional-details-QO5BWMRD.js} +6 -4
  175. package/dist/{profile-6MIDTK52.js → profile-2KKBVKAL.js} +6 -4
  176. package/dist/{promotions-SQ47TCZL.js → promotions-C5YWXVP5.js} +5 -5
  177. package/dist/{receive-ZG6FFN7H.js → receive-RRZK3FP2.js} +4 -3
  178. package/dist/{refund-KJX74N6T.js → refund-FLCZAMPR.js} +3 -2
  179. package/dist/{register-RDSK4E4D.js → register-SZ2T6QQA.js} +8 -6
  180. package/dist/reservations-C326XEVA.js +350 -0
  181. package/dist/{reset-password-C462PDN2.js → reset-password-H66R27K4.js} +1 -1
  182. package/dist/respond-IPRDCH57.js +132 -0
  183. package/dist/{return-reasons-MY63HNF6.js → return-reasons-2BUKIQBO.js} +9 -7
  184. package/dist/reviews-LBLCFBRQ.js +14 -0
  185. package/dist/{settings-TJ6HPHMK.js → settings-THSRJ5WS.js} +26 -23
  186. package/dist/{shipment-6CTA2GHU.js → shipment-X2WWJ3AE.js} +6 -4
  187. package/dist/{shipping-profile-CFISOMTE.js → shipping-profile-7P3RPEIJ.js} +1 -1
  188. package/dist/{shipping-profiles-5UAZNYKJ.js → shipping-profiles-JPBRRMPD.js} +8 -6
  189. package/dist/{stock-465GEUY3.js → stock-UMESDWV5.js} +21 -7
  190. package/dist/{store-2PQB2XWE.js → store-5YMOSKVT.js} +7 -5
  191. package/dist/{store-closure-DYW54VHB.js → store-closure-EPGDOV7U.js} +6 -4
  192. package/dist/{store-select-6A5YR7WH.js → store-select-JEEV4V57.js} +7 -5
  193. package/dist/{team-GXEBC57M.js → team-R6ARMF73.js} +9 -7
  194. package/package.json +12 -9
  195. package/dist/[id]-HEVGSOAV.js +0 -598
  196. package/dist/[id]-MU7A6SZO.js +0 -526
  197. package/dist/chunk-2ZFELO2L.js +0 -13
  198. package/dist/chunk-6IJMSVC6.js +0 -16
  199. package/dist/chunk-BNOKKKUU.js +0 -88
  200. package/dist/chunk-BX3JE7IE.js +0 -247
  201. package/dist/edit-4B364HGZ.js +0 -222
  202. package/dist/edit-SQU5UOGE.js +0 -105
  203. package/dist/{[location_id]-OXNC5E4F.js → [location_id]-IGPM7LDR.js} +1 -1
  204. package/dist/{chunk-CYE7HVAV.js → chunk-SCJBJQCL.js} +3 -3
@@ -1,598 +0,0 @@
1
- import {
2
- INVENTORY_DETAIL_FIELDS
3
- } from "./chunk-ZEKV7LGF.js";
4
- import {
5
- getFormattedCountry
6
- } from "./chunk-W6Y3PPU5.js";
7
- import "./chunk-JRTZWK77.js";
8
- import {
9
- PlaceholderCell
10
- } from "./chunk-PHOCVOZ5.js";
11
- import {
12
- SectionRow
13
- } from "./chunk-4TLP3TAA.js";
14
- import {
15
- TwoColumnPage
16
- } from "./chunk-YV6MK4PZ.js";
17
- import "./chunk-FQERBIVS.js";
18
- import {
19
- _DataTable,
20
- useDataTable
21
- } from "./chunk-IWAL74YU.js";
22
- import "./chunk-YN3FGNJM.js";
23
- import "./chunk-KCHYLLVG.js";
24
- import "./chunk-3EF54XFY.js";
25
- import {
26
- useQueryParams
27
- } from "./chunk-THHRRYRS.js";
28
- import "./chunk-LRD242C7.js";
29
- import {
30
- Thumbnail
31
- } from "./chunk-WIYFXWRI.js";
32
- import {
33
- TwoColumnPageSkeleton
34
- } from "./chunk-INNFZYX2.js";
35
- import {
36
- ActionMenu
37
- } from "./chunk-BDGZ4EQO.js";
38
- import "./chunk-LAVHRER2.js";
39
- import "./chunk-QHQWEERJ.js";
40
- import "./chunk-Y7QKP6QU.js";
41
- import {
42
- inventoryItemsQueryKeys,
43
- useDeleteInventoryItemLevel,
44
- useInventoryItem,
45
- useInventoryItemLevels
46
- } from "./chunk-EMUCGKHP.js";
47
- import "./chunk-A5DJIOHN.js";
48
- import {
49
- queryClient
50
- } from "./chunk-RHKRREUU.js";
51
- import "./chunk-ZA2KFUFR.js";
52
- import {
53
- fetchQuery
54
- } from "./chunk-DTGEFKK4.js";
55
- import "./chunk-NBMM2TZK.js";
56
-
57
- // src/pages/inventory/[id]/loader.tsx
58
- import { getLinkQuery } from "@mercurjs/dashboard-shared";
59
- var inventoryDetailQuery = (id) => {
60
- const query = getLinkQuery("inventory_item", INVENTORY_DETAIL_FIELDS);
61
- return {
62
- queryKey: inventoryItemsQueryKeys.detail(id, query),
63
- queryFn: async () => fetchQuery(
64
- `/vendor/inventory-items/${id}?fields=${query.fields}`,
65
- { method: "GET" }
66
- )
67
- };
68
- };
69
- var loader = async ({ params }) => {
70
- const id = params.id;
71
- const query = inventoryDetailQuery(id);
72
- return queryClient.ensureQueryData(query);
73
- };
74
-
75
- // src/pages/inventory/[id]/inventory-detail-page.tsx
76
- import { Children } from "react";
77
- import { useLoaderData, useParams } from "react-router-dom";
78
- import { useLinkQuery, WidgetZone } from "@mercurjs/dashboard-shared";
79
-
80
- // src/pages/inventory/[id]/_components/inventory-item-attributes/attributes-section.tsx
81
- import { Container, Heading } from "@medusajs/ui";
82
- import { DisplayExtensionZone } from "@mercurjs/dashboard-shared";
83
- import { PencilSquare } from "@medusajs/icons";
84
- import { useTranslation } from "react-i18next";
85
- import { jsx, jsxs } from "react/jsx-runtime";
86
- var InventoryItemAttributeSection = ({
87
- inventoryItem
88
- }) => {
89
- const { t } = useTranslation();
90
- return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
91
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
92
- /* @__PURE__ */ jsx(Heading, { level: "h2", children: t("products.attributes") }),
93
- /* @__PURE__ */ jsx(
94
- ActionMenu,
95
- {
96
- groups: [
97
- {
98
- actions: [
99
- {
100
- label: t("actions.edit"),
101
- to: "attributes",
102
- icon: /* @__PURE__ */ jsx(PencilSquare, {})
103
- }
104
- ]
105
- }
106
- ]
107
- }
108
- )
109
- ] }),
110
- /* @__PURE__ */ jsx(SectionRow, { title: t("fields.height"), value: inventoryItem.height }),
111
- /* @__PURE__ */ jsx(SectionRow, { title: t("fields.width"), value: inventoryItem.width }),
112
- /* @__PURE__ */ jsx(SectionRow, { title: t("fields.length"), value: inventoryItem.length }),
113
- /* @__PURE__ */ jsx(SectionRow, { title: t("fields.weight"), value: inventoryItem.weight }),
114
- /* @__PURE__ */ jsx(SectionRow, { title: t("fields.midCode"), value: inventoryItem.mid_code }),
115
- /* @__PURE__ */ jsx(SectionRow, { title: t("fields.hsCode"), value: inventoryItem.hs_code }),
116
- /* @__PURE__ */ jsx(
117
- SectionRow,
118
- {
119
- title: t("fields.countryOfOrigin"),
120
- value: getFormattedCountry(inventoryItem.origin_country)
121
- }
122
- ),
123
- /* @__PURE__ */ jsx(
124
- DisplayExtensionZone,
125
- {
126
- model: "inventory_item",
127
- zone: "attributes",
128
- data: inventoryItem
129
- }
130
- )
131
- ] });
132
- };
133
-
134
- // src/pages/inventory/[id]/_components/inventory-item-general-section.tsx
135
- import { Container as Container2, Heading as Heading2 } from "@medusajs/ui";
136
- import { PencilSquare as PencilSquare2 } from "@medusajs/icons";
137
- import { useTranslation as useTranslation2 } from "react-i18next";
138
- import { DisplayExtensionZone as DisplayExtensionZone2, DisplayField } from "@mercurjs/dashboard-shared";
139
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
140
- var GENERAL_FIELD_IDS = ["title", "sku", "in_stock", "reserved", "available"];
141
- var InventoryItemGeneralSection = ({
142
- inventoryItem
143
- }) => {
144
- const { t } = useTranslation2();
145
- const stockedQuantity = inventoryItem.location_levels?.reduce(
146
- (acc, level) => acc + level.stocked_quantity,
147
- 0
148
- ) || 0;
149
- const reservedQuantity = inventoryItem.location_levels?.reduce(
150
- (acc, level) => acc + level.reserved_quantity,
151
- 0
152
- ) || 0;
153
- const availableQuantity = stockedQuantity - reservedQuantity;
154
- return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", children: [
155
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
156
- /* @__PURE__ */ jsx2(
157
- DisplayField,
158
- {
159
- model: "inventory_item",
160
- zone: "general",
161
- id: "title",
162
- data: inventoryItem,
163
- children: /* @__PURE__ */ jsxs2(Heading2, { children: [
164
- inventoryItem.title ?? inventoryItem.sku,
165
- " ",
166
- t("fields.details")
167
- ] })
168
- }
169
- ),
170
- /* @__PURE__ */ jsx2(
171
- ActionMenu,
172
- {
173
- groups: [
174
- {
175
- actions: [
176
- {
177
- icon: /* @__PURE__ */ jsx2(PencilSquare2, {}),
178
- label: t("actions.edit"),
179
- to: "edit"
180
- }
181
- ]
182
- }
183
- ]
184
- }
185
- )
186
- ] }),
187
- /* @__PURE__ */ jsx2(
188
- DisplayField,
189
- {
190
- model: "inventory_item",
191
- zone: "general",
192
- id: "sku",
193
- data: inventoryItem,
194
- children: /* @__PURE__ */ jsx2(SectionRow, { title: t("fields.sku"), value: inventoryItem.sku ?? "-" })
195
- }
196
- ),
197
- /* @__PURE__ */ jsx2(
198
- DisplayField,
199
- {
200
- model: "inventory_item",
201
- zone: "general",
202
- id: "in_stock",
203
- data: inventoryItem,
204
- children: /* @__PURE__ */ jsx2(
205
- SectionRow,
206
- {
207
- title: t("fields.inStock"),
208
- value: getQuantityFormat(
209
- stockedQuantity,
210
- inventoryItem.location_levels?.length
211
- )
212
- }
213
- )
214
- }
215
- ),
216
- /* @__PURE__ */ jsx2(
217
- DisplayField,
218
- {
219
- model: "inventory_item",
220
- zone: "general",
221
- id: "reserved",
222
- data: inventoryItem,
223
- children: /* @__PURE__ */ jsx2(
224
- SectionRow,
225
- {
226
- title: t("inventory.reserved"),
227
- value: getQuantityFormat(
228
- reservedQuantity,
229
- inventoryItem.location_levels?.length
230
- )
231
- }
232
- )
233
- }
234
- ),
235
- /* @__PURE__ */ jsx2(
236
- DisplayField,
237
- {
238
- model: "inventory_item",
239
- zone: "general",
240
- id: "available",
241
- data: inventoryItem,
242
- children: /* @__PURE__ */ jsx2(
243
- SectionRow,
244
- {
245
- title: t("inventory.available"),
246
- value: getQuantityFormat(
247
- availableQuantity,
248
- inventoryItem.location_levels?.length
249
- )
250
- }
251
- )
252
- }
253
- ),
254
- /* @__PURE__ */ jsx2(
255
- DisplayExtensionZone2,
256
- {
257
- model: "inventory_item",
258
- zone: "general",
259
- data: inventoryItem,
260
- builtInFieldIds: GENERAL_FIELD_IDS
261
- }
262
- )
263
- ] });
264
- };
265
- var getQuantityFormat = (quantity, locations) => {
266
- if (quantity !== void 0 && !isNaN(quantity)) {
267
- return `${quantity} across ${locations ?? "-"} locations`;
268
- }
269
- return "-";
270
- };
271
-
272
- // src/pages/inventory/[id]/_components/inventory-item-location-levels.tsx
273
- import { Button, Container as Container3, Heading as Heading3 } from "@medusajs/ui";
274
- import { useTranslation as useTranslation5 } from "react-i18next";
275
- import { Link } from "react-router-dom";
276
- import { DisplayExtensionZone as DisplayExtensionZone3 } from "@mercurjs/dashboard-shared";
277
-
278
- // src/pages/inventory/[id]/_components/location-levels-table/use-location-list-table-columns.tsx
279
- import { createColumnHelper } from "@tanstack/react-table";
280
- import { useMemo } from "react";
281
- import { useTranslation as useTranslation4 } from "react-i18next";
282
-
283
- // src/pages/inventory/[id]/_components/location-levels-table/location-actions.tsx
284
- import { PencilSquare as PencilSquare3, Trash } from "@medusajs/icons";
285
- import { usePrompt } from "@medusajs/ui";
286
- import { useTranslation as useTranslation3 } from "react-i18next";
287
- import { jsx as jsx3 } from "react/jsx-runtime";
288
- var LocationActions = ({
289
- level
290
- }) => {
291
- const { t } = useTranslation3();
292
- const prompt = usePrompt();
293
- const { mutateAsync } = useDeleteInventoryItemLevel(
294
- level.inventory_item_id,
295
- level.location_id
296
- );
297
- const handleDelete = async () => {
298
- const res = await prompt({
299
- title: t("general.areYouSure"),
300
- description: t("inventory.deleteWarning"),
301
- confirmText: t("actions.delete"),
302
- cancelText: t("actions.cancel")
303
- });
304
- if (!res) {
305
- return;
306
- }
307
- await mutateAsync();
308
- };
309
- return /* @__PURE__ */ jsx3(
310
- ActionMenu,
311
- {
312
- groups: [
313
- {
314
- actions: [
315
- {
316
- icon: /* @__PURE__ */ jsx3(PencilSquare3, {}),
317
- label: t("actions.edit"),
318
- to: `locations/${level.location_id}`
319
- }
320
- ]
321
- },
322
- {
323
- actions: [
324
- {
325
- icon: /* @__PURE__ */ jsx3(Trash, {}),
326
- label: t("actions.delete"),
327
- onClick: handleDelete,
328
- disabled: level.reserved_quantity > 0 || level.stocked_quantity > 0
329
- }
330
- ]
331
- }
332
- ]
333
- }
334
- );
335
- };
336
-
337
- // src/pages/inventory/[id]/_components/location-levels-table/use-location-list-table-columns.tsx
338
- import { jsx as jsx4 } from "react/jsx-runtime";
339
- var columnHelper = createColumnHelper();
340
- var useLocationListTableColumns = () => {
341
- const { t } = useTranslation4();
342
- return useMemo(
343
- () => [
344
- columnHelper.display({
345
- id: "location",
346
- header: t("fields.location"),
347
- cell: ({ row }) => {
348
- const locationName = row.original.stock_locations?.map((location) => location.name).join(", ");
349
- if (!locationName) {
350
- return /* @__PURE__ */ jsx4(PlaceholderCell, {});
351
- }
352
- return /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: locationName.toString() }) });
353
- }
354
- }),
355
- columnHelper.accessor("reserved_quantity", {
356
- header: t("inventory.reserved"),
357
- cell: ({ getValue }) => {
358
- const quantity = getValue();
359
- if (Number.isNaN(quantity)) {
360
- return /* @__PURE__ */ jsx4(PlaceholderCell, {});
361
- }
362
- return /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: quantity }) });
363
- }
364
- }),
365
- columnHelper.accessor("stocked_quantity", {
366
- header: t("fields.inStock"),
367
- cell: ({ getValue }) => {
368
- const stockedQuantity = getValue();
369
- if (Number.isNaN(stockedQuantity)) {
370
- return /* @__PURE__ */ jsx4(PlaceholderCell, {});
371
- }
372
- return /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: stockedQuantity }) });
373
- }
374
- }),
375
- columnHelper.accessor("available_quantity", {
376
- header: t("inventory.available"),
377
- cell: ({ getValue }) => {
378
- const availableQuantity = getValue();
379
- if (Number.isNaN(availableQuantity)) {
380
- return /* @__PURE__ */ jsx4(PlaceholderCell, {});
381
- }
382
- return /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: availableQuantity }) });
383
- }
384
- }),
385
- columnHelper.display({
386
- id: "actions",
387
- cell: ({ row }) => /* @__PURE__ */ jsx4(LocationActions, { level: row.original })
388
- })
389
- ],
390
- [t]
391
- );
392
- };
393
-
394
- // src/pages/inventory/[id]/_components/location-levels-table/use-location-list-table-query.tsx
395
- var useLocationLevelTableQuery = ({
396
- pageSize = 20,
397
- prefix
398
- }) => {
399
- const raw = useQueryParams(
400
- [
401
- "id",
402
- "location_id",
403
- "stocked_quantity",
404
- "reserved_quantity",
405
- "incoming_quantity",
406
- "available_quantity",
407
- "*stock_locations"
408
- ],
409
- prefix
410
- );
411
- const { reserved_quantity, stocked_quantity, available_quantity, ...params } = raw;
412
- const searchParams = {
413
- limit: pageSize,
414
- reserved_quantity: reserved_quantity ? JSON.parse(reserved_quantity) : void 0,
415
- stocked_quantity: stocked_quantity ? JSON.parse(stocked_quantity) : void 0,
416
- available_quantity: available_quantity ? JSON.parse(available_quantity) : void 0,
417
- ...params
418
- };
419
- return {
420
- searchParams,
421
- raw
422
- };
423
- };
424
-
425
- // src/pages/inventory/[id]/_components/location-levels-table/location-list-table.tsx
426
- import { jsx as jsx5 } from "react/jsx-runtime";
427
- var PAGE_SIZE = 20;
428
- var ItemLocationListTable = ({
429
- inventory_item_id
430
- }) => {
431
- const { searchParams, raw } = useLocationLevelTableQuery({
432
- pageSize: PAGE_SIZE
433
- });
434
- const { inventory_levels, count, isLoading } = useInventoryItemLevels(
435
- inventory_item_id,
436
- {
437
- ...searchParams,
438
- fields: "*stock_locations"
439
- }
440
- );
441
- const columns = useLocationListTableColumns();
442
- const filteredLocationLevels = inventory_levels?.filter(
443
- (level) => level.stock_locations.length > 0
444
- );
445
- const { table } = useDataTable({
446
- data: filteredLocationLevels ?? [],
447
- columns,
448
- count,
449
- enablePagination: true,
450
- getRowId: (row) => row.id,
451
- pageSize: PAGE_SIZE
452
- });
453
- return /* @__PURE__ */ jsx5(
454
- _DataTable,
455
- {
456
- table,
457
- columns,
458
- pageSize: PAGE_SIZE,
459
- count: filteredLocationLevels?.length,
460
- isLoading,
461
- pagination: true,
462
- queryObject: raw
463
- }
464
- );
465
- };
466
-
467
- // src/pages/inventory/[id]/_components/inventory-item-location-levels.tsx
468
- import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
469
- var InventoryItemLocationLevelsSection = ({
470
- inventoryItem
471
- }) => {
472
- const { t } = useTranslation5();
473
- return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", children: [
474
- /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
475
- /* @__PURE__ */ jsx6(Heading3, { children: t("inventory.locationLevels") }),
476
- /* @__PURE__ */ jsx6(Button, { size: "small", variant: "secondary", asChild: true, children: /* @__PURE__ */ jsx6(Link, { to: "locations", children: t("inventory.manageLocations") }) })
477
- ] }),
478
- /* @__PURE__ */ jsx6(ItemLocationListTable, { inventory_item_id: inventoryItem.id }),
479
- /* @__PURE__ */ jsx6(
480
- DisplayExtensionZone3,
481
- {
482
- model: "inventory_item",
483
- zone: "locations",
484
- data: inventoryItem
485
- }
486
- )
487
- ] });
488
- };
489
-
490
- // src/pages/inventory/[id]/_components/inventory-item-variants/variants-section.tsx
491
- import { TriangleRightMini } from "@medusajs/icons";
492
- import { Container as Container4, Heading as Heading4 } from "@medusajs/ui";
493
- import { useTranslation as useTranslation6 } from "react-i18next";
494
- import { Link as Link2 } from "react-router-dom";
495
- import { DisplayExtensionZone as DisplayExtensionZone4 } from "@mercurjs/dashboard-shared";
496
- import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
497
- var InventoryItemVariantsSection = ({
498
- variants
499
- }) => {
500
- const { t } = useTranslation6();
501
- if (!variants?.length) {
502
- return null;
503
- }
504
- return /* @__PURE__ */ jsxs4(Container4, { className: "p-0", children: [
505
- /* @__PURE__ */ jsx7("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx7(Heading4, { level: "h2", children: t("inventory.associatedVariants") }) }),
506
- /* @__PURE__ */ jsx7("div", { className: "txt-small flex flex-col gap-2 px-2 pb-2", children: variants.map((variant) => {
507
- const link = variant.product ? `/products/${variant.product.id}/variants/${variant.id}` : null;
508
- const Inner = /* @__PURE__ */ jsx7("div", { className: "shadow-elevation-card-rest bg-ui-bg-component rounded-md px-4 py-2 transition-colors", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-3", children: [
509
- /* @__PURE__ */ jsx7("div", { className: "shadow-elevation-card-rest rounded-md", children: /* @__PURE__ */ jsx7(Thumbnail, { src: variant.product?.thumbnail }) }),
510
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-1 flex-col", children: [
511
- /* @__PURE__ */ jsx7("span", { className: "text-ui-fg-base font-medium", children: variant.title }),
512
- /* @__PURE__ */ jsx7("span", { className: "text-ui-fg-subtle", children: variant.options.map((o) => o.value).join(" \u22C5 ") })
513
- ] }),
514
- /* @__PURE__ */ jsx7("div", { className: "size-7 flex items-center justify-center", children: /* @__PURE__ */ jsx7(TriangleRightMini, { className: "text-ui-fg-muted" }) })
515
- ] }) });
516
- if (!link) {
517
- return /* @__PURE__ */ jsx7("div", { children: Inner }, variant.id);
518
- }
519
- return /* @__PURE__ */ jsx7(
520
- Link2,
521
- {
522
- to: link,
523
- className: "outline-none focus-within:shadow-borders-interactive-with-focus rounded-md [&:hover>div]:bg-ui-bg-component-hover",
524
- children: Inner
525
- },
526
- variant.id
527
- );
528
- }) }),
529
- /* @__PURE__ */ jsx7(
530
- DisplayExtensionZone4,
531
- {
532
- model: "inventory_item",
533
- zone: "variants",
534
- data: variants
535
- }
536
- )
537
- ] });
538
- };
539
-
540
- // src/pages/inventory/[id]/inventory-detail-page.tsx
541
- import { Fragment, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
542
- var Root = ({ children }) => {
543
- const { id } = useParams();
544
- const initialData = useLoaderData();
545
- const { inventory_item, isPending: isLoading } = useInventoryItem(
546
- id,
547
- useLinkQuery("inventory_item", INVENTORY_DETAIL_FIELDS),
548
- { initialData }
549
- );
550
- if (isLoading || !inventory_item) {
551
- return /* @__PURE__ */ jsx8(
552
- TwoColumnPageSkeleton,
553
- {
554
- showJSON: true,
555
- mainSections: 3,
556
- sidebarSections: 2,
557
- showMetadata: true
558
- }
559
- );
560
- }
561
- return /* @__PURE__ */ jsx8(Fragment, { children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs5(TwoColumnPage, { data: inventory_item, children: [
562
- /* @__PURE__ */ jsx8(TwoColumnPage.Main, { children: /* @__PURE__ */ jsxs5(WidgetZone, { id: "inventory.detail.main", data: inventory_item, children: [
563
- /* @__PURE__ */ jsx8(InventoryItemGeneralSection, { inventoryItem: inventory_item }),
564
- /* @__PURE__ */ jsx8(
565
- InventoryItemLocationLevelsSection,
566
- {
567
- inventoryItem: inventory_item
568
- }
569
- )
570
- ] }) }),
571
- /* @__PURE__ */ jsx8(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsxs5(WidgetZone, { id: "inventory.detail.side", data: inventory_item, children: [
572
- /* @__PURE__ */ jsx8(
573
- InventoryItemVariantsSection,
574
- {
575
- variants: inventory_item.variants
576
- }
577
- ),
578
- /* @__PURE__ */ jsx8(
579
- InventoryItemAttributeSection,
580
- {
581
- inventoryItem: inventory_item
582
- }
583
- )
584
- ] }) })
585
- ] }) });
586
- };
587
- var InventoryDetailPage = Object.assign(Root, {
588
- Main: TwoColumnPage.Main,
589
- Sidebar: TwoColumnPage.Sidebar,
590
- MainGeneralSection: InventoryItemGeneralSection,
591
- MainLocationLevelsSection: InventoryItemLocationLevelsSection,
592
- SidebarVariantsSection: InventoryItemVariantsSection,
593
- SidebarAttributeSection: InventoryItemAttributeSection
594
- });
595
- export {
596
- InventoryDetailPage,
597
- loader
598
- };