@aglyn/plugins-commerce 1.0.0-beta.143

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 (417) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +10 -0
  3. package/package.json +57 -0
  4. package/src/index.d.ts +38 -0
  5. package/src/index.js +38 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/components/account.d.ts +31 -0
  8. package/src/lib/components/account.js +645 -0
  9. package/src/lib/components/account.js.map +1 -0
  10. package/src/lib/components/cart.d.ts +38 -0
  11. package/src/lib/components/cart.js +851 -0
  12. package/src/lib/components/cart.js.map +1 -0
  13. package/src/lib/components/commerce-console-page.d.ts +32 -0
  14. package/src/lib/components/commerce-console-page.js +296 -0
  15. package/src/lib/components/commerce-console-page.js.map +1 -0
  16. package/src/lib/components/commerce-console-sections.d.ts +34 -0
  17. package/src/lib/components/commerce-console-sections.js +62 -0
  18. package/src/lib/components/commerce-console-sections.js.map +1 -0
  19. package/src/lib/components/console/catalog-organization-card.component.d.ts +14 -0
  20. package/src/lib/components/console/catalog-organization-card.component.js +1087 -0
  21. package/src/lib/components/console/catalog-organization-card.component.js.map +1 -0
  22. package/src/lib/components/console/commerce-analytics-card.component.d.ts +27 -0
  23. package/src/lib/components/console/commerce-analytics-card.component.js +310 -0
  24. package/src/lib/components/console/commerce-analytics-card.component.js.map +1 -0
  25. package/src/lib/components/console/commerce-glance-card.component.d.ts +20 -0
  26. package/src/lib/components/console/commerce-glance-card.component.js +340 -0
  27. package/src/lib/components/console/commerce-glance-card.component.js.map +1 -0
  28. package/src/lib/components/console/commerce-stat-tile.component.d.ts +37 -0
  29. package/src/lib/components/console/commerce-stat-tile.component.js +72 -0
  30. package/src/lib/components/console/commerce-stat-tile.component.js.map +1 -0
  31. package/src/lib/components/console/discounts-card.component.d.ts +14 -0
  32. package/src/lib/components/console/discounts-card.component.js +443 -0
  33. package/src/lib/components/console/discounts-card.component.js.map +1 -0
  34. package/src/lib/components/console/entitlement-gate.component.d.ts +76 -0
  35. package/src/lib/components/console/entitlement-gate.component.js +115 -0
  36. package/src/lib/components/console/entitlement-gate.component.js.map +1 -0
  37. package/src/lib/components/console/gift-cards-card.component.d.ts +29 -0
  38. package/src/lib/components/console/gift-cards-card.component.js +379 -0
  39. package/src/lib/components/console/gift-cards-card.component.js.map +1 -0
  40. package/src/lib/components/console/host-coupons-card.component.d.ts +14 -0
  41. package/src/lib/components/console/host-coupons-card.component.js +252 -0
  42. package/src/lib/components/console/host-coupons-card.component.js.map +1 -0
  43. package/src/lib/components/console/host-orders-card.component.d.ts +13 -0
  44. package/src/lib/components/console/host-orders-card.component.js +861 -0
  45. package/src/lib/components/console/host-orders-card.component.js.map +1 -0
  46. package/src/lib/components/console/locations-card.component.d.ts +14 -0
  47. package/src/lib/components/console/locations-card.component.js +256 -0
  48. package/src/lib/components/console/locations-card.component.js.map +1 -0
  49. package/src/lib/components/console/member-posts-card.component.d.ts +8 -0
  50. package/src/lib/components/console/member-posts-card.component.js +283 -0
  51. package/src/lib/components/console/member-posts-card.component.js.map +1 -0
  52. package/src/lib/components/console/newest-site-users-card.component.d.ts +36 -0
  53. package/src/lib/components/console/newest-site-users-card.component.js +126 -0
  54. package/src/lib/components/console/newest-site-users-card.component.js.map +1 -0
  55. package/src/lib/components/console/order-detail-dialog.component.d.ts +28 -0
  56. package/src/lib/components/console/order-detail-dialog.component.js +976 -0
  57. package/src/lib/components/console/order-detail-dialog.component.js.map +1 -0
  58. package/src/lib/components/console/paid-media.d.ts +127 -0
  59. package/src/lib/components/console/paid-media.js +397 -0
  60. package/src/lib/components/console/paid-media.js.map +1 -0
  61. package/src/lib/components/console/payments-settings-card.component.d.ts +13 -0
  62. package/src/lib/components/console/payments-settings-card.component.js +295 -0
  63. package/src/lib/components/console/payments-settings-card.component.js.map +1 -0
  64. package/src/lib/components/console/pos-page.component.d.ts +13 -0
  65. package/src/lib/components/console/pos-page.component.js +916 -0
  66. package/src/lib/components/console/pos-page.component.js.map +1 -0
  67. package/src/lib/components/console/product-editor-dialog.component.d.ts +32 -0
  68. package/src/lib/components/console/product-editor-dialog.component.js +1374 -0
  69. package/src/lib/components/console/product-editor-dialog.component.js.map +1 -0
  70. package/src/lib/components/console/products-hub-card.component.d.ts +16 -0
  71. package/src/lib/components/console/products-hub-card.component.js +1280 -0
  72. package/src/lib/components/console/products-hub-card.component.js.map +1 -0
  73. package/src/lib/components/console/products-hub-zone.component.d.ts +50 -0
  74. package/src/lib/components/console/products-hub-zone.component.js +200 -0
  75. package/src/lib/components/console/products-hub-zone.component.js.map +1 -0
  76. package/src/lib/components/console/recovery-queue-card.component.d.ts +39 -0
  77. package/src/lib/components/console/recovery-queue-card.component.js +262 -0
  78. package/src/lib/components/console/recovery-queue-card.component.js.map +1 -0
  79. package/src/lib/components/console/registers-card.component.d.ts +21 -0
  80. package/src/lib/components/console/registers-card.component.js +296 -0
  81. package/src/lib/components/console/registers-card.component.js.map +1 -0
  82. package/src/lib/components/console/reservations-card.component.d.ts +14 -0
  83. package/src/lib/components/console/reservations-card.component.js +650 -0
  84. package/src/lib/components/console/reservations-card.component.js.map +1 -0
  85. package/src/lib/components/console/reviews-moderation-card.component.d.ts +8 -0
  86. package/src/lib/components/console/reviews-moderation-card.component.js +235 -0
  87. package/src/lib/components/console/reviews-moderation-card.component.js.map +1 -0
  88. package/src/lib/components/console/shipping-settings-card.component.d.ts +38 -0
  89. package/src/lib/components/console/shipping-settings-card.component.js +560 -0
  90. package/src/lib/components/console/shipping-settings-card.component.js.map +1 -0
  91. package/src/lib/components/console/stock-movements-card.component.d.ts +31 -0
  92. package/src/lib/components/console/stock-movements-card.component.js +333 -0
  93. package/src/lib/components/console/stock-movements-card.component.js.map +1 -0
  94. package/src/lib/components/console/store-settings-card.component.d.ts +14 -0
  95. package/src/lib/components/console/store-settings-card.component.js +300 -0
  96. package/src/lib/components/console/store-settings-card.component.js.map +1 -0
  97. package/src/lib/components/console/storefront-tax-summary-card.component.d.ts +73 -0
  98. package/src/lib/components/console/storefront-tax-summary-card.component.js +408 -0
  99. package/src/lib/components/console/storefront-tax-summary-card.component.js.map +1 -0
  100. package/src/lib/components/console/suppliers-card.component.d.ts +8 -0
  101. package/src/lib/components/console/suppliers-card.component.js +328 -0
  102. package/src/lib/components/console/suppliers-card.component.js.map +1 -0
  103. package/src/lib/components/console/tax-settings-card.component.d.ts +14 -0
  104. package/src/lib/components/console/tax-settings-card.component.js +473 -0
  105. package/src/lib/components/console/tax-settings-card.component.js.map +1 -0
  106. package/src/lib/components/gate.d.ts +39 -0
  107. package/src/lib/components/gate.js +202 -0
  108. package/src/lib/components/gate.js.map +1 -0
  109. package/src/lib/components/gated-video.d.ts +40 -0
  110. package/src/lib/components/gated-video.js +366 -0
  111. package/src/lib/components/gated-video.js.map +1 -0
  112. package/src/lib/components/member-feed.d.ts +32 -0
  113. package/src/lib/components/member-feed.js +198 -0
  114. package/src/lib/components/member-feed.js.map +1 -0
  115. package/src/lib/components/member-recovery.d.ts +35 -0
  116. package/src/lib/components/member-recovery.js +313 -0
  117. package/src/lib/components/member-recovery.js.map +1 -0
  118. package/src/lib/components/member-signin.d.ts +35 -0
  119. package/src/lib/components/member-signin.js +257 -0
  120. package/src/lib/components/member-signin.js.map +1 -0
  121. package/src/lib/components/member-signup.d.ts +34 -0
  122. package/src/lib/components/member-signup.js +287 -0
  123. package/src/lib/components/member-signup.js.map +1 -0
  124. package/src/lib/components/newsletter-signup.d.ts +39 -0
  125. package/src/lib/components/newsletter-signup.js +229 -0
  126. package/src/lib/components/newsletter-signup.js.map +1 -0
  127. package/src/lib/components/product-detail.d.ts +38 -0
  128. package/src/lib/components/product-detail.js +1022 -0
  129. package/src/lib/components/product-detail.js.map +1 -0
  130. package/src/lib/components/product-grid.d.ts +67 -0
  131. package/src/lib/components/product-grid.js +909 -0
  132. package/src/lib/components/product-grid.js.map +1 -0
  133. package/src/lib/components/product-reviews.d.ts +32 -0
  134. package/src/lib/components/product-reviews.js +349 -0
  135. package/src/lib/components/product-reviews.js.map +1 -0
  136. package/src/lib/components/related-products.d.ts +33 -0
  137. package/src/lib/components/related-products.js +232 -0
  138. package/src/lib/components/related-products.js.map +1 -0
  139. package/src/lib/components/reservation-widget.d.ts +33 -0
  140. package/src/lib/components/reservation-widget.js +418 -0
  141. package/src/lib/components/reservation-widget.js.map +1 -0
  142. package/src/lib/components/storefront-payment-element-fallback.d.ts +18 -0
  143. package/src/lib/components/storefront-payment-element-fallback.js +51 -0
  144. package/src/lib/components/storefront-payment-element-fallback.js.map +1 -0
  145. package/src/lib/components/storefront-payment-element.d.ts +78 -0
  146. package/src/lib/components/storefront-payment-element.js +156 -0
  147. package/src/lib/components/storefront-payment-element.js.map +1 -0
  148. package/src/lib/components/wishlist.d.ts +46 -0
  149. package/src/lib/components/wishlist.js +304 -0
  150. package/src/lib/components/wishlist.js.map +1 -0
  151. package/src/lib/constants/bundle-common.d.ts +18 -0
  152. package/src/lib/constants/bundle-common.js +18 -0
  153. package/src/lib/constants/bundle-common.js.map +1 -0
  154. package/src/lib/constants/product-filters.d.ts +35 -0
  155. package/src/lib/constants/product-filters.js +109 -0
  156. package/src/lib/constants/product-filters.js.map +1 -0
  157. package/src/lib/model/commerce-cart.d.ts +52 -0
  158. package/src/lib/model/commerce-cart.js +102 -0
  159. package/src/lib/model/commerce-cart.js.map +1 -0
  160. package/src/lib/model/commerce-connect-transfer.d.ts +243 -0
  161. package/src/lib/model/commerce-connect-transfer.js +231 -0
  162. package/src/lib/model/commerce-connect-transfer.js.map +1 -0
  163. package/src/lib/model/commerce-discounts.d.ts +164 -0
  164. package/src/lib/model/commerce-discounts.js +231 -0
  165. package/src/lib/model/commerce-discounts.js.map +1 -0
  166. package/src/lib/model/commerce-dispute.d.ts +124 -0
  167. package/src/lib/model/commerce-dispute.js +225 -0
  168. package/src/lib/model/commerce-dispute.js.map +1 -0
  169. package/src/lib/model/commerce-gift-cards.d.ts +107 -0
  170. package/src/lib/model/commerce-gift-cards.js +121 -0
  171. package/src/lib/model/commerce-gift-cards.js.map +1 -0
  172. package/src/lib/model/commerce-io.d.ts +36 -0
  173. package/src/lib/model/commerce-io.js +245 -0
  174. package/src/lib/model/commerce-io.js.map +1 -0
  175. package/src/lib/model/commerce-orders.d.ts +1040 -0
  176. package/src/lib/model/commerce-orders.js +1022 -0
  177. package/src/lib/model/commerce-orders.js.map +1 -0
  178. package/src/lib/model/commerce-promotions.d.ts +188 -0
  179. package/src/lib/model/commerce-promotions.js +199 -0
  180. package/src/lib/model/commerce-promotions.js.map +1 -0
  181. package/src/lib/model/commerce-reservations.d.ts +175 -0
  182. package/src/lib/model/commerce-reservations.js +157 -0
  183. package/src/lib/model/commerce-reservations.js.map +1 -0
  184. package/src/lib/model/commerce-shipping.d.ts +316 -0
  185. package/src/lib/model/commerce-shipping.js +484 -0
  186. package/src/lib/model/commerce-shipping.js.map +1 -0
  187. package/src/lib/model/commerce-stock-holds.d.ts +199 -0
  188. package/src/lib/model/commerce-stock-holds.js +190 -0
  189. package/src/lib/model/commerce-stock-holds.js.map +1 -0
  190. package/src/lib/model/commerce-subscription-status.d.ts +67 -0
  191. package/src/lib/model/commerce-subscription-status.js +76 -0
  192. package/src/lib/model/commerce-subscription-status.js.map +1 -0
  193. package/src/lib/model/commerce-tax-decision.d.ts +222 -0
  194. package/src/lib/model/commerce-tax-decision.js +165 -0
  195. package/src/lib/model/commerce-tax-decision.js.map +1 -0
  196. package/src/lib/model/commerce-tax.d.ts +176 -0
  197. package/src/lib/model/commerce-tax.js +92 -0
  198. package/src/lib/model/commerce-tax.js.map +1 -0
  199. package/src/lib/model/commerce.d.ts +551 -0
  200. package/src/lib/model/commerce.js +739 -0
  201. package/src/lib/model/commerce.js.map +1 -0
  202. package/src/lib/model/index.d.ts +40 -0
  203. package/src/lib/model/index.js +40 -0
  204. package/src/lib/model/index.js.map +1 -0
  205. package/src/lib/model/order-figures.d.ts +48 -0
  206. package/src/lib/model/order-figures.js +74 -0
  207. package/src/lib/model/order-figures.js.map +1 -0
  208. package/src/lib/model/plugin-permissions.d.ts +23 -0
  209. package/src/lib/model/plugin-permissions.js +34 -0
  210. package/src/lib/model/plugin-permissions.js.map +1 -0
  211. package/src/lib/model/purchase-analytics.d.ts +186 -0
  212. package/src/lib/model/purchase-analytics.js +216 -0
  213. package/src/lib/model/purchase-analytics.js.map +1 -0
  214. package/src/lib/plugin-config.d.ts +62 -0
  215. package/src/lib/plugin-config.js +78 -0
  216. package/src/lib/plugin-config.js.map +1 -0
  217. package/src/lib/plugin.d.ts +28 -0
  218. package/src/lib/plugin.js +147 -0
  219. package/src/lib/plugin.js.map +1 -0
  220. package/src/lib/server/billing-webhook.d.ts +26 -0
  221. package/src/lib/server/billing-webhook.js +4011 -0
  222. package/src/lib/server/billing-webhook.js.map +1 -0
  223. package/src/lib/server/cancel-order.d.ts +87 -0
  224. package/src/lib/server/cancel-order.js +368 -0
  225. package/src/lib/server/cancel-order.js.map +1 -0
  226. package/src/lib/server/cart-checkout.d.ts +25 -0
  227. package/src/lib/server/cart-checkout.js +976 -0
  228. package/src/lib/server/cart-checkout.js.map +1 -0
  229. package/src/lib/server/cart-cookie.d.ts +32 -0
  230. package/src/lib/server/cart-cookie.js +77 -0
  231. package/src/lib/server/cart-cookie.js.map +1 -0
  232. package/src/lib/server/cart.d.ts +34 -0
  233. package/src/lib/server/cart.js +181 -0
  234. package/src/lib/server/cart.js.map +1 -0
  235. package/src/lib/server/catalog.d.ts +127 -0
  236. package/src/lib/server/catalog.js +277 -0
  237. package/src/lib/server/catalog.js.map +1 -0
  238. package/src/lib/server/checkout.d.ts +36 -0
  239. package/src/lib/server/checkout.js +915 -0
  240. package/src/lib/server/checkout.js.map +1 -0
  241. package/src/lib/server/connect.d.ts +26 -0
  242. package/src/lib/server/connect.js +238 -0
  243. package/src/lib/server/connect.js.map +1 -0
  244. package/src/lib/server/contact-refund.d.ts +117 -0
  245. package/src/lib/server/contact-refund.js +196 -0
  246. package/src/lib/server/contact-refund.js.map +1 -0
  247. package/src/lib/server/download.d.ts +39 -0
  248. package/src/lib/server/download.js +206 -0
  249. package/src/lib/server/download.js.map +1 -0
  250. package/src/lib/server/draft-order.d.ts +26 -0
  251. package/src/lib/server/draft-order.js +706 -0
  252. package/src/lib/server/draft-order.js.map +1 -0
  253. package/src/lib/server/feed.d.ts +24 -0
  254. package/src/lib/server/feed.js +59 -0
  255. package/src/lib/server/feed.js.map +1 -0
  256. package/src/lib/server/fulfill-order.d.ts +97 -0
  257. package/src/lib/server/fulfill-order.js +235 -0
  258. package/src/lib/server/fulfill-order.js.map +1 -0
  259. package/src/lib/server/gate.d.ts +36 -0
  260. package/src/lib/server/gate.js +112 -0
  261. package/src/lib/server/gate.js.map +1 -0
  262. package/src/lib/server/gift-cards.d.ts +42 -0
  263. package/src/lib/server/gift-cards.js +219 -0
  264. package/src/lib/server/gift-cards.js.map +1 -0
  265. package/src/lib/server/low-stock.d.ts +49 -0
  266. package/src/lib/server/low-stock.js +60 -0
  267. package/src/lib/server/low-stock.js.map +1 -0
  268. package/src/lib/server/manual-tax-rate.d.ts +82 -0
  269. package/src/lib/server/manual-tax-rate.js +113 -0
  270. package/src/lib/server/manual-tax-rate.js.map +1 -0
  271. package/src/lib/server/member-feed.d.ts +24 -0
  272. package/src/lib/server/member-feed.js +72 -0
  273. package/src/lib/server/member-feed.js.map +1 -0
  274. package/src/lib/server/member-name-search.d.ts +37 -0
  275. package/src/lib/server/member-name-search.js +42 -0
  276. package/src/lib/server/member-name-search.js.map +1 -0
  277. package/src/lib/server/member-post.d.ts +23 -0
  278. package/src/lib/server/member-post.js +166 -0
  279. package/src/lib/server/member-post.js.map +1 -0
  280. package/src/lib/server/membership-account.d.ts +37 -0
  281. package/src/lib/server/membership-account.js +148 -0
  282. package/src/lib/server/membership-account.js.map +1 -0
  283. package/src/lib/server/membership-admin-password.d.ts +33 -0
  284. package/src/lib/server/membership-admin-password.js +202 -0
  285. package/src/lib/server/membership-admin-password.js.map +1 -0
  286. package/src/lib/server/membership-content.d.ts +23 -0
  287. package/src/lib/server/membership-content.js +105 -0
  288. package/src/lib/server/membership-content.js.map +1 -0
  289. package/src/lib/server/membership-login.d.ts +19 -0
  290. package/src/lib/server/membership-login.js +137 -0
  291. package/src/lib/server/membership-login.js.map +1 -0
  292. package/src/lib/server/membership-logout.d.ts +19 -0
  293. package/src/lib/server/membership-logout.js +35 -0
  294. package/src/lib/server/membership-logout.js.map +1 -0
  295. package/src/lib/server/membership-recover.d.ts +60 -0
  296. package/src/lib/server/membership-recover.js +244 -0
  297. package/src/lib/server/membership-recover.js.map +1 -0
  298. package/src/lib/server/membership-register.d.ts +22 -0
  299. package/src/lib/server/membership-register.js +241 -0
  300. package/src/lib/server/membership-register.js.map +1 -0
  301. package/src/lib/server/membership-reset.d.ts +26 -0
  302. package/src/lib/server/membership-reset.js +88 -0
  303. package/src/lib/server/membership-reset.js.map +1 -0
  304. package/src/lib/server/membership-wishlist.d.ts +23 -0
  305. package/src/lib/server/membership-wishlist.js +89 -0
  306. package/src/lib/server/membership-wishlist.js.map +1 -0
  307. package/src/lib/server/membership.d.ts +96 -0
  308. package/src/lib/server/membership.js +222 -0
  309. package/src/lib/server/membership.js.map +1 -0
  310. package/src/lib/server/native-checkout.d.ts +170 -0
  311. package/src/lib/server/native-checkout.js +193 -0
  312. package/src/lib/server/native-checkout.js.map +1 -0
  313. package/src/lib/server/newsletter.d.ts +23 -0
  314. package/src/lib/server/newsletter.js +323 -0
  315. package/src/lib/server/newsletter.js.map +1 -0
  316. package/src/lib/server/notify-restock.d.ts +22 -0
  317. package/src/lib/server/notify-restock.js +84 -0
  318. package/src/lib/server/notify-restock.js.map +1 -0
  319. package/src/lib/server/order-analytics.d.ts +134 -0
  320. package/src/lib/server/order-analytics.js +263 -0
  321. package/src/lib/server/order-analytics.js.map +1 -0
  322. package/src/lib/server/order-figures.d.ts +33 -0
  323. package/src/lib/server/order-figures.js +220 -0
  324. package/src/lib/server/order-figures.js.map +1 -0
  325. package/src/lib/server/paid-media-delivery.d.ts +173 -0
  326. package/src/lib/server/paid-media-delivery.js +212 -0
  327. package/src/lib/server/paid-media-delivery.js.map +1 -0
  328. package/src/lib/server/pos-order.d.ts +54 -0
  329. package/src/lib/server/pos-order.js +1137 -0
  330. package/src/lib/server/pos-order.js.map +1 -0
  331. package/src/lib/server/process-abandoned.d.ts +54 -0
  332. package/src/lib/server/process-abandoned.js +222 -0
  333. package/src/lib/server/process-abandoned.js.map +1 -0
  334. package/src/lib/server/process-restock.d.ts +42 -0
  335. package/src/lib/server/process-restock.js +219 -0
  336. package/src/lib/server/process-restock.js.map +1 -0
  337. package/src/lib/server/product-card.d.ts +29 -0
  338. package/src/lib/server/product-card.js +54 -0
  339. package/src/lib/server/product-card.js.map +1 -0
  340. package/src/lib/server/product.d.ts +70 -0
  341. package/src/lib/server/product.js +105 -0
  342. package/src/lib/server/product.js.map +1 -0
  343. package/src/lib/server/promotion-hold.d.ts +144 -0
  344. package/src/lib/server/promotion-hold.js +174 -0
  345. package/src/lib/server/promotion-hold.js.map +1 -0
  346. package/src/lib/server/reconcile-stock.d.ts +106 -0
  347. package/src/lib/server/reconcile-stock.js +349 -0
  348. package/src/lib/server/reconcile-stock.js.map +1 -0
  349. package/src/lib/server/refund.d.ts +45 -0
  350. package/src/lib/server/refund.js +607 -0
  351. package/src/lib/server/refund.js.map +1 -0
  352. package/src/lib/server/related.d.ts +24 -0
  353. package/src/lib/server/related.js +104 -0
  354. package/src/lib/server/related.js.map +1 -0
  355. package/src/lib/server/reservation-availability.d.ts +23 -0
  356. package/src/lib/server/reservation-availability.js +111 -0
  357. package/src/lib/server/reservation-availability.js.map +1 -0
  358. package/src/lib/server/reserve-stock.d.ts +156 -0
  359. package/src/lib/server/reserve-stock.js +146 -0
  360. package/src/lib/server/reserve-stock.js.map +1 -0
  361. package/src/lib/server/reserve.d.ts +25 -0
  362. package/src/lib/server/reserve.js +426 -0
  363. package/src/lib/server/reserve.js.map +1 -0
  364. package/src/lib/server/restock-flag.d.ts +202 -0
  365. package/src/lib/server/restock-flag.js +449 -0
  366. package/src/lib/server/restock-flag.js.map +1 -0
  367. package/src/lib/server/reviews.d.ts +51 -0
  368. package/src/lib/server/reviews.js +132 -0
  369. package/src/lib/server/reviews.js.map +1 -0
  370. package/src/lib/server/site-page-enricher.d.ts +42 -0
  371. package/src/lib/server/site-page-enricher.js +149 -0
  372. package/src/lib/server/site-page-enricher.js.map +1 -0
  373. package/src/lib/server/site-page-resolver.d.ts +26 -0
  374. package/src/lib/server/site-page-resolver.js +223 -0
  375. package/src/lib/server/site-page-resolver.js.map +1 -0
  376. package/src/lib/server/stock-hold.d.ts +127 -0
  377. package/src/lib/server/stock-hold.js +258 -0
  378. package/src/lib/server/stock-hold.js.map +1 -0
  379. package/src/lib/server/storefront-tax-record.d.ts +22 -0
  380. package/src/lib/server/storefront-tax-record.js +218 -0
  381. package/src/lib/server/storefront-tax-record.js.map +1 -0
  382. package/src/lib/server/storefront-tax.d.ts +197 -0
  383. package/src/lib/server/storefront-tax.js +245 -0
  384. package/src/lib/server/storefront-tax.js.map +1 -0
  385. package/src/lib/server/stream.d.ts +25 -0
  386. package/src/lib/server/stream.js +191 -0
  387. package/src/lib/server/stream.js.map +1 -0
  388. package/src/lib/server/subscription-portal.d.ts +24 -0
  389. package/src/lib/server/subscription-portal.js +91 -0
  390. package/src/lib/server/subscription-portal.js.map +1 -0
  391. package/src/lib/server/supplier-outbox.d.ts +190 -0
  392. package/src/lib/server/supplier-outbox.js +342 -0
  393. package/src/lib/server/supplier-outbox.js.map +1 -0
  394. package/src/lib/server/supplier-update.d.ts +23 -0
  395. package/src/lib/server/supplier-update.js +289 -0
  396. package/src/lib/server/supplier-update.js.map +1 -0
  397. package/src/lib/server/tax-profile.d.ts +29 -0
  398. package/src/lib/server/tax-profile.js +40 -0
  399. package/src/lib/server/tax-profile.js.map +1 -0
  400. package/src/lib/server.d.ts +32 -0
  401. package/src/lib/server.js +311 -0
  402. package/src/lib/server.js.map +1 -0
  403. package/src/lib/site.d.ts +27 -0
  404. package/src/lib/site.js +134 -0
  405. package/src/lib/site.js.map +1 -0
  406. package/src/lib/utils/escape-html.d.ts +41 -0
  407. package/src/lib/utils/escape-html.js +41 -0
  408. package/src/lib/utils/escape-html.js.map +1 -0
  409. package/src/lib/utils/generate-preset-id.d.ts +19 -0
  410. package/src/lib/utils/generate-preset-id.js +25 -0
  411. package/src/lib/utils/generate-preset-id.js.map +1 -0
  412. package/src/lib/utils/member-continue.d.ts +45 -0
  413. package/src/lib/utils/member-continue.js +49 -0
  414. package/src/lib/utils/member-continue.js.map +1 -0
  415. package/src/lib/utils/use-storefront-purchase-event.d.ts +60 -0
  416. package/src/lib/utils/use-storefront-purchase-event.js +142 -0
  417. package/src/lib/utils/use-storefront-purchase-event.js.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/components/product-detail.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport {\n buildAddToCartParams,\n buildBeginCheckoutParams,\n trackEvent,\n trackEventBeforeNavigation,\n type AnalyticsItem,\n} from '@aglyn/aglyn/app-utils/analytics-events'\nimport {\n isPaymentsNotConfigured,\n storefrontPaymentsNotConfiguredText,\n} from '@aglyn/aglyn/app-utils/payments-configured'\nimport * as CommerceModel from '../model'\nimport { mdiTagOutline } from '@aglyn/shared-data-mdi'\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Chip from '@mui/material/Chip'\nimport MenuItem from '@mui/material/MenuItem'\nimport Skeleton from '@mui/material/Skeleton'\nimport TextField from '@mui/material/TextField'\nimport ToggleButton from '@mui/material/ToggleButton'\nimport ToggleButtonGroup from '@mui/material/ToggleButtonGroup'\nimport Typography from '@mui/material/Typography'\nimport { Suspense, forwardRef, lazy, useEffect, useMemo, useRef, useState } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { generatePresetId } from '../utils/generate-preset-id'\nimport { useStorefrontPurchaseEvent } from '../utils/use-storefront-purchase-event'\nimport { CART_UPDATED_EVENT } from './cart'\nimport { ID as PRODUCT_REVIEWS_ID } from './product-reviews'\nimport { ID as RELATED_PRODUCTS_ID } from './related-products'\nimport { readLocalWishlist, toggleWishlist } from './wishlist'\nimport { StorefrontPaymentElementFallback } from './storefront-payment-element-fallback'\n\n/**\n * The Payment Element (AGL-1944), behind a lazy boundary rather than a plain\n * import. Stripe.js and its React wrapper are a large dependency, the flag is\n * OFF, and a static import would put the whole SDK into the bundle of every\n * product page on every published site to serve a code path no shopper reaches.\n * Split, it is fetched by the shoppers who actually get the in-page form.\n */\nconst StorefrontPaymentElement = lazy(() =>\n import('./storefront-payment-element').then((module) => ({\n default: module.StorefrontPaymentElement,\n })),\n)\n\n// Component ids are persisted in screen documents; never rename.\nexport const ID: Aglyn.ComponentId = 'product-detail'\n\nexport interface ProductDetailProps {\n /** Product slug; blank resolves from /products/{slug} in the URL. */\n slug?: string\n buyLabel?: string\n /** Hide the description block (design it separately with tokens). */\n hideDescription?: boolean\n /** Offer a discount/coupon code field before the buy button. */\n showCoupon?: boolean\n}\n\ninterface DetailVariant {\n id: string\n options?: Record<string, string>\n priceUsd: number\n compareAtPriceUsd?: number\n soldOut: boolean\n imageUrl?: string\n}\n\ninterface Detail {\n id: string\n name: string\n slug: string\n description?: string\n mediaUrls: string[]\n options: CommerceModel.ProductOption[]\n variants: DetailVariant[]\n /** Recurring billing (AGL-303); framing + buyer choice on the PDP. */\n subscription?: { interval: 'month' | 'year'; trialDays?: number }\n /** Buyer picks one-time or subscribe at the same price (AGL-545). */\n subscriptionOptional?: boolean\n}\n\nconst SAMPLE: Detail = {\n id: 'sample',\n name: 'Sample product',\n slug: '#',\n description: 'Drop this block on your product page template.',\n mediaUrls: [],\n options: [{ name: 'Size', values: ['S', 'M', 'L'] }],\n variants: [\n { id: 'a', options: { Size: 'S' }, priceUsd: 29, soldOut: false },\n { id: 'b', options: { Size: 'M' }, priceUsd: 29, soldOut: false },\n { id: 'c', options: { Size: 'L' }, priceUsd: 32, soldOut: true },\n ],\n}\n\n/**\n * The GA4 `items` entry for one line of this product.\n *\n * `item_id` is the PRODUCT id and never the variant's, matching the\n * `view_item` above and the cart's lines below: GA joins the funnel on that\n * id, and a `begin_checkout` keyed on a variant would report a product nothing\n * else on the storefront had ever mentioned.\n *\n * `price` is the resolved variant's, which arrived from the server's product\n * payload — the same figure `checkout` prices the charge from, so the reported\n * value and the amount Stripe collects come from one source.\n */\nfunction buyItem(\n product: Detail,\n variant: DetailVariant | undefined,\n quantity: number,\n): AnalyticsItem {\n return {\n item_id: product.id,\n item_name: product.name,\n price: variant?.priceUsd,\n quantity,\n }\n}\n\nfunction slugFromLocation(): string {\n if (typeof window === 'undefined') return ''\n const match = window.location.pathname.match(/\\/products\\/([^/?#]+)/)\n return match ? decodeURIComponent(match[1]) : ''\n}\n\n/**\n * Product detail block (AGL-292): gallery, option pickers that resolve\n * the variant (price/media/stock follow), quantity, and a buy button\n * that charges through the server-priced checkout with the selected\n * variant. Resolves its product from the /products/{slug} URL unless a\n * slug prop pins it; sample data on the inert canvas.\n */\nconst ProductDetail = forwardRef<HTMLDivElement, ProductDetailProps>(\n (props, ref) => {\n const { slug: slugProp, buyLabel, hideDescription, showCoupon, ...rest } =\n props\n // Node styles ride the renderer-merged sx; recompose (stack.ts pattern).\n const nodeSx = Array.isArray(props['sx']) ? props['sx'] : [props['sx']]\n const site = Aglyn.useSite()\n const siteFetch = Aglyn.useSiteFetch()\n const { hostId } = site\n\n // The single-product (\"buy now\") path returns the shopper to this page\n // rather than to the cart, so the PDP is the second of the two surfaces\n // that has to be able to report `purchase` (AGL-1641). Both mount points\n // share one guard, so a page carrying a cart AND a PDP still sends one.\n useStorefrontPurchaseEvent(hostId, siteFetch)\n // Seeded from the server-resolved page data (AGL-659) so the PDP renders\n // its real content in the SSR HTML. Starting at null meant the server\n // emitted a <Skeleton> and the crawler got a product page with no\n // product in it. Absent in the besigner/preview, where the effect below\n // still fetches — so this is an optimisation, not a new requirement.\n const seededProduct = (\n site.pageData as { commerce?: { product?: Detail } } | undefined\n )?.commerce?.product\n const [detail, setDetail] = useState<Detail | null | 'missing'>(\n seededProduct ?? null,\n )\n const [selections, setSelections] = useState<Record<string, string>>({})\n const [quantity, setQuantity] = useState(1)\n /** A discount or coupon code typed on the product page. */\n const [coupon, setCoupon] = useState('')\n const [activeImage, setActiveImage] = useState(0)\n // `unconfigured` is not an `error` with softer words (AGL-2019). A store\n // with no Stripe key answers 501, and rendering that at `severity=\"error\"`\n // tells a shopper their payment failed when nothing was ever attempted —\n // the same distinction `ask` already makes, and the same one the cart's\n // 423 lockdown branch makes. It is the terminal one: it latches Buy off,\n // because every further click gets the identical refusal.\n const [status, setStatus] = useState<\n 'idle' | 'sending' | 'error' | 'ask' | 'unconfigured'\n >('idle')\n const [message, setMessage] = useState('')\n // Buy-now's half of AGL-1721: asked only when the server refuses to price\n // shipping without a destination, so a digital product, a subscription, or\n // a merchant whose rates are the same everywhere never shows it. `null` is\n // \"not asked\" — the field appearing is the server's answer, not a guess.\n const [shipTo, setShipTo] = useState('')\n const [shipCountries, setShipCountries] = useState<string[] | null>(null)\n const [added, setAdded] = useState(false)\n const [wishlisted, setWishlisted] = useState(false)\n const [notifyEmail, setNotifyEmail] = useState('')\n const [notifyState, setNotifyState] = useState<'idle' | 'done'>('idle')\n // Buyer-chosen billing (AGL-545): only meaningful when the product\n // is subscriptionOptional; defaults to a one-time purchase.\n const [billing, setBilling] = useState<CommerceModel.CheckoutBillingChoice>(\n 'once',\n )\n /**\n * The in-page checkout session (AGL-1944), null on every store until the\n * flag AND a publishable key say otherwise. A `clientSecret` is Stripe's\n * instruction to the browser; holding it says nothing about money having\n * moved, and nothing in this component ever claims it has.\n */\n const [nativeCheckout, setNativeCheckout] = useState<{\n clientSecret: string\n publishableKey: string\n } | null>(null)\n\n const slug = slugProp || slugFromLocation()\n\n useEffect(() => {\n if (hostId && resolvedId) {\n setWishlisted(readLocalWishlist(hostId).includes(resolvedId))\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [hostId, detail])\n\n useEffect(() => {\n if (!hostId || !slug) return\n // Already delivered with the page (AGL-659) — refetching the identical\n // payload on hydrate would just be a wasted round trip per visitor.\n if (seededProduct && seededProduct.slug === slug) return\n let active = true\n void fetch(\n `/api/commerce/product?hostId=${encodeURIComponent(hostId)}` +\n `&slug=${encodeURIComponent(slug)}`,\n )\n .then((response) => (response.ok ? response.json() : null))\n .then((payload) => {\n if (!active) return\n const product = payload?.product as Detail | undefined\n setDetail(product ?? 'missing')\n if (product) {\n // GA4 ecommerce mirror (AGL-327), through the shared taxonomy\n // since AGL-1591 rather than raw gtag — same consent gate, same\n // sanitizer, and the name is now checked by the compiler.\n trackEvent('view_item', {\n items: [{ item_id: product.id, item_name: product.name }],\n })\n const first =\n product.variants.find((variant) => !variant.soldOut) ??\n product.variants[0]\n setSelections(first?.options ?? {})\n }\n })\n .catch(() => {\n if (active) setDetail('missing')\n })\n return () => {\n active = false\n }\n }, [hostId, slug])\n\n const resolvedId =\n hostId && detail && detail !== 'missing' ? detail.id : null\n const resolved: Detail | null = hostId\n ? detail === 'missing'\n ? null\n : detail\n : SAMPLE\n\n const variant = useMemo(() => {\n if (!resolved) return undefined\n return (\n CommerceModel.findVariant(\n { variants: resolved.variants as any },\n selections,\n ) as DetailVariant | undefined\n ) ?? resolved.variants[0]\n }, [resolved, selections])\n\n // Add to cart (AGL-293) beside instant buy; badge refresh via event.\n const handleAddToCart = async () => {\n if (!hostId || !resolved || !variant) return\n setAdded(false)\n const response = await siteFetch('/api/commerce/cart', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n hostId,\n action: 'add',\n productId: resolved.id,\n variantId: variant.id,\n quantity,\n }),\n }).catch(() => null)\n if (response?.ok) {\n setAdded(true)\n // Priced (AGL-1591's shape, completed): the resolved variant's price\n // and the chosen quantity are both known here and both come from the\n // server's product payload, so GA4's \"value added to cart\" is a real\n // number rather than the empty column an items-only hit leaves. The\n // `value` describes what was JUST ADDED, not the cart's new total —\n // see `buildAddToCartParams`.\n trackEvent(\n 'add_to_cart',\n buildAddToCartParams({\n items: [buyItem(resolved, variant, quantity)],\n }),\n )\n window.dispatchEvent(new Event(CART_UPDATED_EVENT))\n }\n }\n\n /**\n * Idempotency key for ONE buy-now attempt (AGL-1697).\n *\n * Minted lazily on the first buy click, retired whenever the purchase\n * changes shape — a different product, variant, quantity, billing choice\n * or destination is a different attempt. A retry of THIS attempt presents\n * the same key, so the server replays the original session instead of\n * opening a second one (for a subscription product, a second RECURRING\n * subscription).\n */\n const attemptKey = useRef('')\n useEffect(() => {\n attemptKey.current = ''\n // `coupon` is in here because it CHANGES THE PRICE. Without it a shopper\n // who buys, comes back, types a code and buys again presents the same\n // key, and the server replays the original full-price session — a quoted\n // number that is not the number charged, which is the whole defect class\n // this path has been cleared of.\n }, [resolved?.id, variant?.id, quantity, billing, shipTo, coupon])\n\n const handleBuy = async () => {\n if (!hostId || !resolved || !variant || status === 'sending') return\n setStatus('sending')\n setMessage('')\n if (!attemptKey.current) {\n attemptKey.current =\n globalThis.crypto?.randomUUID?.() ??\n `${Date.now()}-${Math.random().toString(36).slice(2)}`\n }\n try {\n const response = await siteFetch('/api/commerce/checkout', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Idempotency-Key': attemptKey.current,\n },\n body: JSON.stringify({\n hostId,\n productId: resolved.id,\n variantId: variant.id,\n quantity,\n // Billing choice (AGL-545): the server re-validates against\n // the product doc, so this is a request, not an instruction.\n ...(resolved.subscriptionOptional ? { billing } : {}),\n // Likewise a request (AGL-1721): the server resolves this\n // country's rates AND restricts the session to addresses in it,\n // so naming a cheap zone here cannot ship a parcel anywhere else.\n ...(shipTo ? { shippingCountry: shipTo } : {}),\n // The server resolves this against the discounts hub first and the\n // legacy coupons second, and refuses a code it cannot apply with a\n // reason — never a silent full-price charge.\n ...(coupon.trim() ? { couponCode: coupon.trim() } : {}),\n }),\n })\n const payload = await response.json().catch(() => ({}))\n // In-page payment (AGL-1944). A native session returns a client secret\n // and NO url — the two are mutually exclusive by construction, so the\n // redirect branch below is unreachable in native mode and vice versa.\n // Checked FIRST so a server that somehow sent both cannot silently\n // navigate the shopper away from the form we just decided to show.\n if (response.ok && payload?.clientSecret && payload?.publishableKey) {\n // Buy-now's `begin_checkout`. The cart path has reported this since\n // AGL-1591 and this one never did, so a storefront whose shoppers\n // skip the cart showed `view_item` → `add_to_cart` → nothing →\n // `purchase`: GA4's shopping funnel put every single-product sale in\n // the \"abandoned checkout\" bucket, and the merchant's checkout rate\n // read as a collapse rather than as an unmeasured path.\n //\n // Reported on BOTH branches, and from the same place, for the reason\n // the cart states: a count that halved the day the in-page payment\n // flag flipped would look like a conversion collapse.\n trackEvent(\n 'begin_checkout',\n buildBeginCheckoutParams({\n items: [buyItem(resolved, variant, quantity)],\n }),\n )\n setNativeCheckout({\n clientSecret: String(payload.clientSecret),\n publishableKey: String(payload.publishableKey),\n })\n setStatus('idle')\n return\n }\n if (response.ok && payload?.url) {\n // Awaited before the redirect (AGL-1580), for the reason spelled out\n // on the cart's matching branch: delivery here is a synchronous\n // `window.gtag` call today and the await costs nothing, but the\n // property that makes a bare call safe is invisible from this file.\n await trackEventBeforeNavigation(\n 'begin_checkout',\n buildBeginCheckoutParams({\n items: [buyItem(resolved, variant, quantity)],\n }),\n )\n window.location.assign(payload.url)\n return\n }\n // Buy-now's half of AGL-2019. The server's own 501 wording is not\n // rendered to a visitor; this surface is public.\n if (isPaymentsNotConfigured(response.status)) {\n setMessage(storefrontPaymentsNotConfiguredText())\n setStatus('unconfigured')\n return\n }\n if (payload?.needsShippingCountry) {\n setShipCountries(\n (payload.shippingCountries as string[] | undefined)?.length\n ? (payload.shippingCountries as string[])\n : [...CommerceModel.CHECKOUT_SHIPPING_COUNTRIES],\n )\n setMessage(String(payload?.error ?? ''))\n // An unserved destination is a refusal and reads as one; being\n // asked the first time is not.\n setStatus(shipTo ? 'error' : 'ask')\n return\n }\n setMessage(String(payload?.error ?? ''))\n setStatus('error')\n } catch {\n setStatus('error')\n }\n }\n\n if (hostId && detail === null) {\n return (\n <Box ref={ref} {...rest} sx={[{ display: 'flex', gap: 3 }, ...nodeSx]}>\n <Skeleton variant=\"rectangular\" width={320} height={320} />\n <Box sx={{ flex: 1 }}>\n <Skeleton width=\"60%\" height={36} />\n <Skeleton width=\"25%\" />\n <Skeleton width=\"90%\" />\n </Box>\n </Box>\n )\n }\n if (!resolved) {\n return (\n <Box ref={ref} {...rest} sx={[{ p: 3 }, ...nodeSx]}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Product not found.'}\n </Typography>\n </Box>\n )\n }\n\n // Every rendered `<img src>` on this page goes through\n // `siteRelativeMediaSrc` (AGL-1726). Commerce called NO resolver at all,\n // which cost it two things at once: a `media:` reference — writable via\n // the resources API and the CSV importer — would have reached an `<img>`\n // as the literal string, and a stored absolute\n // `https://{subdomain}.aglyn.app/api/media/cdn/…` stayed absolute, so a\n // white-label storefront on the customer's own domain served product\n // photos naming OUR platform, cross-origin, in page source and in every\n // visitor's request. Production carried exactly one such document; the\n // resolver fixes it at READ time, so no backfill stands between the\n // defect and the fix.\n //\n // Deliberately NOT applied to `resolved.mediaUrls` wholesale: the\n // schema.org `image` array below is read out of band by a crawler, where\n // an absolute URL is the point. That one wants `absoluteMediaSrc` with\n // the site's own origin, which is the tenant page's job (AGL-1725).\n const galleryImage = Aglyn.siteRelativeMediaSrc(\n variant?.imageUrl ?? resolved.mediaUrls[activeImage] ?? resolved.mediaUrls[0],\n { hostId },\n )\n\n // Subscription framing (AGL-545): subscription-only products price as\n // $X/mo|/yr with a \"Subscribe\" button; subscriptionOptional products\n // surface the one-time/subscribe toggle instead. Same price either way\n // — the server re-prices from the product doc regardless.\n const subscription = resolved.subscription\n const intervalSuffix = subscription?.interval === 'year' ? '/yr' : '/mo'\n const subscribing =\n Boolean(subscription) &&\n (!resolved.subscriptionOptional || billing === 'subscribe')\n\n // schema.org Product/Offer (AGL-299). Kept ONLY for the case where this\n // block renders without server-seeded page data — the besigner preview,\n // or a page whose resolver didn't supply it. When the tenant page seeds\n // us it emits the same Product node server-side (AGL-660), and two\n // Product nodes for one item is worse than one, so we stand down.\n const structuredData =\n hostId && resolvedId && !seededProduct\n ? {\n '@context': 'https://schema.org',\n '@type': 'Product',\n name: resolved.name,\n ...(resolved.description\n ? { description: resolved.description }\n : {}),\n ...(resolved.mediaUrls.length\n ? { image: resolved.mediaUrls }\n : {}),\n offers: {\n '@type': 'Offer',\n priceCurrency: 'USD',\n price: String(variant?.priceUsd ?? 0),\n availability: variant?.soldOut\n ? 'https://schema.org/OutOfStock'\n : 'https://schema.org/InStock',\n },\n }\n : null\n\n return (\n <Box\n ref={ref}\n {...rest}\n sx={[\n {\n display: 'flex',\n gap: 3,\n flexDirection: { xs: 'column', md: 'row' },\n },\n ...nodeSx,\n ]}\n >\n <Box sx={{ flex: 1, minWidth: 0 }}>\n {galleryImage ? (\n <Box\n component=\"img\"\n src={galleryImage}\n alt={resolved.name}\n // DELIBERATELY NOT DEFERRED (AGL-2486). This is the gallery\n // hero at the top of a product page — the one image on this\n // surface that really is the LCP candidate, and the browser\n // default here is already `eager`. Spreading\n // `DEFERRED_IMAGE_ATTRIBUTES` over it to \"finish the job\" is\n // the obvious next edit and it re-introduces the bug this\n // issue opened with: an LCP image not discovered until after\n // layout has run. The thumbnail strip below it IS deferred.\n //\n // No `fetchpriority` either, for the reason written out at\n // `image.tsx`: `high` is a claim about every other request in\n // flight, and a page whose real LCP is the product NAME would\n // pay for that claim.\n sx={{\n width: '100%',\n aspectRatio: '1 / 1',\n objectFit: 'cover',\n borderRadius: 1,\n }}\n />\n ) : (\n <Box\n sx={{\n width: '100%',\n aspectRatio: '1 / 1',\n bgcolor: 'action.hover',\n borderRadius: 1,\n }}\n />\n )}\n {resolved.mediaUrls.length > 1 ? (\n <Box sx={{ display: 'flex', gap: 1, mt: 1, flexWrap: 'wrap' }}>\n {resolved.mediaUrls.map((url, index) => (\n <Box\n key={`${url}-${index}`}\n component=\"img\"\n // Same resolver as the hero (AGL-1726) — a thumbnail is an\n // `<img>` on the customer's page and leaks exactly as much.\n src={Aglyn.siteRelativeMediaSrc(url, { hostId })}\n alt=\"\"\n onClick={() => setActiveImage(index)}\n sx={{\n width: 56,\n height: 56,\n objectFit: 'cover',\n borderRadius: 1,\n cursor: 'pointer',\n border: 2,\n borderColor:\n index === activeImage ? 'primary.main' : 'transparent',\n }}\n // Deferred (AGL-2486): 56px thumbnails that exist to swap\n // the hero above. They were fetching eagerly ALONGSIDE\n // that hero, so a five-image gallery had the hero\n // competing with four thumbnails nobody had asked for yet.\n {...Aglyn.DEFERRED_IMAGE_ATTRIBUTES}\n />\n ))}\n </Box>\n ) : null}\n </Box>\n {structuredData ? (\n <script\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{ __html: Aglyn.safeJsonLd(structuredData) }}\n />\n ) : null}\n <Box sx={{ flex: 1, minWidth: 0 }}>\n <Typography variant=\"h4\" component=\"h1\" gutterBottom>\n {resolved.name}\n </Typography>\n <Box sx={{ display: 'flex', gap: 1, alignItems: 'center', mb: 2 }}>\n <Typography variant=\"h6\">\n {`$${variant?.priceUsd ?? 0}${subscribing ? intervalSuffix : ''}`}\n </Typography>\n {subscribing && subscription?.trialDays ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`${subscription.trialDays}-day free trial`}\n </Typography>\n ) : null}\n {variant?.compareAtPriceUsd ? (\n <>\n <Typography\n variant=\"body1\"\n color=\"text.disabled\"\n sx={{ textDecoration: 'line-through' }}\n >\n {`$${variant.compareAtPriceUsd}`}\n </Typography>\n <Chip label=\"Sale\" size=\"small\" color=\"primary\" />\n </>\n ) : null}\n {variant?.soldOut ? (\n <Chip label=\"Sold out\" size=\"small\" variant=\"outlined\" />\n ) : null}\n <Button\n size=\"small\"\n onClick={async () => {\n if (hostId && resolved.id !== 'sample') {\n setWishlisted(await toggleWishlist(hostId, resolved.id, siteFetch))\n }\n }}\n >\n {wishlisted ? '♥ Saved' : '♡ Save'}\n </Button>\n </Box>\n {subscription && resolved.subscriptionOptional ? (\n <ToggleButtonGroup\n value={billing}\n exclusive\n size=\"small\"\n onChange={(_event, value) => {\n if (value === 'once' || value === 'subscribe') {\n setBilling(value)\n }\n }}\n sx={{ mb: 2 }}\n >\n <ToggleButton value=\"once\">\n {`One-time $${variant?.priceUsd ?? 0}`}\n </ToggleButton>\n <ToggleButton value=\"subscribe\">\n {`Subscribe $${variant?.priceUsd ?? 0}${intervalSuffix}`}\n </ToggleButton>\n </ToggleButtonGroup>\n ) : null}\n {resolved.options.map((option) => (\n <TextField\n key={option.name}\n label={option.name}\n value={selections[option.name] ?? ''}\n onChange={(event) =>\n setSelections((prev) => ({\n ...prev,\n [option.name]: event.target.value,\n }))\n }\n size=\"small\"\n select\n fullWidth\n sx={{ mb: 1.5 }}\n >\n {option.values.map((value) => (\n <MenuItem key={value} value={value}>\n {value}\n </MenuItem>\n ))}\n </TextField>\n ))}\n {showCoupon ? (\n <TextField\n label=\"Discount code\"\n value={coupon}\n onChange={(event) => setCoupon(event.target.value)}\n size=\"small\"\n sx={{ mb: 2, display: 'block' }}\n />\n ) : null}\n <Box sx={{ display: 'flex', gap: 1.5, alignItems: 'center', mb: 2 }}>\n <TextField\n label=\"Qty\"\n value={quantity}\n onChange={(event) =>\n setQuantity(\n Math.max(\n 1,\n Math.min(99, Math.round(Number(event.target.value)) || 1),\n ),\n )\n }\n size=\"small\"\n sx={{ width: 80 }}\n slotProps={{ htmlInput: { inputMode: 'numeric' } }}\n />\n <Button\n variant=\"outlined\"\n color=\"primary\"\n size=\"large\"\n disabled={!hostId || variant?.soldOut}\n onClick={handleAddToCart}\n >\n {added ? 'Added ✓' : 'Add to cart'}\n </Button>\n <Button\n variant=\"contained\"\n color=\"primary\"\n size=\"large\"\n disabled={\n !hostId ||\n status === 'sending' ||\n variant?.soldOut ||\n // No payments on this deployment: the same 501 every time, so\n // the control latches off rather than inviting a retry that\n // cannot succeed (AGL-2019).\n status === 'unconfigured' ||\n // Asked but unanswered: the server would only refuse again.\n (shipCountries !== null && !shipTo)\n }\n onClick={handleBuy}\n sx={{ flex: 1 }}\n >\n {variant?.soldOut\n ? 'Sold out'\n : status === 'sending'\n ? // \"Redirecting\" is a lie once the form opens in place, and\n // it is the shopper's only clue about what is about to\n // happen to their page (AGL-1944).\n nativeCheckout\n ? 'Opening…'\n : 'Redirecting…'\n : buyLabel || (subscribing ? 'Subscribe' : 'Buy now')}\n </Button>\n </Box>\n {nativeCheckout ? (\n <Suspense fallback={<StorefrontPaymentElementFallback />}>\n <StorefrontPaymentElement\n clientSecret={nativeCheckout.clientSecret}\n publishableKey={nativeCheckout.publishableKey}\n payLabel={buyLabel || (subscribing ? 'Subscribe' : 'Pay now')}\n // Cancelling drops the form and leaves the session open —\n // deliberately. The shopper may come back to the same\n // attempt key, and an abandoned session is what the AGL-323\n // recovery emails are built on. Nothing is expired from the\n // browser: that is a write against the merchant's account.\n onCancel={() => setNativeCheckout(null)}\n />\n </Suspense>\n ) : null}\n {shipCountries ? (\n <TextField\n select\n label=\"Ship to\"\n value={shipTo}\n onChange={(event) => setShipTo(event.target.value)}\n size=\"small\"\n fullWidth\n helperText=\"Shipping rates depend on where this is going\"\n sx={{ mb: 2 }}\n >\n {shipCountries.map((code) => (\n <MenuItem key={code} value={code}>\n {CommerceModel.CHECKOUT_SHIPPING_COUNTRY_NAMES[code] ?? code}\n </MenuItem>\n ))}\n </TextField>\n ) : null}\n {status === 'ask' || status === 'unconfigured' ? (\n <Alert severity=\"info\" sx={{ mb: 2 }}>\n {message}\n </Alert>\n ) : null}\n {status === 'error' ? (\n <Alert severity=\"error\" sx={{ mb: 2 }}>\n {message || 'Checkout is unavailable right now.'}\n </Alert>\n ) : null}\n {variant?.soldOut && hostId ? (\n notifyState === 'done' ? (\n <Alert severity=\"success\" sx={{ mb: 2 }}>\n {'We will email you when it is back.'}\n </Alert>\n ) : (\n <Box sx={{ display: 'flex', gap: 1, mb: 2 }}>\n <TextField\n placeholder=\"you@example.com\"\n type=\"email\"\n // Third instance of the nameless-input defect (AGL-2392).\n // Named for its job rather than \"Email address\": this row\n // appears inside a product page that may also carry the\n // newsletter block, and two fields both announced as\n // \"Email address\" is barely better than none.\n slotProps={{\n htmlInput: {\n 'aria-label': 'Email address for back-in-stock alert',\n },\n }}\n value={notifyEmail}\n onChange={(event) => setNotifyEmail(event.target.value)}\n size=\"small\"\n sx={{ flex: 1 }}\n />\n <Button\n size=\"small\"\n variant=\"outlined\"\n disabled={!notifyEmail.trim()}\n onClick={async () => {\n const response = await siteFetch(\n '/api/commerce/notify-restock',\n {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n hostId,\n productId: resolved.id,\n email: notifyEmail,\n }),\n },\n ).catch(() => null)\n if (response?.ok) setNotifyState('done')\n }}\n >\n {'Notify me'}\n </Button>\n </Box>\n )\n ) : null}\n {!hideDescription && resolved.description ? (\n <Typography variant=\"body1\" color=\"text.secondary\">\n {resolved.description}\n </Typography>\n ) : null}\n </Box>\n </Box>\n )\n },\n)\nProductDetail.displayName = 'AglynProductDetail'\n\nexport const schema: Aglyn.ComponentSchema<ProductDetailProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Product detail',\n description: \"One product's gallery, options and buy button.\",\n category: Aglyn.ComponentCategory.COMMERCE,\n icon: { path: mdiTagOutline.path, sx: { color: '#2e7d32' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n {\n name: 'slug',\n label: 'Product slug',\n description:\n 'Pin to one product; blank follows the /products/{slug} URL ' +\n '(product page template).',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n },\n {\n name: 'buyLabel',\n label: 'Buy button label',\n description: 'Defaults to \"Buy now\".',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n },\n {\n name: 'hideDescription',\n label: 'Hide description',\n description: 'Design the description separately with tokens.',\n component: Aglyn.FieldComponentType.CHECKBOX,\n },\n {\n // Off by default, so no existing page changes shape on deploy. The cart\n // has carried this field all along and the product page had none, so a\n // shopper buying the same goods through Buy now had nowhere to enter a\n // code the merchant had advertised.\n name: 'showCoupon',\n label: 'Show discount code field',\n description: 'Lets a buyer enter a discount or coupon code before buying.',\n component: Aglyn.FieldComponentType.CHECKBOX,\n },\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n {\n $id: generatePresetId(ID),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Product detail',\n pluginId: BUNDLE_ID,\n description: 'Gallery, variant picker, and buy button for one product',\n category: Aglyn.ComponentCategory.COMMERCE,\n icon: { path: mdiTagOutline.path, sx: { color: '#2e7d32' } },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: {},\n },\n },\n {\n // Product page (AGL-561): the commerce-standard PDP subtree —\n // breadcrumb, detail, related products, reviews — for the product\n // page template screen. `{{product.name}}` resolves there via the\n // site page resolver's token pass (AGL-292); node shapes follow\n // the Sections & Blocks convention (AGL-539) and reference only\n // persisted component ids.\n $id: generatePresetId(ID, 'page'),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Product page',\n pluginId: BUNDLE_ID,\n description:\n 'Breadcrumb, product detail, related products, and reviews',\n category: Aglyn.ComponentCategory.COMMERCE,\n icon: { path: mdiTagOutline.path, sx: { color: '#2e7d32' } },\n data: {\n $id: null,\n componentId: 'muiStack',\n pluginId: Aglyn.MUI_BUNDLE_ID,\n props: { spacing: 4 },\n // Styling on the node's own sx, never in props (AGL-1346): both\n // records render, but only `node.sx` is the one the Styles panel can\n // read, edit or clear.\n sx: { paddingTop: 2, paddingBottom: 2 },\n nodes: [\n {\n $id: null,\n componentId: 'muiStack',\n pluginId: Aglyn.MUI_BUNDLE_ID,\n props: { direction: 'row', spacing: 1 },\n sx: { alignItems: 'center' },\n nodes: [\n {\n $id: null,\n componentId: 'muiScreenLink',\n pluginId: Aglyn.MUI_BUNDLE_ID,\n props: { children: 'Shop', size: 'small', color: 'inherit' },\n },\n {\n $id: null,\n componentId: 'muiTypography',\n pluginId: Aglyn.MUI_BUNDLE_ID,\n props: { variant: 'body2', children: '/ {{product.name}}' },\n },\n ],\n },\n {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: {},\n },\n {\n $id: null,\n componentId: RELATED_PRODUCTS_ID,\n pluginId: BUNDLE_ID,\n props: {},\n },\n {\n $id: null,\n componentId: PRODUCT_REVIEWS_ID,\n pluginId: BUNDLE_ID,\n props: {},\n },\n ],\n },\n },\n]\n\nexport default ProductDetail\n"],"names":["Aglyn","buildAddToCartParams","buildBeginCheckoutParams","trackEvent","trackEventBeforeNavigation","isPaymentsNotConfigured","storefrontPaymentsNotConfiguredText","CommerceModel","mdiTagOutline","Alert","Box","Button","Chip","MenuItem","Skeleton","TextField","ToggleButton","ToggleButtonGroup","Typography","Suspense","forwardRef","lazy","useEffect","useMemo","useRef","useState","BUNDLE_ID","generatePresetId","useStorefrontPurchaseEvent","CART_UPDATED_EVENT","ID","PRODUCT_REVIEWS_ID","RELATED_PRODUCTS_ID","readLocalWishlist","toggleWishlist","StorefrontPaymentElementFallback","StorefrontPaymentElement","then","module","default","SAMPLE","id","name","slug","description","mediaUrls","options","values","variants","Size","priceUsd","soldOut","buyItem","product","variant","quantity","item_id","item_name","price","slugFromLocation","window","match","location","pathname","decodeURIComponent","ProductDetail","props","ref","site","slugProp","buyLabel","hideDescription","showCoupon","rest","nodeSx","Array","isArray","useSite","siteFetch","useSiteFetch","hostId","seededProduct","pageData","commerce","detail","setDetail","selections","setSelections","setQuantity","coupon","setCoupon","activeImage","setActiveImage","status","setStatus","message","setMessage","shipTo","setShipTo","shipCountries","setShipCountries","added","setAdded","wishlisted","setWishlisted","notifyEmail","setNotifyEmail","notifyState","setNotifyState","billing","setBilling","nativeCheckout","setNativeCheckout","resolvedId","includes","active","fetch","encodeURIComponent","response","ok","json","payload","items","first","find","catch","resolved","undefined","findVariant","handleAddToCart","method","headers","body","JSON","stringify","action","productId","variantId","dispatchEvent","Event","attemptKey","current","handleBuy","globalThis","crypto","randomUUID","Date","now","Math","random","toString","slice","subscriptionOptional","shippingCountry","trim","couponCode","clientSecret","publishableKey","String","url","assign","needsShippingCountry","shippingCountries","length","CHECKOUT_SHIPPING_COUNTRIES","error","sx","display","gap","width","height","flex","p","color","galleryImage","siteRelativeMediaSrc","imageUrl","subscription","intervalSuffix","interval","subscribing","Boolean","structuredData","image","offers","priceCurrency","availability","flexDirection","xs","md","minWidth","component","src","alt","aspectRatio","objectFit","borderRadius","bgcolor","mt","flexWrap","map","index","onClick","cursor","border","borderColor","DEFERRED_IMAGE_ATTRIBUTES","script","type","dangerouslySetInnerHTML","__html","safeJsonLd","gutterBottom","alignItems","mb","trialDays","compareAtPriceUsd","textDecoration","label","size","value","exclusive","onChange","_event","option","event","prev","target","select","fullWidth","max","min","round","Number","slotProps","htmlInput","inputMode","disabled","fallback","payLabel","onCancel","helperText","code","CHECKOUT_SHIPPING_COUNTRY_NAMES","severity","placeholder","email","displayName","schema","$id","pluginId","category","ComponentCategory","COMMERCE","icon","path","flags","selfClosing","FEATURE_FLAG","ENABLED","attributes","FieldComponentType","TEXT_FIELD","CHECKBOX","presets","NodeType","PRESET","data","componentId","MUI_BUNDLE_ID","spacing","paddingTop","paddingBottom","nodes","direction","children"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SACEC,oBAAoB,EACpB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AW;wBAAOJ,SAAS;oBAAE;oBACtCxG,IAAI;wBAAE+C,YAAY;oBAAS;oBAC3B4D,OAAO;wBACL;4BACExB,KAAK;4BACLmB,aAAa;4BACblB,UAAU1P,MAAM6Q,aAAa;4BAC7B3M,OAAO;gCAAEiN,UAAU;gCAAQxD,MAAM;gCAAS9C,OAAO;4BAAU;wBAC7D;wBACA;4BACE4E,KAAK;4BACLmB,aAAa;4BACblB,UAAU1P,MAAM6Q,aAAa;4BAC7B3M,OAAO;gCAAEZ,SAAS;gCAAS6N,UAAU;4BAAqB;wBAC5D;qBACD;gBACH;gBACA;oBACE1B,KAAK;oBACLmB,aAAa9O;oBACb4N,UAAUhO;oBACVwC,OAAO,CAAC;gBACV;gBACA;oBACEuL,KAAK;oBACLmB,aAAa5O;oBACb0N,UAAUhO;oBACVwC,OAAO,CAAC;gBACV;gBACA;oBACEuL,KAAK;oBACLmB,aAAa7O;oBACb2N,UAAUhO;oBACVwC,OAAO,CAAC;gBACV;aACD;QACH;IACF;CACD,CAAA;AAED,eAAeD,cAAa"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import * as Aglyn from '@aglyn/aglyn';
18
+ export declare const ID: Aglyn.ComponentId;
19
+ export interface ProductGridProps {
20
+ /** Filter source; 'all' lists the whole active catalog. */
21
+ source?: 'all' | 'collection' | 'category' | 'tag';
22
+ /** Collection id when source = collection (rename-safe, AGL-343). */
23
+ collectionId?: string;
24
+ /** Legacy collection slug; used only when no collectionId is set.
25
+ * Blank follows the /collections/{slug} URL (AGL-298). */
26
+ collectionSlug?: string;
27
+ /** Faceted controls above the grid: tags, availability, sort. */
28
+ showFilters?: boolean;
29
+ /** Debounced visitor search box above the grid (server-side, AGL-561). */
30
+ showSearch?: boolean;
31
+ /** Category filter chips from the host's categories (AGL-561). */
32
+ showCategories?: boolean;
33
+ /** Sort select: newest, name, price low→high / high→low (AGL-561). */
34
+ showSort?: boolean;
35
+ /** Physical / digital / services filter chips (AGL-561). */
36
+ showTypeFilter?: boolean;
37
+ /** Price range slider bounded by the catalog's prices (AGL-564). */
38
+ showPriceFilter?: boolean;
39
+ /** Products per page; shows a Load more button while more remain. */
40
+ pageSize?: number;
41
+ /** Category id when source = category (rename-safe, AGL-343). */
42
+ categoryId?: string;
43
+ /** Legacy category slug; used only when no categoryId is set. */
44
+ categorySlug?: string;
45
+ /** Tag when source = tag. */
46
+ tag?: string;
47
+ sort?: 'name' | 'price-asc' | 'price-desc' | 'newest';
48
+ /** Grid columns on desktop (1-6); mobile always stacks to 2/1. */
49
+ columns?: number;
50
+ maxItems?: number;
51
+ /** Empty-state copy when nothing matches. */
52
+ emptyText?: string;
53
+ }
54
+ /**
55
+ * Product grid / PLP block (AGL-291): active catalog items from the
56
+ * public listing API, filterable by collection/category/tag, designable
57
+ * in besigner with sample cards (no SiteContext = inert canvas, same
58
+ * convention as the mui Product block). Cards navigate to
59
+ * `/products/{slug}` (PDP routes, AGL-292). Catalog UX (AGL-561):
60
+ * optional debounced search, category chips, type chips, a sort
61
+ * select, and Load more paging — all resolved server-side by the
62
+ * catalog handler so large catalogs stay cheap.
63
+ */
64
+ declare const ProductGrid: import("react").ForwardRefExoticComponent<ProductGridProps & import("react").RefAttributes<HTMLDivElement>>;
65
+ export declare const schema: Aglyn.ComponentSchema<ProductGridProps>;
66
+ export declare const presets: Aglyn.PresetSchema[];
67
+ export default ProductGrid;