@foxy.io/elements 1.25.0-beta.2 → 1.25.0-beta.3

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 (327) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +85 -3
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-admin-subscription-card.js +1 -1
  5. package/dist/cdn/foxy-api-browser.js +1 -1
  6. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  8. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  9. package/dist/cdn/foxy-attribute-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-form.js +1 -1
  11. package/dist/cdn/foxy-billing-address-card.js +1 -0
  12. package/dist/cdn/foxy-cancellation-form.js +1 -1
  13. package/dist/cdn/foxy-cart-card.js +1 -1
  14. package/dist/cdn/foxy-cart-form.js +1 -1
  15. package/dist/cdn/foxy-client-card.js +1 -1
  16. package/dist/cdn/foxy-client-form.js +1 -1
  17. package/dist/cdn/foxy-collection-page.js +1 -1
  18. package/dist/cdn/foxy-collection-pages.js +1 -1
  19. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  20. package/dist/cdn/foxy-coupon-card.js +1 -1
  21. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  22. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  23. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  24. package/dist/cdn/foxy-coupon-form.js +1 -1
  25. package/dist/cdn/foxy-custom-field-card.js +1 -1
  26. package/dist/cdn/foxy-custom-field-form.js +1 -1
  27. package/dist/cdn/foxy-customer-api.js +1 -1
  28. package/dist/cdn/foxy-customer-card.js +1 -1
  29. package/dist/cdn/foxy-customer-form.js +1 -1
  30. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  31. package/dist/cdn/foxy-customer-portal.js +1 -1
  32. package/dist/cdn/foxy-customer.js +3 -3
  33. package/dist/cdn/foxy-customers-table.js +1 -1
  34. package/dist/cdn/foxy-discount-builder.js +1 -1
  35. package/dist/cdn/foxy-discount-card.js +1 -1
  36. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  37. package/dist/cdn/foxy-donation.js +1 -1
  38. package/dist/cdn/foxy-downloadable-card.js +1 -1
  39. package/dist/cdn/foxy-downloadable-form.js +1 -1
  40. package/dist/cdn/foxy-email-template-card.js +1 -1
  41. package/dist/cdn/foxy-email-template-form.js +1 -1
  42. package/dist/cdn/foxy-error-entry-card.js +1 -1
  43. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  44. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  45. package/dist/cdn/foxy-form-dialog.js +1 -1
  46. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  47. package/dist/cdn/foxy-gift-card-card.js +1 -1
  48. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  49. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  50. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  51. package/dist/cdn/foxy-gift-card-form.js +1 -1
  52. package/dist/cdn/foxy-i18n-editor.js +1 -1
  53. package/dist/cdn/foxy-i18n.js +1 -1
  54. package/dist/cdn/foxy-integration-card.js +1 -1
  55. package/dist/cdn/foxy-integration-form.js +1 -1
  56. package/dist/cdn/foxy-item-card.js +1 -1
  57. package/dist/cdn/foxy-item-category-card.js +1 -1
  58. package/dist/cdn/foxy-item-category-form.js +1 -1
  59. package/dist/cdn/foxy-item-form.js +179 -1
  60. package/dist/cdn/foxy-item-option-card.js +1 -1
  61. package/dist/cdn/foxy-item-option-form.js +1 -1
  62. package/dist/cdn/foxy-items-form.js +1 -1
  63. package/dist/cdn/foxy-native-integration-card.js +1 -1
  64. package/dist/cdn/foxy-native-integration-form.js +1 -1
  65. package/dist/cdn/foxy-nucleon-element.js +1 -1
  66. package/dist/cdn/foxy-pagination.js +1 -1
  67. package/dist/cdn/foxy-passkey-card.js +1 -1
  68. package/dist/cdn/foxy-passkey-form.js +1 -1
  69. package/dist/cdn/foxy-payment-card.js +1 -1
  70. package/dist/cdn/foxy-payment-method-card.js +1 -1
  71. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  72. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  73. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  74. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  75. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  76. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  77. package/dist/cdn/foxy-payments-api.js +1 -1
  78. package/dist/cdn/foxy-query-builder.js +1 -1
  79. package/dist/cdn/foxy-report-form.js +1 -1
  80. package/dist/cdn/foxy-reports-table.js +1 -1
  81. package/dist/cdn/foxy-shipment-card.js +1 -14
  82. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  83. package/dist/cdn/foxy-sign-in-form.js +1 -1
  84. package/dist/cdn/foxy-spinner.js +1 -1
  85. package/dist/cdn/foxy-store-card.js +1 -1
  86. package/dist/cdn/foxy-store-form.js +1 -1
  87. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  88. package/dist/cdn/foxy-subscription-card.js +1 -1
  89. package/dist/cdn/foxy-subscription-form.js +3 -3
  90. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  91. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  92. package/dist/cdn/foxy-table.js +1 -1
  93. package/dist/cdn/foxy-tax-card.js +1 -1
  94. package/dist/cdn/foxy-tax-form.js +1 -1
  95. package/dist/cdn/foxy-template-config-form.js +1 -1
  96. package/dist/cdn/foxy-template-form.js +1 -1
  97. package/dist/cdn/foxy-template-set-card.js +1 -1
  98. package/dist/cdn/foxy-template-set-form.js +1 -1
  99. package/dist/cdn/foxy-transaction-card.js +1 -1
  100. package/dist/cdn/foxy-transaction.js +1 -1
  101. package/dist/cdn/foxy-transactions-table.js +7 -7
  102. package/dist/cdn/foxy-user-card.js +1 -1
  103. package/dist/cdn/foxy-user-form.js +1 -1
  104. package/dist/cdn/foxy-users-table.js +1 -1
  105. package/dist/cdn/foxy-webhook-card.js +1 -1
  106. package/dist/cdn/foxy-webhook-form.js +1 -1
  107. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  108. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  109. package/dist/cdn/shared-0037b9e6.js +1 -0
  110. package/dist/cdn/{shared-a52c3d8c.js → shared-02f8245a.js} +1 -1
  111. package/dist/cdn/{shared-8c681381.js → shared-06916671.js} +1 -1
  112. package/dist/cdn/{shared-35728235.js → shared-07e9d1fb.js} +1 -1
  113. package/dist/cdn/{shared-1313f293.js → shared-0961f769.js} +1 -1
  114. package/dist/cdn/{shared-53d66db2.js → shared-0ffe26d8.js} +3 -3
  115. package/dist/cdn/{shared-4c2e9064.js → shared-1522d76f.js} +1 -1
  116. package/dist/cdn/{shared-51a5af7e.js → shared-15dfa16d.js} +1 -1
  117. package/dist/cdn/{shared-800ee6c0.js → shared-250a399a.js} +1 -1
  118. package/dist/cdn/shared-25edf241.js +1 -0
  119. package/dist/cdn/{shared-7d933f9d.js → shared-264c82b8.js} +1 -1
  120. package/dist/cdn/{shared-4b20fc75.js → shared-293771ba.js} +1 -1
  121. package/dist/cdn/{shared-5d718eaf.js → shared-29e74661.js} +1 -1
  122. package/dist/cdn/{shared-870074ff.js → shared-2c92c192.js} +1 -1
  123. package/dist/cdn/{shared-fd96bcd1.js → shared-30cbf0a6.js} +1 -1
  124. package/dist/cdn/{shared-92de4f37.js → shared-320fadbf.js} +1 -1
  125. package/dist/cdn/{shared-d123bea6.js → shared-324665fd.js} +1 -1
  126. package/dist/cdn/{shared-8771fb61.js → shared-3bd99d11.js} +1 -1
  127. package/dist/cdn/{shared-e8a85228.js → shared-3d251e6f.js} +1 -1
  128. package/dist/cdn/{shared-71b3559f.js → shared-3d95605f.js} +3 -3
  129. package/dist/cdn/{shared-f1b36324.js → shared-3f3903d4.js} +1 -1
  130. package/dist/cdn/{shared-d01f42d0.js → shared-3fee360a.js} +1 -1
  131. package/dist/cdn/shared-4105aacf.js +1 -0
  132. package/dist/cdn/shared-43e2c3f6.js +1 -0
  133. package/dist/cdn/{shared-5742a841.js → shared-452e38da.js} +1 -1
  134. package/dist/cdn/shared-4761cbda.js +1 -0
  135. package/dist/cdn/{shared-732bee4b.js → shared-5291bdca.js} +1 -1
  136. package/dist/cdn/{shared-417ab233.js → shared-54cbd346.js} +1 -1
  137. package/dist/cdn/{shared-1dbad347.js → shared-5db2fec0.js} +1 -1
  138. package/dist/cdn/{shared-c00049b2.js → shared-5f1f0d8f.js} +1 -1
  139. package/dist/cdn/{shared-c320cfef.js → shared-61b1fd60.js} +1 -1
  140. package/dist/cdn/{shared-e2db3ab5.js → shared-63d11888.js} +1 -1
  141. package/dist/cdn/{shared-ca428891.js → shared-69c3549d.js} +1 -1
  142. package/dist/cdn/{shared-9b12aeac.js → shared-6a7f96c4.js} +1 -1
  143. package/dist/cdn/{shared-fe927c53.js → shared-6d0be1e4.js} +1 -1
  144. package/dist/cdn/{shared-6e704d83.js → shared-6ffa9f84.js} +1 -1
  145. package/dist/cdn/{shared-21293163.js → shared-745a575c.js} +1 -1
  146. package/dist/cdn/{shared-4c3cb511.js → shared-835cf735.js} +1 -1
  147. package/dist/cdn/{shared-e60dc924.js → shared-85712eed.js} +1 -1
  148. package/dist/cdn/shared-87142858.js +1 -0
  149. package/dist/cdn/{shared-9771ef0f.js → shared-87824001.js} +1 -1
  150. package/dist/cdn/{shared-4d555419.js → shared-87f55237.js} +1 -1
  151. package/dist/cdn/{shared-7b771301.js → shared-8d99b885.js} +1 -1
  152. package/dist/cdn/{shared-fc99076a.js → shared-92dd9964.js} +1 -1
  153. package/dist/cdn/{shared-fed6cd4d.js → shared-979e24ec.js} +1 -1
  154. package/dist/cdn/{shared-5d795aaf.js → shared-a1be9c27.js} +1 -1
  155. package/dist/cdn/{shared-f3b8de28.js → shared-a1d39ddd.js} +1 -1
  156. package/dist/cdn/{shared-b8963ec6.js → shared-a5a03f4f.js} +1 -1
  157. package/dist/cdn/{shared-1105e4b9.js → shared-a95067d6.js} +1 -1
  158. package/dist/cdn/{shared-131988fc.js → shared-b113467e.js} +1 -1
  159. package/dist/cdn/{shared-5cf7b194.js → shared-b23c903e.js} +1 -1
  160. package/dist/cdn/{shared-96215749.js → shared-b984ab7c.js} +1 -1
  161. package/dist/cdn/shared-bab2ea2c.js +1 -0
  162. package/dist/cdn/{shared-783f5705.js → shared-c43cd1fa.js} +1 -1
  163. package/dist/cdn/{shared-da5e32c1.js → shared-ceec93fa.js} +1 -1
  164. package/dist/cdn/{shared-112dbca7.js → shared-d1265ca0.js} +1 -1
  165. package/dist/cdn/{shared-2f082f50.js → shared-d600815d.js} +1 -1
  166. package/dist/cdn/{shared-4e05dfb4.js → shared-d8ca5c87.js} +1 -1
  167. package/dist/cdn/{shared-1a65fd20.js → shared-d9f4138b.js} +1 -1
  168. package/dist/cdn/{shared-3bcc07cd.js → shared-db306674.js} +1 -1
  169. package/dist/cdn/{shared-18672d26.js → shared-de8bf756.js} +2 -2
  170. package/dist/cdn/{shared-f241722a.js → shared-e8621807.js} +1 -1
  171. package/dist/cdn/shared-e9276306.js +1 -0
  172. package/dist/cdn/{shared-76e71481.js → shared-ea1ab750.js} +1 -1
  173. package/dist/cdn/{shared-702eae16.js → shared-eacc4539.js} +1 -1
  174. package/dist/cdn/{shared-e8a51c60.js → shared-eb116b3e.js} +1 -1
  175. package/dist/cdn/{shared-e3096241.js → shared-ec59505f.js} +1 -1
  176. package/dist/cdn/{shared-662c576b.js → shared-ecd5eb1b.js} +2 -2
  177. package/dist/cdn/{shared-093b64b4.js → shared-efbd62cb.js} +4 -4
  178. package/dist/cdn/{shared-e006e82c.js → shared-f1e743df.js} +1 -1
  179. package/dist/cdn/shared-f3cd4d07.js +1 -0
  180. package/dist/cdn/{shared-cb9cdc88.js → shared-f8d1abc9.js} +1 -1
  181. package/dist/cdn/{shared-fff7db77.js → shared-fad099e6.js} +1 -1
  182. package/dist/cdn/{shared-b7556b77.js → shared-ff18b2d1.js} +1 -1
  183. package/dist/cdn/translations/billing-address-card/en.json +9 -0
  184. package/dist/cdn/translations/cart-form/en.json +211 -293
  185. package/dist/cdn/translations/customer/en.json +142 -29
  186. package/dist/cdn/translations/customer-portal/en.json +13 -33
  187. package/dist/cdn/translations/item-card/en.json +12 -1
  188. package/dist/cdn/translations/item-form/en.json +199 -292
  189. package/dist/cdn/translations/native-integration-card/en.json +6 -2
  190. package/dist/cdn/translations/native-integration-form/en.json +17 -1
  191. package/dist/cdn/translations/payment-card/en.json +4 -0
  192. package/dist/cdn/translations/shipment-card/en.json +5 -446
  193. package/dist/cdn/translations/store-form/en.json +1 -1
  194. package/dist/cdn/translations/subscription-form/en.json +12 -1
  195. package/dist/cdn/translations/template-config-form/en.json +2 -2
  196. package/dist/cdn/translations/transaction/en.json +1103 -857
  197. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.d.ts +2 -0
  198. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +23 -6
  199. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
  200. package/dist/elements/public/AttributeCard/AttributeCard.js +1 -1
  201. package/dist/elements/public/AttributeCard/AttributeCard.js.map +1 -1
  202. package/dist/elements/public/BillingAddressCard/BillingAddressCard.d.ts +15 -0
  203. package/dist/elements/public/BillingAddressCard/BillingAddressCard.js +28 -0
  204. package/dist/elements/public/BillingAddressCard/BillingAddressCard.js.map +1 -0
  205. package/dist/elements/public/BillingAddressCard/index.d.ts +4 -0
  206. package/dist/elements/public/BillingAddressCard/index.js +6 -0
  207. package/dist/elements/public/BillingAddressCard/index.js.map +1 -0
  208. package/dist/elements/public/BillingAddressCard/types.d.ts +3 -0
  209. package/dist/elements/public/BillingAddressCard/types.js +2 -0
  210. package/dist/elements/public/BillingAddressCard/types.js.map +1 -0
  211. package/dist/elements/public/CustomFieldCard/TwoLineCard.js +1 -1
  212. package/dist/elements/public/CustomFieldCard/TwoLineCard.js.map +1 -1
  213. package/dist/elements/public/I18n/I18n.d.ts +1 -0
  214. package/dist/elements/public/I18n/I18n.js +1 -0
  215. package/dist/elements/public/I18n/I18n.js.map +1 -1
  216. package/dist/elements/public/ItemCard/ItemCard.d.ts +2 -0
  217. package/dist/elements/public/ItemCard/ItemCard.js +68 -62
  218. package/dist/elements/public/ItemCard/ItemCard.js.map +1 -1
  219. package/dist/elements/public/ItemForm/ItemForm.d.ts +64 -12
  220. package/dist/elements/public/ItemForm/ItemForm.js +146 -28
  221. package/dist/elements/public/ItemForm/ItemForm.js.map +1 -1
  222. package/dist/elements/public/ItemForm/index.d.ts +7 -7
  223. package/dist/elements/public/ItemForm/index.js +7 -7
  224. package/dist/elements/public/ItemForm/index.js.map +1 -1
  225. package/dist/elements/public/ItemForm/types.d.ts +62 -2
  226. package/dist/elements/public/ItemForm/types.js.map +1 -1
  227. package/dist/elements/public/NativeIntegrationCard/NativeIntegrationCard.js +12 -10
  228. package/dist/elements/public/NativeIntegrationCard/NativeIntegrationCard.js.map +1 -1
  229. package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.d.ts +2 -0
  230. package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js +41 -8
  231. package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js.map +1 -1
  232. package/dist/elements/public/NativeIntegrationForm/defaults.d.ts +7 -1
  233. package/dist/elements/public/NativeIntegrationForm/defaults.js +7 -1
  234. package/dist/elements/public/NativeIntegrationForm/defaults.js.map +1 -1
  235. package/dist/elements/public/NativeIntegrationForm/types.d.ts +6 -2
  236. package/dist/elements/public/NativeIntegrationForm/types.js.map +1 -1
  237. package/dist/elements/public/Pagination/Pagination.js +65 -60
  238. package/dist/elements/public/Pagination/Pagination.js.map +1 -1
  239. package/dist/elements/public/PaymentCard/PaymentCard.d.ts +24 -36
  240. package/dist/elements/public/PaymentCard/PaymentCard.js +139 -158
  241. package/dist/elements/public/PaymentCard/PaymentCard.js.map +1 -1
  242. package/dist/elements/public/PaymentCard/index.d.ts +2 -2
  243. package/dist/elements/public/PaymentCard/index.js +2 -2
  244. package/dist/elements/public/PaymentCard/index.js.map +1 -1
  245. package/dist/elements/public/PaymentCard/types.d.ts +2 -16
  246. package/dist/elements/public/PaymentCard/types.js.map +1 -1
  247. package/dist/elements/public/ShipmentCard/ShipmentCard.d.ts +9 -13
  248. package/dist/elements/public/ShipmentCard/ShipmentCard.js +90 -91
  249. package/dist/elements/public/ShipmentCard/ShipmentCard.js.map +1 -1
  250. package/dist/elements/public/ShipmentCard/index.d.ts +2 -6
  251. package/dist/elements/public/ShipmentCard/index.js +2 -6
  252. package/dist/elements/public/ShipmentCard/index.js.map +1 -1
  253. package/dist/elements/public/ShipmentCard/types.d.ts +7 -2
  254. package/dist/elements/public/ShipmentCard/types.js.map +1 -1
  255. package/dist/elements/public/StoreForm/StoreForm.js +1 -1
  256. package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
  257. package/dist/elements/public/Transaction/Transaction.d.ts +11 -3
  258. package/dist/elements/public/Transaction/Transaction.js +238 -78
  259. package/dist/elements/public/Transaction/Transaction.js.map +1 -1
  260. package/dist/elements/public/Transaction/index.d.ts +4 -3
  261. package/dist/elements/public/Transaction/index.js +4 -3
  262. package/dist/elements/public/Transaction/index.js.map +1 -1
  263. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.d.ts +1 -0
  264. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js +17 -4
  265. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js.map +1 -1
  266. package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/InternalTransactionCustomerControl.d.ts +7 -1
  267. package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/InternalTransactionCustomerControl.js +81 -24
  268. package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/InternalTransactionCustomerControl.js.map +1 -1
  269. package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/index.d.ts +3 -3
  270. package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/index.js +3 -3
  271. package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/index.js.map +1 -1
  272. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/InternalTransactionPostActionControl.js +1 -1
  273. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/InternalTransactionPostActionControl.js.map +1 -1
  274. package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.d.ts +5 -3
  275. package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js +110 -61
  276. package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js.map +1 -1
  277. package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/index.d.ts +1 -0
  278. package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/index.js +1 -0
  279. package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/index.js.map +1 -1
  280. package/dist/elements/public/Transaction/types.d.ts +14 -1
  281. package/dist/elements/public/Transaction/types.js.map +1 -1
  282. package/dist/elements/public/index.d.ts +1 -0
  283. package/dist/elements/public/index.defined.d.ts +1 -0
  284. package/dist/elements/public/index.defined.js +1 -0
  285. package/dist/elements/public/index.defined.js.map +1 -1
  286. package/dist/elements/public/index.js +1 -0
  287. package/dist/elements/public/index.js.map +1 -1
  288. package/dist/mixins/themeable.js +16 -0
  289. package/dist/mixins/themeable.js.map +1 -1
  290. package/package.json +1 -1
  291. package/dist/cdn/shared-074a74c3.js +0 -82
  292. package/dist/cdn/shared-26dea180.js +0 -1
  293. package/dist/cdn/shared-468de081.js +0 -1
  294. package/dist/cdn/shared-5e932eb5.js +0 -1
  295. package/dist/cdn/shared-8a9c64b2.js +0 -1
  296. package/dist/cdn/shared-e312da08.js +0 -1
  297. package/dist/cdn/shared-e79b5765.js +0 -1
  298. package/dist/elements/public/ItemForm/internal/InternalItemFormCartControl/InternalItemFormCartControl.d.ts +0 -5
  299. package/dist/elements/public/ItemForm/internal/InternalItemFormCartControl/InternalItemFormCartControl.js +0 -17
  300. package/dist/elements/public/ItemForm/internal/InternalItemFormCartControl/InternalItemFormCartControl.js.map +0 -1
  301. package/dist/elements/public/ItemForm/internal/InternalItemFormCartControl/index.d.ts +0 -6
  302. package/dist/elements/public/ItemForm/internal/InternalItemFormCartControl/index.js +0 -8
  303. package/dist/elements/public/ItemForm/internal/InternalItemFormCartControl/index.js.map +0 -1
  304. package/dist/elements/public/ItemForm/internal/InternalItemFormInventoryControl/InternalItemFormInventoryControl.d.ts +0 -5
  305. package/dist/elements/public/ItemForm/internal/InternalItemFormInventoryControl/InternalItemFormInventoryControl.js +0 -25
  306. package/dist/elements/public/ItemForm/internal/InternalItemFormInventoryControl/InternalItemFormInventoryControl.js.map +0 -1
  307. package/dist/elements/public/ItemForm/internal/InternalItemFormInventoryControl/index.d.ts +0 -5
  308. package/dist/elements/public/ItemForm/internal/InternalItemFormInventoryControl/index.js +0 -7
  309. package/dist/elements/public/ItemForm/internal/InternalItemFormInventoryControl/index.js.map +0 -1
  310. package/dist/elements/public/ItemForm/internal/InternalItemFormLineItemDiscountControl/InternalItemFormLineItemDiscountControl.d.ts +0 -5
  311. package/dist/elements/public/ItemForm/internal/InternalItemFormLineItemDiscountControl/InternalItemFormLineItemDiscountControl.js +0 -52
  312. package/dist/elements/public/ItemForm/internal/InternalItemFormLineItemDiscountControl/InternalItemFormLineItemDiscountControl.js.map +0 -1
  313. package/dist/elements/public/ItemForm/internal/InternalItemFormLineItemDiscountControl/index.d.ts +0 -6
  314. package/dist/elements/public/ItemForm/internal/InternalItemFormLineItemDiscountControl/index.js +0 -8
  315. package/dist/elements/public/ItemForm/internal/InternalItemFormLineItemDiscountControl/index.js.map +0 -1
  316. package/dist/elements/public/ItemForm/internal/InternalItemFormShippingControl/InternalItemFormShippingControl.d.ts +0 -5
  317. package/dist/elements/public/ItemForm/internal/InternalItemFormShippingControl/InternalItemFormShippingControl.js +0 -26
  318. package/dist/elements/public/ItemForm/internal/InternalItemFormShippingControl/InternalItemFormShippingControl.js.map +0 -1
  319. package/dist/elements/public/ItemForm/internal/InternalItemFormShippingControl/index.d.ts +0 -5
  320. package/dist/elements/public/ItemForm/internal/InternalItemFormShippingControl/index.js +0 -7
  321. package/dist/elements/public/ItemForm/internal/InternalItemFormShippingControl/index.js.map +0 -1
  322. package/dist/elements/public/ItemForm/internal/InternalItemFormSubscriptionControl/InternalItemFormSubscriptionControl.d.ts +0 -5
  323. package/dist/elements/public/ItemForm/internal/InternalItemFormSubscriptionControl/InternalItemFormSubscriptionControl.js +0 -72
  324. package/dist/elements/public/ItemForm/internal/InternalItemFormSubscriptionControl/InternalItemFormSubscriptionControl.js.map +0 -1
  325. package/dist/elements/public/ItemForm/internal/InternalItemFormSubscriptionControl/index.d.ts +0 -8
  326. package/dist/elements/public/ItemForm/internal/InternalItemFormSubscriptionControl/index.js +0 -10
  327. package/dist/elements/public/ItemForm/internal/InternalItemFormSubscriptionControl/index.js.map +0 -1
@@ -1 +1,179 @@
1
- import"./shared-fff7db77.js";import"./shared-e312da08.js";import"./shared-8771fb61.js";import"./shared-f1b36324.js";import{I as t}from"./shared-870074ff.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-coupon-card.js";import"./shared-da5e32c1.js";import{I as e}from"./shared-21293163.js";import"./foxy-discount-builder.js";import{i as r}from"./shared-d3bf9ac0.js";import{h as o}from"./shared-7f33a83a.js";import"./shared-5d718eaf.js";import"./shared-d01f42d0.js";import{_ as i}from"./shared-4c2e9064.js";import{s as n}from"./shared-79d0699c.js";import{p as s}from"./shared-e79b5765.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import{a}from"./shared-662c576b.js";import"./shared-c00049b2.js";import"./shared-e60dc924.js";import"./shared-f3b8de28.js";import"./shared-e3096241.js";import"./shared-7d933f9d.js";import"./shared-fc99076a.js";import"./shared-732bee4b.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-fe927c53.js";import"./shared-417ab233.js";import"./shared-51a5af7e.js";import"./shared-343d1fd7.js";import"./shared-fd96bcd1.js";import"./shared-5cf7b194.js";import"./shared-9b12aeac.js";import"./shared-35728235.js";import"./shared-3ab0306f.js";import"./shared-e8a51c60.js";import"./shared-d519a301.js";import"./shared-11c2efc8.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-4e709717.js";import"./shared-4e05dfb4.js";import"./shared-8c681381.js";import"./shared-702eae16.js";import"./shared-f9180815.js";import"./shared-468de081.js";import"./shared-112dbca7.js";import"./foxy-nucleon-element.js";import"./shared-53d66db2.js";import"./shared-6e704d83.js";import"./shared-5742a841.js";import"./shared-1dbad347.js";import"./shared-96215749.js";import"./shared-71b3559f.js";import"./shared-e2db3ab5.js";import"./shared-7b771301.js";import"./shared-1313f293.js";import"./shared-fed6cd4d.js";import"./shared-bb05cfed.js";import"./shared-5e932eb5.js";import"./foxy-cancellation-form.js";import"./foxy-transaction-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-26dea180.js";import"./shared-e006e82c.js";import"./shared-800ee6c0.js";let l,c=t=>t;customElements.define("foxy-internal-item-form-line-item-discount-control",class extends e{renderControl(){var t,e,i,n,s;return o(l||(l=c` <div class="space-y-m"> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" first="${0}" infer="coupon" @change="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="discount-name"></foxy-internal-text-control> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> </div> `),r(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.coupons)&&void 0!==e?e:void 0),(t=>{var e;t.preventDefault();const r=t.detail;null===(e=this.nucleon)||void 0===e||e.edit({discount_name:r.name,discount_type:r.coupon_discount_type,discount_details:r.coupon_discount_details})}),{type:null===(i=this.nucleon)||void 0===i?void 0:i.form.discount_type,name:null===(n=this.nucleon)||void 0===n?void 0:n.form.discount_name,details:null===(s=this.nucleon)||void 0===s?void 0:s.form.discount_details},(t=>{var e;const r=t.currentTarget.parsedValue;null===(e=this.nucleon)||void 0===e||e.edit({discount_name:r.name,discount_type:r.type,discount_details:r.details})}))}});let d,f=t=>t;customElements.define("foxy-internal-date-control",class extends e{constructor(){super(...arguments),this.format=null}static get properties(){return i(i({},super.properties),{},{format:{type:String}})}renderControl(){var t;let e;return e="unix"===this.format?n(new Date(1e3*(null!==(t=this._value)&&void 0!==t?t:0))):this._value,o(d||(d=f` <vaadin-date-picker error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @change="${0}"> </vaadin-date-picker> `),r(this._errorMessage),this.placeholder,this.helperText,this.label,this.disabled,this.readonly,this._checkValidity,e,(t=>{var e;return"Enter"===t.key&&(null===(e=this.nucleon)||void 0===e?void 0:e.submit())}),(t=>{var e,r;const o=t.currentTarget;"unix"===this.format?this._value=Math.floor((null!==(r=null===(e=s(o.value))||void 0===e?void 0:e.getTime())&&void 0!==r?r:0)/1e3):this._value=o.value}))}});let m,p,u,h=t=>t;customElements.define("foxy-internal-item-form-subscription-control",class extends e{renderControl(){var t,e,r,i,n;let s;try{const o=null!==(i=null===(r=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links)["fx:subscription"])||void 0===r?void 0:r.href)&&void 0!==i?i:"",n=new URL(o);n.searchParams.set("zoom","last_transaction,transaction_template:items"),s=n.toString()}catch(t){s=null}return o(m||(m=h` ${0} `),s?o(p||(p=h` <div class="space-y-xs"> <foxy-i18n infer="" class="text-s font-medium text-secondary leading-none" key="title"> </foxy-i18n> <foxy-form-dialog header="update" infer="form" href="${0}" form="foxy-subscription-form" .related="${0}"> </foxy-form-dialog> <button ?disabled="${0}" class="transition-colors rounded w-full bg-contrast-5 hover-bg-contrast-10 focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" @click="${0}"> <foxy-subscription-card infer="card" href="${0}"> </foxy-subscription-card> </button> </div> `),s,(null===(n=this.nucleon)||void 0===n?void 0:n.href)?[this.nucleon.href]:[],this.disabled,(t=>{const e=t.currentTarget;e.previousElementSibling.show(e)}),s):o(u||(u=h` <div class="space-y-m"> <foxy-internal-frequency-control infer="frequency" property="subscription_frequency"> </foxy-internal-frequency-control> <foxy-internal-date-control infer="start" property="subscription_start_date"> </foxy-internal-date-control> <foxy-internal-date-control infer="end" property="subscription_end_date"> </foxy-internal-date-control> <foxy-internal-date-control infer="next" property="subscription_next_transaction_date"> </foxy-internal-date-control> </div> `)))}});let y,x=t=>t;customElements.define("foxy-internal-item-form-inventory-control",class extends e{renderControl(){var t,e;return o(y||(y=x` <div class="grid grid-cols-2 gap-m"> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" property="item_category_uri" first="${0}" class="col-span-2" infer="category"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-text-control infer="parent-code"></foxy-internal-text-control> </div> `),r(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.itemCategories)&&void 0!==e?e:void 0))}});let b,v=t=>t;customElements.define("foxy-internal-item-form-shipping-control",class extends e{renderControl(){var t,e;return o(b||(b=v` <div class="grid grid-cols-2 gap-m"> <foxy-internal-async-combo-box-control item-value-path="address_name" item-label-path="address_name" first="${0}" class="col-span-2" infer="shipto"> </foxy-internal-async-combo-box-control> <foxy-internal-integer-control infer="width"></foxy-internal-integer-control> <foxy-internal-integer-control infer="height"></foxy-internal-integer-control> <foxy-internal-integer-control infer="length"></foxy-internal-integer-control> <foxy-internal-integer-control infer="weight"></foxy-internal-integer-control> </div> `),r(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.customerAddresses)&&void 0!==e?e:void 0))}});let _,j=t=>t;customElements.define("foxy-internal-item-form-cart-control",class extends e{renderControl(){return o(_||(_=j` <div class="grid grid-cols-2 gap-m"> <foxy-internal-date-control class="col-span-2" infer="expires" format="unix"> </foxy-internal-date-control> <foxy-internal-text-control class="col-span-2" infer="url"></foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="image"></foxy-internal-text-control> <foxy-internal-integer-control infer="quantity-min"></foxy-internal-integer-control> <foxy-internal-integer-control infer="quantity-max"></foxy-internal-integer-control> </div> `))}});let g,$,k,w=t=>t;class C extends(a(t,"item-form")){constructor(){super(...arguments),this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.coupons=null,this.__itemsLink=""}static get properties(){return i(i({},super.properties),{},{customerAddresses:{type:String,attribute:"customer-addresses"},itemCategories:{type:String,attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},coupons:{type:String}})}static get v8n(){return[({name:t})=>!!t||"name:v8n_required",({name:t})=>!!t&&t.length<=255||"name:v8n_too_long",({price:t})=>"number"==typeof t&&!isNaN(t)||"price:v8n_required",({price:t})=>"number"==typeof t&&t>=0||"price:v8n_negative",({quantity:t})=>"number"==typeof t&&t>=1||"quantity:v8n_less_than_one"]}renderBody(){var t;return o(g||(g=w` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-m"> <foxy-internal-number-control infer="price"></foxy-internal-number-control> <foxy-internal-integer-control infer="quantity"></foxy-internal-integer-control> </div> <foxy-internal-item-form-subscription-control infer="subscription"> </foxy-internal-item-form-subscription-control> ${0} <foxy-internal-item-form-line-item-discount-control infer="line-item-discount"> </foxy-internal-item-form-line-item-discount-control> <foxy-internal-item-form-cart-control infer="cart"></foxy-internal-item-form-cart-control> <foxy-internal-item-form-shipping-control infer="shipping"> </foxy-internal-item-form-shipping-control> <foxy-internal-item-form-inventory-control infer="inventory"> </foxy-internal-item-form-inventory-control> ${0} ${0} `),this.data?o($||($=w` <foxy-internal-async-list-control label="${0}" infer="item-options" first="${0}" limit="5" form="foxy-item-option-form" item="foxy-item-option-card" alert .related="${0}" .props="${0}"> </foxy-internal-async-list-control> `),this.t("item-options.title"),this.data._links["fx:item_options"].href,this.__itemOptionRelatedUrls,{"locale-codes":null!==(t=this.localeCodes)&&void 0!==t?t:""}):"",this.data?o(k||(k=w` <foxy-internal-async-list-control label="${0}" infer="discount-details" first="${0}" limit="5" item="foxy-discount-detail-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control label="${0}" infer="coupon-details" first="${0}" limit="5" item="foxy-coupon-detail-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control label="${0}" infer="attributes" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> `),this.t("discount-details.title"),this.data._links["fx:discount_details"].href,this.t("coupon-details.title"),this.data._links["fx:coupon_details"].href,this.t("attributes.title"),this.data._links["fx:attributes"].href):"",super.renderBody())}async _sendGet(){const t=await super._sendGet();if(t._links["fx:subscription"]){const e=t._links["fx:subscription"].href,r=(await super._fetch(e))._links["fx:transaction_template"].href,o=await super._fetch(r);return this.__itemsLink=o._links["fx:items"].href,t}if(t._links["fx:transaction"]){const e=await super._fetch(t._links["fx:transaction"].href);return this.__itemsLink=e._links["fx:items"].href,t}if(t._links["fx:cart"]){const e=await super._fetch(t._links["fx:cart"].href);return this.__itemsLink=e._links["fx:items"].href,t}return t}get __itemOptionRelatedUrls(){var t,e;const r=null!==(e=null===(t=this.data)||void 0===t?void 0:t._links)&&void 0!==e?e:{},o=[];return r["fx:subscription"]&&o.push(r["fx:subscription"].href),r["fx:transaction"]&&o.push(r["fx:transaction"].href),r["fx:shipment"]&&o.push(r["fx:shipment"].href),r["fx:cart"]&&o.push(r["fx:cart"].href),this.__itemsLink&&o.push(this.__itemsLink),o}}customElements.define("foxy-item-form",C);export{C as ItemForm};
1
+ import{C as e,E as t,T as r}from"./shared-ec59505f.js";import"./shared-85712eed.js";import{h as o,P as i}from"./shared-a1d39ddd.js";import"./shared-ceec93fa.js";import"./shared-f3cd4d07.js";import"./shared-29e74661.js";import"./shared-69c3549d.js";import"./shared-fad099e6.js";import"./shared-3bd99d11.js";import"./shared-3f3903d4.js";import"./shared-3fee360a.js";import{I as s}from"./shared-745a575c.js";import{_ as a}from"./shared-1522d76f.js";import{s as n}from"./shared-79d0699c.js";import{p as l}from"./shared-43e2c3f6.js";import{i as d}from"./shared-d3bf9ac0.js";import{h as m}from"./shared-7f33a83a.js";import{I as c}from"./shared-2c92c192.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-discount-builder.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import{a as p}from"./shared-ecd5eb1b.js";import"./shared-b984ab7c.js";import"./shared-3d95605f.js";import"./shared-6d0be1e4.js";import"./shared-264c82b8.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-5291bdca.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-54cbd346.js";import"./shared-15dfa16d.js";import"./shared-30cbf0a6.js";import"./shared-b23c903e.js";import"./shared-6a7f96c4.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-d519a301.js";import"./shared-11c2efc8.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-d8ca5c87.js";import"./shared-06916671.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-5f1f0d8f.js";import"./shared-92dd9964.js";import"./shared-5db2fec0.js";import"./shared-0ffe26d8.js";import"./shared-63d11888.js";import"./shared-8d99b885.js";import"./shared-452e38da.js";import"./shared-6ffa9f84.js";import"./shared-eacc4539.js";import"./shared-f9180815.js";import"./shared-25edf241.js";import"./shared-d1265ca0.js";import"./shared-bb05cfed.js";import"./foxy-nucleon-element.js";import"./shared-0961f769.js";import"./shared-979e24ec.js";const f=o`<dom-module id="lumo-details" theme-for="vaadin-details">
2
+ <template>
3
+ <style>
4
+ :host {
5
+ margin: var(--lumo-space-xs) 0;
6
+ outline: none;
7
+ }
8
+
9
+ [part="summary"] {
10
+ display: flex;
11
+ align-items: center;
12
+ width: 100%;
13
+ outline: none;
14
+ padding: var(--lumo-space-s) 0;
15
+ box-sizing: border-box;
16
+ font-family: var(--lumo-font-family);
17
+ font-size: var(--lumo-font-size-m);
18
+ font-weight: 500;
19
+ line-height: var(--lumo-line-height-xs);
20
+ color: var(--lumo-secondary-text-color);
21
+ background-color: inherit;
22
+ border-radius: var(--lumo-border-radius-m);
23
+ cursor: default;
24
+ -webkit-tap-highlight-color: transparent;
25
+ -webkit-font-smoothing: antialiased;
26
+ -moz-osx-font-smoothing: grayscale;
27
+ }
28
+
29
+ :host([focus-ring]) [part="summary"] {
30
+ box-shadow: 0 0 0 2px var(--lumo-primary-color-50pct);
31
+ }
32
+
33
+ [part="toggle"] {
34
+ display: block;
35
+ width: 1em;
36
+ height: 1em;
37
+ margin-left: calc(var(--lumo-space-xs) * -1);
38
+ margin-right: var(--lumo-space-xs);
39
+ font-size: var(--lumo-icon-size-s);
40
+ line-height: 1;
41
+ color: var(--lumo-contrast-60pct);
42
+ font-family: "lumo-icons";
43
+ }
44
+
45
+ :host([disabled]) [part="summary"],
46
+ :host([disabled]) [part="toggle"] {
47
+ color: var(--lumo-disabled-text-color);
48
+ }
49
+
50
+ @media (hover: hover) {
51
+ :host(:not([disabled])) [part="summary"]:hover,
52
+ :host(:not([disabled])) [part="summary"]:hover [part="toggle"] {
53
+ color: var(--lumo-contrast-80pct);
54
+ }
55
+ }
56
+
57
+ [part="toggle"]::before {
58
+ content: var(--lumo-icons-angle-right);
59
+ }
60
+
61
+ :host([opened]) [part="toggle"] {
62
+ transform: rotate(90deg);
63
+ }
64
+
65
+ [part="content"] {
66
+ padding: var(--lumo-space-xs) 0 var(--lumo-space-s);
67
+ font-size: var(--lumo-font-size-m);
68
+ line-height: var(--lumo-line-height-m);
69
+ }
70
+
71
+ :host([theme~="filled"]) {
72
+ background-color: var(--lumo-contrast-5pct);
73
+ border-radius: var(--lumo-border-radius-m);
74
+ }
75
+
76
+ :host([theme~="filled"]) [part="summary"] {
77
+ padding: var(--lumo-space-s) calc(var(--lumo-space-s) + var(--lumo-space-xs) / 2);
78
+ }
79
+
80
+ :host([theme~="filled"]) [part="content"] {
81
+ padding-left: var(--lumo-space-m);
82
+ padding-right: var(--lumo-space-m);
83
+ }
84
+
85
+ :host([theme~="small"]) [part="summary"] {
86
+ padding-top: var(--lumo-space-xs);
87
+ padding-bottom: var(--lumo-space-xs);
88
+ }
89
+
90
+ :host([theme~="small"]) [part="toggle"] {
91
+ margin-right: calc(var(--lumo-space-xs) / 2);
92
+ }
93
+
94
+ :host([theme~="small"]) [part\$="content"] {
95
+ font-size: var(--lumo-font-size-s);
96
+ }
97
+
98
+ :host([theme~="reverse"]) [part="summary"] {
99
+ justify-content: space-between;
100
+ }
101
+
102
+ :host([theme~="reverse"]) [part="toggle"] {
103
+ order: 1;
104
+ margin-right: 0;
105
+ }
106
+
107
+ :host([theme~="reverse"][theme~="filled"]) [part="summary"] {
108
+ padding-left: var(--lumo-space-m);
109
+ }
110
+
111
+ /* RTL specific styles */
112
+
113
+ :host([dir="rtl"]) [part="toggle"] {
114
+ margin-left: var(--lumo-space-xs);
115
+ margin-right: calc(var(--lumo-space-xs) * -1);
116
+ }
117
+
118
+ :host([dir="rtl"]) [part="toggle"]::before {
119
+ content: var(--lumo-icons-angle-left);
120
+ }
121
+
122
+ :host([opened][dir="rtl"]) [part="toggle"] {
123
+ transform: rotate(-90deg);
124
+ }
125
+
126
+ :host([theme~="small"][dir="rtl"]) [part="toggle"] {
127
+ margin-left: calc(var(--lumo-space-xs) / 2);
128
+ }
129
+
130
+ :host([theme~="reverse"][dir="rtl"]) [part="toggle"] {
131
+ margin-left: 0;
132
+ }
133
+
134
+ :host([theme~="reverse"][theme~="filled"][dir="rtl"]) [part="summary"] {
135
+ padding-right: var(--lumo-space-m);
136
+ }
137
+
138
+ </style>
139
+ </template>
140
+ </dom-module>`;document.head.appendChild(f.content);
141
+ /**
142
+ @license
143
+ Copyright (c) 2019 Vaadin Ltd.
144
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
145
+ */
146
+ class h extends(e(t(r(i)))){static get template(){return o`
147
+ <style>
148
+ :host {
149
+ display: block;
150
+ }
151
+
152
+ :host([hidden]) {
153
+ display: none !important;
154
+ }
155
+
156
+ [part="content"] {
157
+ display: none;
158
+ overflow: hidden;
159
+ }
160
+
161
+ [part="summary"][disabled] {
162
+ pointer-events: none;
163
+ }
164
+
165
+ :host([opened]) [part="content"] {
166
+ display: block;
167
+ overflow: visible;
168
+ }
169
+ </style>
170
+ <div role="heading">
171
+ <div role="button" part="summary" on-click="_onToggleClick" on-keydown="_onToggleKeyDown" disabled\$="[[disabled]]" aria-expanded\$="[[_getAriaExpanded(opened)]]">
172
+ <span part="toggle"></span>
173
+ <span part="summary-content"><slot name="summary"></slot></span>
174
+ </div>
175
+ </div>
176
+ <div part="content" aria-hidden\$="[[_getAriaHidden(opened)]]">
177
+ <slot></slot>
178
+ </div>
179
+ `}static get is(){return"vaadin-details"}static get version(){return"1.2.1"}static get properties(){return{opened:{type:Boolean,value:!1,reflectToAttribute:!0,notify:!0,observer:"_openedChanged"}}}get _collapsible(){return this.shadowRoot.querySelector('[part="content"]')}get focusElement(){return this.shadowRoot.querySelector('[part="summary"]')}_focus(){this.focusElement&&!this._isShiftTabbing&&(this._keyboardActive&&this.focusElement.focus(),this._setFocused(!0))}ready(){super.ready(),this._collapsible.addEventListener("keydown",(e=>{e.shiftKey&&9===e.keyCode&&e.stopPropagation()}))}_getAriaExpanded(e){return e?"true":"false"}_getAriaHidden(e){return e?"false":"true"}_openedChanged(e){this._collapsible.style.maxHeight=e?"":"0px"}_onToggleClick(e){this.opened=!this.opened}_onToggleKeyDown(e){[13,32].indexOf(e.keyCode)>-1&&(e.preventDefault(),this.opened=!this.opened)}}customElements.define(h.is,h);let u,y=e=>e;customElements.define("foxy-internal-date-control",class extends s{constructor(){super(...arguments),this.format=null}static get properties(){return a(a({},super.properties),{},{format:{type:String}})}renderControl(){var e;let t;return t="unix"===this.format?n(new Date(1e3*(null!==(e=this._value)&&void 0!==e?e:0))):this._value,m(u||(u=y` <vaadin-date-picker error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @change="${0}"> </vaadin-date-picker> `),d(this._errorMessage),this.placeholder,this.helperText,this.label,this.disabled,this.readonly,this._checkValidity,t,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{var t,r;const o=e.currentTarget;"unix"===this.format?this._value=Math.floor((null!==(r=null===(t=l(o.value))||void 0===t?void 0:t.getTime())&&void 0!==r?r:0)/1e3):this._value=o.value}))}});let x,g,v,b=e=>e;class _ extends(p(c,"item-form")){constructor(){super(...arguments),this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.coupons=null,this.templates={},this.__itemsLink=""}static get properties(){return a(a({},super.properties),{},{customerAddresses:{type:String,attribute:"customer-addresses"},itemCategories:{type:String,attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},coupons:{type:String}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!!e&&e.length<=255||"name:v8n_too_long",({price:e})=>"number"==typeof e&&!isNaN(e)||"price:v8n_required",({price:e})=>"number"==typeof e&&e>=0||"price:v8n_negative",({quantity:e})=>"number"==typeof e&&e>=1||"quantity:v8n_less_than_one"]}renderBody(){var e,t,r;return m(x||(x=b` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-s"> <foxy-internal-number-control infer="price"></foxy-internal-number-control> <foxy-internal-integer-control infer="quantity"></foxy-internal-integer-control> </div> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" first="${0}" infer="item-category-uri"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-text-control infer="parent-code"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-s"> <foxy-internal-integer-control infer="quantity-min"></foxy-internal-integer-control> <foxy-internal-integer-control infer="quantity-max"></foxy-internal-integer-control> </div> <div> <vaadin-details theme="reverse"> <foxy-i18n infer="" slot="summary" key="dimensions"></foxy-i18n> <div class="grid grid-cols-2 gap-s pt-m"> <foxy-internal-number-control infer="weight"></foxy-internal-number-control> <foxy-internal-number-control infer="width"></foxy-internal-number-control> <foxy-internal-number-control infer="height"></foxy-internal-number-control> <foxy-internal-number-control infer="length"></foxy-internal-number-control> </div> </vaadin-details> <vaadin-details theme="reverse"> <foxy-i18n infer="" slot="summary" key="subscriptions"></foxy-i18n> <div class="space-y-m pt-m"> <foxy-internal-frequency-control infer="subscription-frequency"> </foxy-internal-frequency-control> <foxy-internal-date-control infer="subscription-start-date"> </foxy-internal-date-control> <foxy-internal-date-control infer="subscription-end-date"></foxy-internal-date-control> </div> </vaadin-details> </div> <foxy-internal-text-area-control infer="url"></foxy-internal-text-area-control> <foxy-internal-text-area-control infer="image"></foxy-internal-text-area-control> <vaadin-details theme="reverse"> <foxy-i18n infer="" slot="summary" key="discount"></foxy-i18n> <div class="space-y-m pt-m"> <foxy-internal-text-control infer="discount-name"></foxy-internal-text-control> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> </div> </vaadin-details> <foxy-internal-async-combo-box-control item-value-path="address_name" item-label-path="address_name" first="${0}" infer="shipto"> </foxy-internal-async-combo-box-control> <foxy-internal-date-control infer="expires" format="unix"></foxy-internal-date-control> ${0} ${0} ${0} `),d(null!==(e=null==this?void 0:this.itemCategories)&&void 0!==e?e:void 0),{details:this.form.discount_details,type:this.form.discount_type,name:this.form.discount_name},(e=>{const t=e.currentTarget.parsedValue;this.edit({discount_details:t.details,discount_type:t.type,discount_name:t.name})}),d(null!==(t=null==this?void 0:this.customerAddresses)&&void 0!==t?t:void 0),this.data?m(g||(g=b` <foxy-internal-async-list-control label="${0}" infer="item-options" first="${0}" limit="5" form="foxy-item-option-form" item="foxy-item-option-card" alert .related="${0}" .props="${0}"> </foxy-internal-async-list-control> `),this.t("item-options.title"),this.data._links["fx:item_options"].href,this.__itemOptionRelatedUrls,{"locale-codes":null!==(r=this.localeCodes)&&void 0!==r?r:""}):"",this.data?m(v||(v=b` <foxy-internal-async-list-control label="${0}" infer="discount-details" first="${0}" limit="5" item="foxy-discount-detail-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control label="${0}" infer="coupon-details" first="${0}" limit="5" item="foxy-coupon-detail-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control label="${0}" infer="attributes" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> `),this.t("discount-details.title"),this.data._links["fx:discount_details"].href,this.t("coupon-details.title"),this.data._links["fx:coupon_details"].href,this.t("attributes.title"),this.data._links["fx:attributes"].href):"",super.renderBody())}async _sendGet(){const e=await super._sendGet();if(e._links["fx:subscription"]){const t=e._links["fx:subscription"].href,r=(await super._fetch(t))._links["fx:transaction_template"].href,o=await super._fetch(r);return this.__itemsLink=o._links["fx:items"].href,e}if(e._links["fx:transaction"]){const t=await super._fetch(e._links["fx:transaction"].href);return this.__itemsLink=t._links["fx:items"].href,e}if(e._links["fx:cart"]){const t=await super._fetch(e._links["fx:cart"].href);return this.__itemsLink=t._links["fx:items"].href,e}return e}get __itemOptionRelatedUrls(){var e,t;const r=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links)&&void 0!==t?t:{},o=[];return r["fx:subscription"]&&o.push(r["fx:subscription"].href),r["fx:transaction"]&&o.push(r["fx:transaction"].href),r["fx:shipment"]&&o.push(r["fx:shipment"].href),r["fx:cart"]&&o.push(r["fx:cart"].href),this.__itemsLink&&o.push(this.__itemsLink),o}}customElements.define("foxy-item-form",_);export{_ as ItemForm};
@@ -1 +1 @@
1
- import"./shared-f9180815.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import{_ as e}from"./shared-4c2e9064.js";import{a as t}from"./shared-662c576b.js";import{T as r}from"./shared-468de081.js";import{i as o}from"./shared-d3bf9ac0.js";import{h as a}from"./shared-7f33a83a.js";import"./shared-9b12aeac.js";import"./shared-35728235.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-fd96bcd1.js";import"./shared-e8a51c60.js";import"./shared-fe927c53.js";import"./shared-f3b8de28.js";import"./shared-417ab233.js";import"./shared-51a5af7e.js";import"./shared-5cf7b194.js";import"./shared-112dbca7.js";import"./shared-4e709717.js";let i,d,s,l,n=e=>e;const c=t(r,"item-option-card");class u extends c{constructor(){super(...arguments),this.localeCodes=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__transactionLoaderId="transactionLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__cartLoaderId="cartLoader"}static get properties(){return e(e({},super.properties),{},{localeCodes:{attribute:"locale-codes"}})}renderBody(){const e=this.__currencyDisplay,t=this.__currencyCode;return a(i||(i=n` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} `),o(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),o(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),o(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),o(this.__transactionHref),this.__transactionLoaderId,(()=>this.requestUpdate()),o(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),o(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),o(this.__cartHref),this.__cartLoaderId,(()=>this.requestUpdate()),super.renderBody({title:r=>{if(!t||!e)return a(d||(d=n`&ZeroWidthSpace;`));let o;try{o=Math.abs(r.price_mod).toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:e,currency:t,style:"currency"})}catch(e){o="--"}return a(s||(s=n`${0} &bull; ${0} &bull; ${0}`),r.name,o,r.weight_mod)},subtitle:e=>a(l||(l=n`${0}`),e.value)}))}get isBodyReady(){return super.isBodyReady&&!!this.__currencyCode&&!!this.__currencyDisplay}get __transactionTemplateHref(){var e,t,r;try{const o=null===(e=this.data)||void 0===e?void 0:e._links,a=new URL(null!==(r=null===(t=null==o?void 0:o["fx:subscription"])||void 0===t?void 0:t.href)&&void 0!==r?r:"");return a.searchParams.set("zoom","transaction_template"),a.toString()}catch(e){}}get __defaultTemplateSetHref(){var e,t,r,o;if(""===(null===(t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate)||void 0===t?void 0:t.template_set_uri))try{const e=new URL(null!==(o=null===(r=this.__store)||void 0===r?void 0:r._links["fx:template_sets"].href)&&void 0!==o?o:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __transactionHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transaction"])||void 0===t?void 0:t.href}get __templateSetHref(){var e;const t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(!(null==t?void 0:t.currency_code))return(null==t?void 0:t.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __cartHref(){var e,t;const r=null===(e=this.data)||void 0===e?void 0:e._links;return null===(t=null==r?void 0:r["fx:cart"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t;const r=`#${this.__transactionTemplateLoaderId}`,o=this.renderRoot.querySelector(r);return null!==(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._embedded["fx:transaction_template"])&&void 0!==t?t:null}get __defaultTemplateSet(){var e,t;const r=`#${this.__defaultTemplateSetLoaderId}`,o=this.renderRoot.querySelector(r);return null!==(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const r=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __transaction(){var e,t;const r=`#${this.__transactionLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const r=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const r=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __cart(){var e,t;const r=`#${this.__cartLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __currencyCode(){var e,t,r,o,a;const i=this.__transaction;if(i)return i.currency_code;{const i=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(null==i?void 0:i.currency_code)return i.currency_code;{const e=this.__localeCodesHelper,i=null===(r=null!==(t=this.__templateSet)&&void 0!==t?t:this.__defaultTemplateSet)||void 0===r?void 0:r.locale_code,d=i?null==e?void 0:e.values[i]:void 0;if(d)return null!==(a=null===(o=/Currency: ([A-Z]{3})/g.exec(d))||void 0===o?void 0:o[1])&&void 0!==a?a:null}}}get __currencyDisplay(){var e;return(null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol)?"code":"symbol"}}customElements.define("foxy-item-option-card",u);export{u as ItemOptionCard};
1
+ import"./shared-f9180815.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import{_ as e}from"./shared-1522d76f.js";import{a as t}from"./shared-ecd5eb1b.js";import{T as r}from"./shared-25edf241.js";import{i as o}from"./shared-d3bf9ac0.js";import{h as a}from"./shared-7f33a83a.js";import"./shared-6a7f96c4.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-30cbf0a6.js";import"./shared-eb116b3e.js";import"./shared-6d0be1e4.js";import"./shared-a1d39ddd.js";import"./shared-54cbd346.js";import"./shared-15dfa16d.js";import"./shared-b23c903e.js";import"./shared-d1265ca0.js";import"./shared-4e709717.js";let d,i,s,l,n=e=>e;const c=t(r,"item-option-card");class u extends c{constructor(){super(...arguments),this.localeCodes=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__transactionLoaderId="transactionLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__cartLoaderId="cartLoader"}static get properties(){return e(e({},super.properties),{},{localeCodes:{attribute:"locale-codes"}})}renderBody(){const e=this.__currencyDisplay,t=this.__currencyCode;return a(d||(d=n` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} `),o(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),o(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),o(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),o(this.__transactionHref),this.__transactionLoaderId,(()=>this.requestUpdate()),o(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),o(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),o(this.__cartHref),this.__cartLoaderId,(()=>this.requestUpdate()),super.renderBody({title:r=>{if(!t||!e)return a(i||(i=n`&ZeroWidthSpace;`));let o;try{o=Math.abs(r.price_mod).toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:e,currency:t,style:"currency"})}catch(e){o="--"}return a(s||(s=n`${0} &bull; ${0} &bull; ${0}`),r.name,o,r.weight_mod)},subtitle:e=>a(l||(l=n`${0}`),e.value)}))}get isBodyReady(){return super.isBodyReady&&!!this.__currencyCode&&!!this.__currencyDisplay}get __transactionTemplateHref(){var e,t,r;try{const o=null===(e=this.data)||void 0===e?void 0:e._links,a=new URL(null!==(r=null===(t=null==o?void 0:o["fx:subscription"])||void 0===t?void 0:t.href)&&void 0!==r?r:"");return a.searchParams.set("zoom","transaction_template"),a.toString()}catch(e){}}get __defaultTemplateSetHref(){var e,t,r,o;if(""===(null===(t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate)||void 0===t?void 0:t.template_set_uri))try{const e=new URL(null!==(o=null===(r=this.__store)||void 0===r?void 0:r._links["fx:template_sets"].href)&&void 0!==o?o:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __transactionHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transaction"])||void 0===t?void 0:t.href}get __templateSetHref(){var e;const t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(!(null==t?void 0:t.currency_code))return(null==t?void 0:t.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __cartHref(){var e,t;const r=null===(e=this.data)||void 0===e?void 0:e._links;return null===(t=null==r?void 0:r["fx:cart"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t;const r=`#${this.__transactionTemplateLoaderId}`,o=this.renderRoot.querySelector(r);return null!==(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._embedded["fx:transaction_template"])&&void 0!==t?t:null}get __defaultTemplateSet(){var e,t;const r=`#${this.__defaultTemplateSetLoaderId}`,o=this.renderRoot.querySelector(r);return null!==(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const r=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __transaction(){var e,t;const r=`#${this.__transactionLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const r=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const r=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __cart(){var e,t;const r=`#${this.__cartLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __currencyCode(){var e,t,r,o,a;const d=this.__transaction;if(d)return d.currency_code;{const d=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(null==d?void 0:d.currency_code)return d.currency_code;{const e=this.__localeCodesHelper,d=null===(r=null!==(t=this.__templateSet)&&void 0!==t?t:this.__defaultTemplateSet)||void 0===r?void 0:r.locale_code,i=d?null==e?void 0:e.values[d]:void 0;if(i)return null!==(a=null===(o=/Currency: ([A-Z]{3})/g.exec(i))||void 0===o?void 0:o[1])&&void 0!==a?a:null}}}get __currencyDisplay(){var e;return(null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol)?"code":"symbol"}}customElements.define("foxy-item-option-card",u);export{u as ItemOptionCard};
@@ -1 +1 @@
1
- import"./shared-8771fb61.js";import"./shared-f1b36324.js";import{I as r}from"./shared-870074ff.js";import{a as e}from"./shared-662c576b.js";import{h as o}from"./shared-7f33a83a.js";import"./shared-c00049b2.js";import"./shared-e60dc924.js";import"./shared-f3b8de28.js";import"./shared-e3096241.js";import"./shared-7d933f9d.js";import"./shared-21293163.js";import"./shared-702eae16.js";import"./shared-f9180815.js";import"./shared-51a5af7e.js";import"./shared-4c2e9064.js";import"./shared-343d1fd7.js";import"./shared-fd96bcd1.js";import"./shared-5cf7b194.js";import"./shared-d3bf9ac0.js";import"./shared-9b12aeac.js";import"./shared-35728235.js";import"./shared-3ab0306f.js";import"./shared-e8a51c60.js";import"./shared-732bee4b.js";import"./shared-4e05dfb4.js";import"./shared-8c681381.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-fe927c53.js";import"./shared-417ab233.js";let t,s=r=>r;class a extends(e(r,"item-option-form")){static get v8n(){return[({name:r})=>!!r||"name:v8n_required",({name:r})=>!!r&&r.length<=100||"name:v8n_too_long",({value:r})=>!!r||"value:v8n_required",({value:r})=>!!r&&r.length<=1024||"value:v8n_too_long"]}renderBody(){return o(t||(t=s` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-text-control infer="value"></foxy-internal-text-control> <foxy-internal-number-control infer="price-mod"></foxy-internal-number-control> <foxy-internal-number-control infer="weight-mod"></foxy-internal-number-control> ${0} `),super.renderBody())}}customElements.define("foxy-item-option-form",a);export{a as ItemOptionForm};
1
+ import"./shared-3bd99d11.js";import"./shared-3f3903d4.js";import{I as r}from"./shared-2c92c192.js";import{a as e}from"./shared-ecd5eb1b.js";import{h as o}from"./shared-7f33a83a.js";import"./shared-5f1f0d8f.js";import"./shared-85712eed.js";import"./shared-a1d39ddd.js";import"./shared-ec59505f.js";import"./shared-264c82b8.js";import"./shared-745a575c.js";import"./shared-eacc4539.js";import"./shared-f9180815.js";import"./shared-15dfa16d.js";import"./shared-1522d76f.js";import"./shared-343d1fd7.js";import"./shared-30cbf0a6.js";import"./shared-b23c903e.js";import"./shared-d3bf9ac0.js";import"./shared-6a7f96c4.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-5291bdca.js";import"./shared-d8ca5c87.js";import"./shared-06916671.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-6d0be1e4.js";import"./shared-54cbd346.js";let t,s=r=>r;class a extends(e(r,"item-option-form")){static get v8n(){return[({name:r})=>!!r||"name:v8n_required",({name:r})=>!!r&&r.length<=100||"name:v8n_too_long",({value:r})=>!!r||"value:v8n_required",({value:r})=>!!r&&r.length<=1024||"value:v8n_too_long"]}renderBody(){return o(t||(t=s` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-text-control infer="value"></foxy-internal-text-control> <foxy-internal-number-control infer="price-mod"></foxy-internal-number-control> <foxy-internal-number-control infer="weight-mod"></foxy-internal-number-control> ${0} `),super.renderBody())}}customElements.define("foxy-item-option-form",a);export{a as ItemOptionForm};
@@ -1 +1 @@
1
- import{_ as t}from"./shared-4c2e9064.js";import"./shared-732bee4b.js";import{L as e,c as i,h as s}from"./shared-7f33a83a.js";import{p as r}from"./shared-51a5af7e.js";import"./shared-fe927c53.js";import"./shared-e3096241.js";import"./shared-6e704d83.js";import{w as a,S as n,x as o}from"./shared-662c576b.js";import"./shared-5742a841.js";import"./shared-8c681381.js";import{I as l,D as c}from"./shared-e2db3ab5.js";import{E as h}from"./shared-1105e4b9.js";import"./shared-c00049b2.js";import"./shared-7d933f9d.js";import"./shared-fc99076a.js";import"./shared-1dbad347.js";import"./shared-96215749.js";import"./shared-e60dc924.js";import"./shared-417ab233.js";import{s as d}from"./shared-11c2efc8.js";import"./shared-f3b8de28.js";import"./shared-343d1fd7.js";import"./shared-fd96bcd1.js";import"./shared-53d66db2.js";import"./shared-e8a51c60.js";import"./shared-35728235.js";import"./shared-5cf7b194.js";import"./shared-d3bf9ac0.js";import"./shared-4e709717.js";import"./shared-7b771301.js";import"./shared-71b3559f.js";class u extends CustomEvent{constructor(t){super("change",{detail:t})}}class m extends CustomEvent{constructor(t){super("submit",{detail:t,cancelable:!0})}}let _,p,g=t=>t;var y;!function(t){t[t.Excluded=0]="Excluded",t[t.BeforeEnter=1]="BeforeEnter",t[t.Default=2]="Default",t[t.Previous=3]="Previous",t[t.BeforeExit=4]="BeforeExit"}(y||(y={}));class f extends e{constructor(){super(...arguments),this.quantity=0,this.image=""}static get properties(){return t(t({},super.properties),{},{quantity:{attribute:!1},image:{attribute:!1}})}static get styles(){return[a.styles,i(_||(_=g`.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.blur-1{filter:blur(1px)}.blur-2{filter:blur(2px)}.grayscale{filter:grayscale()}.rotate-12{--tw-rotate:12deg}.-rotate-12{--tw-rotate:-12deg}.-rotate-24{--tw-rotate:-24deg}.translate-y-half{--tw-translate-y:50%}`))]}set empty(t){this.updateComplete.then((()=>{if(t){const[,...t]=this.__stack;t.forEach((t=>t.remove()))}else this.quantity>1&&this.__stack.length<2&&this.__insertImage(y.Previous,this.__stack[0])}))}set data({quantity:t,image:e}){this.quantity=t,this.image=e}render(){return s(p||(p=g`<div id="image" class="w-full h-full relative"></div>`))}firstUpdated(){const t=this.__insertImage(y.Default);this.quantity>1&&this.__insertImage(y.Previous,t)}updated(t){if(t.has("quantity")){const e=t.get("quantity");void 0!==e&&(this.quantity>e?this.__add():this.__remove())}t.has("image")&&this.__stack.forEach((t=>t.src=this.image))}get __container(){return this.shadowRoot.getElementById("image")}get __stack(){var t,e;return[...null!==(e=null===(t=this.__container)||void 0===t?void 0:t.querySelectorAll(":not(.opacity-0)"))&&void 0!==e?e:[]].reverse()}__add(){const[t,e]=this.__stack;this.quantity>1?(t&&this.__setImageState(t,y.Previous),e&&(this.__setImageState(e,y.BeforeExit),e.ontransitionend=()=>e.remove()),this.__setImageState(this.__insertImage(y.BeforeEnter),y.Default)):t&&this.__setImageState(t,y.Default)}__remove(){const[t,e]=this.__stack;let i;if(this.quantity>0?(e&&this.__setImageState(e,y.Default),i=t):(t&&this.__setImageState(t,y.Excluded),i=e),i&&(this.__setImageState(i,y.BeforeEnter),i.ontransitionend=()=>i.remove()),this.quantity>1){const t=this.__insertImage(y.BeforeExit,this.__container.firstElementChild);this.__setImageState(t,y.Previous)}}__insertImage(t,e=null){const i=new Image;return i.src=this.image,i.setAttribute("part","picture"),i.addEventListener("error",(()=>i.src=f.placeholder)),this.__setImageState(i,t),this.__container.insertBefore(i,e),i}__setImageState(t,e){t.offsetHeight,t.className=["absolute inset-0 w-full h-full object-cover rounded transform transition duration-700 ease-out-back",["grayscale","shadow-m translate-y-half scale-110 rotate-12 opacity-0","shadow-m","blur-1 -rotate-12 opacity-25","blur-2 -rotate-24 opacity-0"][e]].join(" ")}}f.placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E';let v,b,w,x,q,E,I,$,C=t=>t;class S extends(n(e)){constructor(){super(...arguments),this.empty=!1,this.data=[]}static get properties(){return t(t({},super.properties),{},{empty:{attribute:!1},data:{attribute:!1}})}static get styles(){return[a.styles,i(v||(v=C`.w-preview{width:5.5rem}.h-preview{height:5.5rem}.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.grayscale{filter:grayscale()}.grid-2>:nth-child(1),.grid-3>:nth-child(1),.grid-4-plus>:nth-child(1),.grid-4>:nth-child(1){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(2){opacity:0;--tw-translate-x:100%;--tw-translate-y:var(--tw-translate-x)}.grid-2>:nth-child(2),.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){transform-origin:top right}.grid-1>:nth-child(3),.grid-2>:nth-child(3),.grid-3>:nth-child(3),.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(3),.grid-2>:nth-child(3){opacity:0;--tw-translate-y:100%}.grid-3>:nth-child(3){transform-origin:bottom right}.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){transform-origin:bottom left}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4),.grid-4-plus>:nth-child(4),.grid-4>:nth-child(4){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4){opacity:0;transform-origin:bottom left;--tw-translate-x:100%}.grid-1>:nth-child(4)>:first-child,.grid-2>:nth-child(4)>:first-child,.grid-3>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:first-child{transform:perspective(250px) rotateX(-90deg)}.grid-4-plus>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:last-child{transition-delay:.15s;transition-timing-function:ease-out}.grid-4-plus>:nth-child(4)>:last-child,.grid-4>:nth-child(4)>:first-child{transition-timing-function:ease-in}.grid-4-plus>:nth-child(4)>:last-child{transform:perspective(250px) rotateX(90deg)}.grid-1>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){opacity:0}.grid-1>:nth-child(5){--tw-translate-x:100%}.grid-2>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-translate-y:-100%}.grid-1>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){opacity:0}.grid-1>:nth-child(6){--tw-translate-y:100%}.grid-2>:nth-child(6),.grid-3>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-translate-x:-100%}`))]}render(){const t=this.data.length,e="rounded bg-contrast-10",i="transition-all duration-700 ease-out-back transform absolute inset-0",r=this.empty?"grayscale":"",a=t>4?"grid-4-plus":`grid-${Math.max(1,t)}`,n=d({exportparts:"picture",class:"w-full h-full",".empty":this.empty}),[o,l,c,h]=this.data;return s(b||(b=C` <div class="${0} w-preview h-preview relative font-lumo"> <div class="${0} ${0} origin-top-left"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> ${0} </div> <div class="${0} ${0} origin-top-right"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> <div class="${0} flex text-body transition duration-150 absolute inset-0"> ${0} </div> <div class="transition duration-150 absolute inset-0"> ${0} </div> </div> <div class="${0} ${0} origin-top-right"></div> <div class="${0} ${0} origin-bottom-left"></div> </div> `),a,i,r,o?s(w||(w=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,o):"",i,r,l?s(x||(x=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,l):"",i,r,c?s(q||(q=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,c):"",i,r,e,t>102?s(E||(E=C`<iron-icon icon="icons:more-horiz" class="m-auto w-xl h-xl"></iron-icon>`)):s(I||(I=C`<div class="m-auto text-xxxl">+${0}</div>`),t-3),h?s($||($=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,h):"",i,e,i,e)}}let D,k,j=t=>t;class L extends S{static get scopedElements(){return{"x-pic":f}}}class A extends S{static get scopedElements(){return{"x-pic":L}}}class N extends(n(e)){constructor(){super(...arguments),this.quantity=0,this.items=[]}static get scopedElements(){return{"x-picture":f,"x-bundle-grid":A}}static get properties(){return{quantity:{attribute:!1},image:{attribute:!1},items:{attribute:!1}}}static get styles(){return a.styles}render(){const{quantity:t,image:e=""}=this,i=0===t,r=d({class:"w-full h-full",exportparts:"picture"});if(0===this.items.length)return s(D||(D=j`<x-picture ...="${0}" .data="${0}"></x-picture>`),r,{quantity:t,image:e});{const e=new Array(Math.max(1,t)).fill(this.items);return s(k||(k=j`<x-bundle-grid ...="${0}" .empty="${0}" .data="${0}"></x-bundle-grid>`),r,i,e)}}}class P extends o{static get properties(){return t(t({},super.properties),{},{open:{type:Object},signatures:{type:Object,converter:t=>{const e=JSON.parse(t);for(const t of Object.keys(e))64!=e[t].length&&console.error("There is something wrong with the signature. It should have 64 characters.");return e}}})}signedName(t){return this.signatures&&this.signatures[t]?`${t}||${this.signatures[t]}${this.isOpen(t)?"||open":""}`:t}isOpen(t){return!(!this.open||!this.open[t])}}let F,T,O,V,M,H,B,Z=t=>t;class R extends P{constructor(){super("items-form"),this.rel="product_item",this.readonly=!1,this.quantity=0,this.total=this.__computeTotalPrice(),this.currency="",this.isItem=!0,this.isChildItem=!1,this.pid=R.__newId(),this.__modified=!1,this.__childPrices=[],this.__images=[],this.__childrenCount=0,this.__itemDescription="",this.__handleQuantity={handleEvent:t=>{const e=Number(t.target.value);this.quantity=e,this.__modified=!0,this.__images=[this.getImageDescription()].concat(this.__images.slice(1,this.__images.length))}},this.__childItemsObserver=new MutationObserver(this.__observeItems.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__setCode(),this.__acknowledgeChildItems(),this.__changedChildItem(),this.__isValid()||console.error("Invalid item",this.value)}))}static get styles(){return[super.styles,i(F||(F=Z`:host{--quantity-width:6.5rem;--preview-size:5.5rem;--threshold:20rem}.min-w-description::before{content:'';width:var(--threshold);display:block;overflow:hidden}.ml-description{--min-width:calc(var(--threshold) + var(--preview-size) + var(--lumo-space-l));--free-space:calc(100% - var(--min-width));--max-margin-left:calc(var(--preview-size) + var(--lumo-space-l));--final-margin-left:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-left));margin-left:var(--final-margin-left)}.mr-quantity{--min-width:var(--threshold);--free-space:calc(100% - var(--min-width));--max-margin-right:calc(var(--quantity-width) + var(--lumo-space-l));--final-margin-right:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-right));margin-right:var(--final-margin-right)}:host([data-bundled]:not(:last-of-type)) .separator::after{content:' ';display:block;position:absolute;width:100vw;border-bottom:solid thin var(--lumo-shade-10pct);left:0;bottom:0}.w-quantity{width:var(--quantity-width)}.w-preview{width:var(--preview-size)}.h-preview{height:var(--preview-size)}`))]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"x-error-screen":h,"x-preview":N,"x-i18n":l}}static get properties(){return t(t({},super.properties),{},{__modified:{},readonly:{type:Boolean,reflect:!0},currency:{type:String},category:{type:String},code:{type:String,reflect:!0},expires:{type:String},height:{type:Number},image:{type:String},length:{type:Number},name:{type:String},parent_code:{type:String},price:{type:Number},quantity:{type:Number,reflect:!0},quantity_max:{type:Number},quantity_min:{type:String},shipto:{type:String},total:{type:Number,reflect:!0,attribute:"total"},url:{type:String},value:{type:Object},weight:{type:Number},width:{type:Number},__childPrices:{},__childrenCount:{},__images:{},alt:{type:String},isChildItem:{type:Boolean,reflect:!0,attribute:"data-bundled"},isItem:{type:Boolean,reflect:!0,attribute:"data-item"},open:{type:Object},pid:{type:Number,reflect:!0},items:{type:Array}})}get items(){const t=[];return this.__onEachChildItem([e=>t.push(e.value)]),t}set items(t){this.__createItems(t)}get value(){const t={};for(let e=0;e<this.attributes.length;e++)t[this.attributes[e].name]=this.attributes[e].value;return t.items=this.items,t}set value(t){this.__itemDescription="";for(const e in t){let i="";if("description"!=e){if("object"==typeof t[e])i=JSON.stringify(t[e]);else{const s=e;(t[s]&&"undefined"!==t[s]||0===t[s])&&(i=t[e].toString())}this.setAttribute(e,t[e]?i:"")}else this.__itemDescription=t[e]}}updated(t){t.forEach(((t,e)=>{"__itemDescription"!=e&&"isChildItem"!=e||this.__updateDescriptionEl()})),this.__setTotalPrice(),this.dispatchEvent(new Event("change"))}render(){var t;if(!this.__isValid())return s(T||(T=Z`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`));const e=`font-lumo text-body text-s leading-m transition duration-100 ${this.quantity?"":"removed opacity-50"}`;if(this.isChildItem)return s(O||(O=Z` <article part="item" class="py-s w-full relative separator item-summary flex justify-between ${0}"> <div class="description flex-1"> <h1 class="text-header font-medium">${0}</h1> <section class="description text-secondary"> <slot></slot> </section> </div> ${0} </article> `),e,this.name,this.quantity<2?"":s(V||(V=Z` <section class="quantity font-medium text-tertiary whitespace-nowrap"> ${0} </section> `),this._t("item.items",{quantity:this.quantity})));{const i=(null!==(t=this.price)&&void 0!==t?t:0)+this.__childPrices.reduce(((t,e)=>t+e),0),r=this.__translateAmount(i*this.quantity),a=this.__translateAmount(i);return s(M||(M=Z` <article part="item" class="p-l relative item ${0} ${0}"> <x-preview class="preview float-left w-preview h-preview mr-l mb-l" exportparts="picture" .image="${0}" .quantity="${0}" .items="${0}"> </x-preview> <section class="description min-w-description ml-description"> <h1 class="text-header font-medium text-l leading-none mr-quantity mb-s"> ${0} </h1> <div class="item-description text-secondary mr-quantity mb-s"> <slot></slot> </div> <div class="child-items mb-s"> <slot name="items"></slot> </div> ${0} </section> <section class="quantity w-quantity absolute top-0 right-0 m-l"> <vaadin-integer-field class="w-full p-0" name="quantity" @change="${0}" value="${0}" min="0" has-controls ?readonly="${0}"> </vaadin-integer-field> ${0} </section> </article> `),e,this.__modified?"modified":"",this.image,this.quantity,[...this.querySelectorAll("[data-bundled]")].map((t=>{var e;return{quantity:t.quantity,image:null!==(e=t.image)&&void 0!==e?e:""}})),this.name,a?s(H||(H=Z`<div class="font-medium price text-l">${0}</div>`),a):"",this.__handleQuantity,this.quantity,this.readonly,this.quantity>1?s(B||(B=Z` <x-i18n .ns="${0}" .lang="${0}" .opts="${0}" class="price-total text-secondary text-xs text-center block mt-xs" key="price.total"> </x-i18n> `),this.ns,this.lang,{amount:r}):"")}}getImageDescription(){return{src:this.image,alt:this.alt,quantity:this.quantity}}signedName(t){const e=super.signedName(t);return`${this.pid.toString()}:${e}`}static __newId(){const t=R.__existingIds.reduce(((t,e)=>e>t?e:t),0)+1;return R.__existingIds.push(t),t}__updateDescriptionEl(){if(this.__itemDescription){let t=this.shadowRoot.querySelector("data-item-description");t||(t=document.createElement("p"),t.dataset.itemDescription="true",this.__addSlottedEl(t)),t.innerText=this.__itemDescription}else{const t=this.shadowRoot.querySelector("data-item-description");t&&t.remove()}}__addSlottedEl(t){const e=this.shadowRoot.querySelector("article");e&&e.appendChild(t)}__setCode(){this.code||(this.code=`RAND${Math.random()}`)}__createItems(t){t.forEach((t=>{const e=document.createElement(this.tagName);e.value=t,e.currency=this.currency,e.__computeTotalPrice(),this.__acknowledgeItem(e),this.appendChild(e)}))}__setTotalPrice(){this.total=this.__computeTotalPrice()}__computeTotalPrice(){if(!this.__childPrices)return this.price?this.price*this.quantity:0;let t=0;return this.__childPrices.forEach((e=>{t+=e})),t+=this.price,t*=this.quantity,t}__isValid(){const t=[];return this.name&&this.name.length||t.push("The name attribute of an item is required."),this.price||0===this.price||t.push("The price attribute of an item is required."),this.price&&this.price<0&&t.push("Item added with negative price."),this.quantity_min&&this.quantity&&this.quantity<this.quantity_min&&t.push("Quantity amount is less than minimum quantity."),this.quantity_max&&this.quantity&&this.quantity>this.quantity_max&&t.push("Quantity amount is more than maximum quantity."),console.error(...t),!t.length}__translateAmount(t){return this.currency?t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"}):""}__observeItems(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.nodeType===Node.DOCUMENT_NODE&&this.__acknowledgeItem(t)}))})),this.__setTotalPrice()}__acknowledgeChildItems(){var t;null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t))),this.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t)))}__acknowledgeItem(t){t.addEventListener("change",this.__changedChildItem.bind(this)),t.currency=this.currency,t.isItem=!1,t.isChildItem=!0,this.code&&(t.parent_code=this.code)}__changedChildItem(){const t=[],e=[];let i=0;this.__onEachChildItem([e=>{void 0!==e.total&&t.push(e.total)},t=>{e.push(t.getImageDescription())},()=>i+=1]),this.image&&0===e.length&&e.push(this.getImageDescription()),this.__childPrices=t,this.__images=e,this.__childrenCount=i,this.__setTotalPrice()}__onEachChildItem(t){const e=this.querySelectorAll("[data-bundled]");for(const i of e)for(const e of t)e(i)}}R.__existingIds=[];let z,Q,W,J,U,X,G=t=>t;class K extends P{constructor(){super("items-form"),this.readonly=!1,this.target="_top",this.cart="checkout",this.sub_modify="replace",this.sub_restart="auto",this.frequencies=[],this.handleSubmit={handleEvent:()=>{null!==this.__data&&this.dispatchEvent(new m(this.__data))&&this.shadowRoot.querySelector("form").submit()}},this.__hasValidItems=!1,this.__total=0,this.__handleFrequency={handleEvent:t=>{const e=t.detail.replace(/([wydm])\w*/,"$1").replace(/ /g,"").replace(/^0/,"");K.__validFrequency(e)?this.sub_frequency=e:this.sub_frequency="",this.__updateData()}},this.__data=new FormData,this.__childItemsObserver=new MutationObserver(this.__observeChildren.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}))}static get scopedElements(){return{"x-error-screen":h,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":c,"x-item":R}}static get properties(){return t(t({},super.properties),{},{currency:{type:String},readonly:{type:Boolean},cart:{type:String,converter:t=>t&&!["checkout","add"].includes(t)?null:t},target:{type:String},store:{type:String,attribute:"store"},sub_frequency:{type:String},sub_startdate:{type:String,converter:t=>K.__validDate(t)?t:(console.error("Invalid start date",t),"")},sub_enddate:{type:String,converter:t=>K.__validDateFuture(t)?t:(console.error("Invalid end date",t),"")},sub_token:{type:String},sub_modify:{type:String,converter:t=>""===t||"append"===t?"":"replace"},sub_restart:{type:String,converter:t=>"true"===t?t:"auto"},frequencies:{converter:t=>{if(!t)return[];const e=JSON.parse(t);if(!Array.isArray(e))return console.error("Invalid frequency","Frequency options must be an array."),[];for(const t of e)if(!K.__validFrequency(t))return console.error("Invalid frequency","Invalid frequency option.\n Please, check https://wiki.foxycart.com/v/2.0/products#subscription_product_options for possible values.\n Each frequency must be a in the format:\n - 1d (a number followed by d, for day)\n - 1w (a number followed by w, for week)\n - 1m (a number followed by m, for month)\n - 1y (a number followed by y, for year)\n or .5m (no other decimals are allowed, and this is only for months)\n ",t),[];return e.filter(K.__validFrequency)}},items:{type:Array},__hasValidItems:{attribute:!1},__total:{attribute:!1},__data:{attribute:!1}})}get items(){const t=[];return this.__itemElements.forEach((e=>{const i=new Proxy(e,{set:function(t,e,i){const s=Object.keys(t.value);return!("string"!=typeof e||!s.includes(e))&&(t[e]=i,!0)},get:function(t,e){return t.value[e]}});t.push(i)})),t}set items(t){this.__removeItems(),this.__createItemsFromItemArray(t)}get total(){return this.__total}render(){var t;return this.store&&this.currency?s(Q||(Q=G` <div> <form class="overflow-hidden" method="POST" target="${0}" action="https://${0}/cart" data-testid="form" class="hidden" hidden> ${0} </form> <section class="items"> <slot></slot> </section> ${0} </div> `),this.target,this.store,this.__data?s(W||(W=G` ${0}`),[...this.__data.entries()].map((([t,e])=>s(J||(J=G`<input type="hidden" name="${0}" value="${0}">`),t,e)))):"",this.readonly?"":s(U||(U=G` <section class="actions flex flex-wrap justify-end m-m"> ${0} <vaadin-button class="m-s w-full sm-w-auto" theme="primary" data-testid="submit" ?disabled="${0}" @click="${0}"> <span class="total"> ${0} </span> </vaadin-button> </section> `),this.frequencies&&this.frequencies.length?s(X||(X=G` <x-dropdown type="text" name="frequency" class="subscription m-s w-full sm-w-auto" lang="${0}" .value="${0}" .items="${0}" .getText="${0}" @change="${0}"> </x-dropdown> `),this.lang,null!==(t=this.sub_frequency)&&void 0!==t?t:"0",this.frequencies.concat(["0"]),this.__translateFrequency.bind(this),this.__handleFrequency):"",!this.__hasValidItems,this.handleSubmit,this.__submitBtnText(this.__translateAmount(this.total)))):s(z||(z=G`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`))}addItems(t){for(const e of t){const t=this.createItem(e);this.appendChild(t),this.__acknowledgeItemElement(t)}}removeItems(t){this.__removeItems((e=>t.includes(e.pid)))}updated(){this.dispatchEvent(new u(this.__data))}createItem(t){const e=this.constructor.getScopedTagName("x-item"),i=document.createElement(e);return i.value=t,i.currency=this.currency,i.readonly=this.readonly,i}__submitBtnText(t){if(this.sub_frequency&&"0"!=this.sub_frequency){const e=r(this.sub_frequency);return 1===e.count?this._t("checkout.subscribe_single_unit",{value:t,period:this._t(e.units).toLowerCase()}):this._t("checkout.subscribe_muiltiple_units",{value:t,period:this.__translateFrequency(this.sub_frequency).toLowerCase()})}return this._t("checkout.buy",{value:t})}get __itemElements(){return this.querySelectorAll("[data-item]")}__createItemsFromItemArray(t){this.addItems(t)}__removeItems(t=(()=>!0)){this.__itemElements.forEach((e=>{t(e)&&e.remove()}))}__addSignature(t,e,i){return`${t}||${e}${i?"||open":""}`}__formDataFill(t){let e=0;return this.__itemElements.forEach((i=>{e+=this.__formDataAddItem(t,i)})),this.__formDataAddCartWideSubscriptionFields(t),e}__formDataCustomInputs(t){this.querySelectorAll("[name]").forEach((e=>{const i=e;"INPUT"==i.tagName&&["checkbox","radio"].includes(i.type)&&!i.checked||"OPTION"!=i.tagName&&i.value&&["number","string"].includes(typeof i.value)&&t.set(i.name,i.value)}))}__isAttributeReserved(t){return["alt","currency","description","isChildren","isItem","items","open","pid","signatures","slot","total"].includes(t)}__formDataAddItem(t,e,i=null){let s=0;if(this.__validItem(e)){if(!e.value.pid)throw new Error("Attempt to convert a item without a propper ID");i&&i.getAttribute("code")&&e.setAttribute("parent_code",i.getAttribute("code"));for(let s=0;s<e.attributes.length;s++){const r=e.attributes[s];if(!this.__isAttributeReserved(r.name)&&!r.name.startsWith("data-")){let s=e[r.name];e.code&&["string","number"].includes(typeof s)&&(i&&"quantity"==r.name&&(s=Number(r.value)*i.quantity),t.set(e.signedName(r.name),s.toString()))}}s+=1,this.__formDataAddSubscriptionFields(t,e)}const r=e.querySelectorAll("[data-bundled]");if(r&&e.quantity>0)for(const i of r)s+=this.__formDataAddItem(t,i,e);return s}__formDataAddSubscriptionFields(t,e){if(this.sub_frequency)for(const i of["sub_frequency","sub_startdate","sub_enddate"])this[i]&&t.set(e.signedName(i),this[i])}__formDataAddCartWideSubscriptionFields(t){this.sub_frequency&&(this.sub_token&&t.set(this.signedName("sub_token"),this.sub_token),t.set(this.signedName("sub_modify"),this.sub_modify),t.set(this.signedName("sub_restart"),this.sub_restart))}__formDataAddCartFields(t){this.cart?t.set("cart",this.cart):t.delete("cart")}static __validDate(t){return null!=t&&(t.match(/^(\d{1,2}|\d{8})$/)?!(t.match(/^\d{2}$/)&&Number(t)>31):!(t.match(/^\.5m/)||!K.__validFrequency(t)))}static __validDateFuture(t){let e=!1;if(K.__validDate(t))if(t.match(/^\d{8}/)){e=(new Date).toISOString().replace(/(-|T.*)/g,"")<=t}else e=!0;return e}static __validFrequency(t){return!!t&&!!t.match(/^(\.5m|\d+[dwmy])$/)}__observeChildren(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.addEventListener("change",this.__itemChange.bind(this))}))})),this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}__itemChange(){this.__computeTotalPrice(),this.__updateData()}__computeTotalPrice(){let t=0;this.__itemElements.forEach((e=>{const i=e;i.total&&(t+=Number(i.total))})),this.__total=Number(t.toFixed(2))}__acknowledgeItemElements(){this.__itemElements.forEach((t=>{const e=t;this.__acknowledgeItemElement(e)}))}__acknowledgeItemElement(t){t.addEventListener("change",this.__itemChange.bind(this)),t.currency=this.currency}__validItem(t){const e=t.getAttribute("pid"),i=Number(t.getAttribute("quantity")),s=Number(t.getAttribute("price"));return!!(e&&i>0&&s>=0)}__translateFrequency(t){if(t.startsWith("0"))return this._t("frequency_once");if(".5m"===t)return this._t("frequency_0_5m");const{count:e,units:i}=r(t);return this._t("frequency",{units:this._t(i,{count:e}),count:e})}__translateAmount(t){return t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"})}__updateData(){this.__data=null;if(!this.shadowRoot.querySelector("form"))return;const t=new FormData,e=this.__formDataFill(t);this.__hasValidItems=!!e,this.__formDataAddCartFields(t),this.__formDataCustomInputs(t),this.__data=t}}customElements.define("foxy-items-form",K),customElements.define("foxy-item",R);export{R as Item,K as ItemsForm};
1
+ import{_ as t}from"./shared-1522d76f.js";import"./shared-5291bdca.js";import{L as e,c as i,h as s}from"./shared-7f33a83a.js";import{p as r}from"./shared-15dfa16d.js";import"./shared-6d0be1e4.js";import"./shared-ec59505f.js";import"./shared-6ffa9f84.js";import{w as a,S as n,x as o}from"./shared-ecd5eb1b.js";import"./shared-452e38da.js";import"./shared-06916671.js";import{I as d,D as l}from"./shared-63d11888.js";import{E as h}from"./shared-a95067d6.js";import"./shared-5f1f0d8f.js";import"./shared-264c82b8.js";import"./shared-92dd9964.js";import"./shared-5db2fec0.js";import"./shared-b984ab7c.js";import"./shared-85712eed.js";import"./shared-54cbd346.js";import{s as c}from"./shared-11c2efc8.js";import"./shared-a1d39ddd.js";import"./shared-343d1fd7.js";import"./shared-30cbf0a6.js";import"./shared-0ffe26d8.js";import"./shared-eb116b3e.js";import"./shared-07e9d1fb.js";import"./shared-b23c903e.js";import"./shared-d3bf9ac0.js";import"./shared-4e709717.js";import"./shared-8d99b885.js";import"./shared-3d95605f.js";class u extends CustomEvent{constructor(t){super("change",{detail:t})}}class m extends CustomEvent{constructor(t){super("submit",{detail:t,cancelable:!0})}}let _,p,g=t=>t;var f;!function(t){t[t.Excluded=0]="Excluded",t[t.BeforeEnter=1]="BeforeEnter",t[t.Default=2]="Default",t[t.Previous=3]="Previous",t[t.BeforeExit=4]="BeforeExit"}(f||(f={}));class y extends e{constructor(){super(...arguments),this.quantity=0,this.image=""}static get properties(){return t(t({},super.properties),{},{quantity:{attribute:!1},image:{attribute:!1}})}static get styles(){return[a.styles,i(_||(_=g`.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.blur-1{filter:blur(1px)}.blur-2{filter:blur(2px)}.grayscale{filter:grayscale()}.rotate-12{--tw-rotate:12deg}.-rotate-12{--tw-rotate:-12deg}.-rotate-24{--tw-rotate:-24deg}.translate-y-half{--tw-translate-y:50%}`))]}set empty(t){this.updateComplete.then((()=>{if(t){const[,...t]=this.__stack;t.forEach((t=>t.remove()))}else this.quantity>1&&this.__stack.length<2&&this.__insertImage(f.Previous,this.__stack[0])}))}set data({quantity:t,image:e}){this.quantity=t,this.image=e}render(){return s(p||(p=g`<div id="image" class="w-full h-full relative"></div>`))}firstUpdated(){const t=this.__insertImage(f.Default);this.quantity>1&&this.__insertImage(f.Previous,t)}updated(t){if(t.has("quantity")){const e=t.get("quantity");void 0!==e&&(this.quantity>e?this.__add():this.__remove())}t.has("image")&&this.__stack.forEach((t=>t.src=this.image))}get __container(){return this.shadowRoot.getElementById("image")}get __stack(){var t,e;return[...null!==(e=null===(t=this.__container)||void 0===t?void 0:t.querySelectorAll(":not(.opacity-0)"))&&void 0!==e?e:[]].reverse()}__add(){const[t,e]=this.__stack;this.quantity>1?(t&&this.__setImageState(t,f.Previous),e&&(this.__setImageState(e,f.BeforeExit),e.ontransitionend=()=>e.remove()),this.__setImageState(this.__insertImage(f.BeforeEnter),f.Default)):t&&this.__setImageState(t,f.Default)}__remove(){const[t,e]=this.__stack;let i;if(this.quantity>0?(e&&this.__setImageState(e,f.Default),i=t):(t&&this.__setImageState(t,f.Excluded),i=e),i&&(this.__setImageState(i,f.BeforeEnter),i.ontransitionend=()=>i.remove()),this.quantity>1){const t=this.__insertImage(f.BeforeExit,this.__container.firstElementChild);this.__setImageState(t,f.Previous)}}__insertImage(t,e=null){const i=new Image;return i.src=this.image,i.setAttribute("part","picture"),i.addEventListener("error",(()=>i.src=y.placeholder)),this.__setImageState(i,t),this.__container.insertBefore(i,e),i}__setImageState(t,e){t.offsetHeight,t.className=["absolute inset-0 w-full h-full object-cover rounded transform transition duration-700 ease-out-back",["grayscale","shadow-m translate-y-half scale-110 rotate-12 opacity-0","shadow-m","blur-1 -rotate-12 opacity-25","blur-2 -rotate-24 opacity-0"][e]].join(" ")}}y.placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E';let v,b,w,x,q,E,I,$,C=t=>t;class S extends(n(e)){constructor(){super(...arguments),this.empty=!1,this.data=[]}static get properties(){return t(t({},super.properties),{},{empty:{attribute:!1},data:{attribute:!1}})}static get styles(){return[a.styles,i(v||(v=C`.w-preview{width:5.5rem}.h-preview{height:5.5rem}.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.grayscale{filter:grayscale()}.grid-2>:nth-child(1),.grid-3>:nth-child(1),.grid-4-plus>:nth-child(1),.grid-4>:nth-child(1){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(2){opacity:0;--tw-translate-x:100%;--tw-translate-y:var(--tw-translate-x)}.grid-2>:nth-child(2),.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){transform-origin:top right}.grid-1>:nth-child(3),.grid-2>:nth-child(3),.grid-3>:nth-child(3),.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(3),.grid-2>:nth-child(3){opacity:0;--tw-translate-y:100%}.grid-3>:nth-child(3){transform-origin:bottom right}.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){transform-origin:bottom left}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4),.grid-4-plus>:nth-child(4),.grid-4>:nth-child(4){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4){opacity:0;transform-origin:bottom left;--tw-translate-x:100%}.grid-1>:nth-child(4)>:first-child,.grid-2>:nth-child(4)>:first-child,.grid-3>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:first-child{transform:perspective(250px) rotateX(-90deg)}.grid-4-plus>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:last-child{transition-delay:.15s;transition-timing-function:ease-out}.grid-4-plus>:nth-child(4)>:last-child,.grid-4>:nth-child(4)>:first-child{transition-timing-function:ease-in}.grid-4-plus>:nth-child(4)>:last-child{transform:perspective(250px) rotateX(90deg)}.grid-1>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){opacity:0}.grid-1>:nth-child(5){--tw-translate-x:100%}.grid-2>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-translate-y:-100%}.grid-1>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){opacity:0}.grid-1>:nth-child(6){--tw-translate-y:100%}.grid-2>:nth-child(6),.grid-3>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-translate-x:-100%}`))]}render(){const t=this.data.length,e="rounded bg-contrast-10",i="transition-all duration-700 ease-out-back transform absolute inset-0",r=this.empty?"grayscale":"",a=t>4?"grid-4-plus":`grid-${Math.max(1,t)}`,n=c({exportparts:"picture",class:"w-full h-full",".empty":this.empty}),[o,d,l,h]=this.data;return s(b||(b=C` <div class="${0} w-preview h-preview relative font-lumo"> <div class="${0} ${0} origin-top-left"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> ${0} </div> <div class="${0} ${0} origin-top-right"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> <div class="${0} flex text-body transition duration-150 absolute inset-0"> ${0} </div> <div class="transition duration-150 absolute inset-0"> ${0} </div> </div> <div class="${0} ${0} origin-top-right"></div> <div class="${0} ${0} origin-bottom-left"></div> </div> `),a,i,r,o?s(w||(w=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,o):"",i,r,d?s(x||(x=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,d):"",i,r,l?s(q||(q=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,l):"",i,r,e,t>102?s(E||(E=C`<iron-icon icon="icons:more-horiz" class="m-auto w-xl h-xl"></iron-icon>`)):s(I||(I=C`<div class="m-auto text-xxxl">+${0}</div>`),t-3),h?s($||($=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,h):"",i,e,i,e)}}let D,k,j=t=>t;class L extends S{static get scopedElements(){return{"x-pic":y}}}class A extends S{static get scopedElements(){return{"x-pic":L}}}class N extends(n(e)){constructor(){super(...arguments),this.quantity=0,this.items=[]}static get scopedElements(){return{"x-picture":y,"x-bundle-grid":A}}static get properties(){return{quantity:{attribute:!1},image:{attribute:!1},items:{attribute:!1}}}static get styles(){return a.styles}render(){const{quantity:t,image:e=""}=this,i=0===t,r=c({class:"w-full h-full",exportparts:"picture"});if(0===this.items.length)return s(D||(D=j`<x-picture ...="${0}" .data="${0}"></x-picture>`),r,{quantity:t,image:e});{const e=new Array(Math.max(1,t)).fill(this.items);return s(k||(k=j`<x-bundle-grid ...="${0}" .empty="${0}" .data="${0}"></x-bundle-grid>`),r,i,e)}}}class P extends o{static get properties(){return t(t({},super.properties),{},{open:{type:Object},signatures:{type:Object,converter:t=>{const e=JSON.parse(t);for(const t of Object.keys(e))64!=e[t].length&&console.error("There is something wrong with the signature. It should have 64 characters.");return e}}})}signedName(t){return this.signatures&&this.signatures[t]?`${t}||${this.signatures[t]}${this.isOpen(t)?"||open":""}`:t}isOpen(t){return!(!this.open||!this.open[t])}}let F,T,O,V,M,H,B,Z=t=>t;class R extends P{constructor(){super("items-form"),this.rel="product_item",this.readonly=!1,this.quantity=0,this.total=this.__computeTotalPrice(),this.currency="",this.isItem=!0,this.isChildItem=!1,this.pid=R.__newId(),this.__modified=!1,this.__childPrices=[],this.__images=[],this.__childrenCount=0,this.__itemDescription="",this.__handleQuantity={handleEvent:t=>{const e=Number(t.target.value);this.quantity=e,this.__modified=!0,this.__images=[this.getImageDescription()].concat(this.__images.slice(1,this.__images.length))}},this.__childItemsObserver=new MutationObserver(this.__observeItems.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__setCode(),this.__acknowledgeChildItems(),this.__changedChildItem(),this.__isValid()||console.error("Invalid item",this.value)}))}static get styles(){return[super.styles,i(F||(F=Z`:host{--quantity-width:6.5rem;--preview-size:5.5rem;--threshold:20rem}.min-w-description::before{content:'';width:var(--threshold);display:block;overflow:hidden}.ml-description{--min-width:calc(var(--threshold) + var(--preview-size) + var(--lumo-space-l));--free-space:calc(100% - var(--min-width));--max-margin-left:calc(var(--preview-size) + var(--lumo-space-l));--final-margin-left:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-left));margin-left:var(--final-margin-left)}.mr-quantity{--min-width:var(--threshold);--free-space:calc(100% - var(--min-width));--max-margin-right:calc(var(--quantity-width) + var(--lumo-space-l));--final-margin-right:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-right));margin-right:var(--final-margin-right)}:host([data-bundled]:not(:last-of-type)) .separator::after{content:' ';display:block;position:absolute;width:100vw;border-bottom:solid thin var(--lumo-shade-10pct);left:0;bottom:0}.w-quantity{width:var(--quantity-width)}.w-preview{width:var(--preview-size)}.h-preview{height:var(--preview-size)}`))]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"x-error-screen":h,"x-preview":N,"x-i18n":d}}static get properties(){return t(t({},super.properties),{},{__modified:{},readonly:{type:Boolean,reflect:!0},currency:{type:String},category:{type:String},code:{type:String,reflect:!0},expires:{type:String},height:{type:Number},image:{type:String},length:{type:Number},name:{type:String},parent_code:{type:String},price:{type:Number},quantity:{type:Number,reflect:!0},quantity_max:{type:Number},quantity_min:{type:String},shipto:{type:String},total:{type:Number,reflect:!0,attribute:"total"},url:{type:String},value:{type:Object},weight:{type:Number},width:{type:Number},__childPrices:{},__childrenCount:{},__images:{},alt:{type:String},isChildItem:{type:Boolean,reflect:!0,attribute:"data-bundled"},isItem:{type:Boolean,reflect:!0,attribute:"data-item"},open:{type:Object},pid:{type:Number,reflect:!0},items:{type:Array}})}get items(){const t=[];return this.__onEachChildItem([e=>t.push(e.value)]),t}set items(t){this.__createItems(t)}get value(){const t={};for(let e=0;e<this.attributes.length;e++)t[this.attributes[e].name]=this.attributes[e].value;return t.items=this.items,t}set value(t){this.__itemDescription="";for(const e in t){let i="";if("description"!=e){if("object"==typeof t[e])i=JSON.stringify(t[e]);else{const s=e;(t[s]&&"undefined"!==t[s]||0===t[s])&&(i=t[e].toString())}this.setAttribute(e,t[e]?i:"")}else this.__itemDescription=t[e]}}updated(t){t.forEach(((t,e)=>{"__itemDescription"!=e&&"isChildItem"!=e||this.__updateDescriptionEl()})),this.__setTotalPrice(),this.dispatchEvent(new Event("change"))}render(){var t;if(!this.__isValid())return s(T||(T=Z`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`));const e=`font-lumo text-body text-s leading-m transition duration-100 ${this.quantity?"":"removed opacity-50"}`;if(this.isChildItem)return s(O||(O=Z` <article part="item" class="py-s w-full relative separator item-summary flex justify-between ${0}"> <div class="description flex-1"> <h1 class="text-header font-medium">${0}</h1> <section class="description text-secondary"> <slot></slot> </section> </div> ${0} </article> `),e,this.name,this.quantity<2?"":s(V||(V=Z` <section class="quantity font-medium text-tertiary whitespace-nowrap"> ${0} </section> `),this._t("item.items",{quantity:this.quantity})));{const i=(null!==(t=this.price)&&void 0!==t?t:0)+this.__childPrices.reduce(((t,e)=>t+e),0),r=this.__translateAmount(i*this.quantity),a=this.__translateAmount(i);return s(M||(M=Z` <article part="item" class="p-l relative item ${0} ${0}"> <x-preview class="preview float-left w-preview h-preview mr-l mb-l" exportparts="picture" .image="${0}" .quantity="${0}" .items="${0}"> </x-preview> <section class="description min-w-description ml-description"> <h1 class="text-header font-medium text-l leading-none mr-quantity mb-s"> ${0} </h1> <div class="item-description text-secondary mr-quantity mb-s"> <slot></slot> </div> <div class="child-items mb-s"> <slot name="items"></slot> </div> ${0} </section> <section class="quantity w-quantity absolute top-0 right-0 m-l"> <vaadin-integer-field class="w-full p-0" name="quantity" @change="${0}" value="${0}" min="0" has-controls ?readonly="${0}"> </vaadin-integer-field> ${0} </section> </article> `),e,this.__modified?"modified":"",this.image,this.quantity,[...this.querySelectorAll("[data-bundled]")].map((t=>{var e;return{quantity:t.quantity,image:null!==(e=t.image)&&void 0!==e?e:""}})),this.name,a?s(H||(H=Z`<div class="font-medium price text-l">${0}</div>`),a):"",this.__handleQuantity,this.quantity,this.readonly,this.quantity>1?s(B||(B=Z` <x-i18n .ns="${0}" .lang="${0}" .opts="${0}" class="price-total text-secondary text-xs text-center block mt-xs" key="price.total"> </x-i18n> `),this.ns,this.lang,{amount:r}):"")}}getImageDescription(){return{src:this.image,alt:this.alt,quantity:this.quantity}}signedName(t){const e=super.signedName(t);return`${this.pid.toString()}:${e}`}static __newId(){const t=R.__existingIds.reduce(((t,e)=>e>t?e:t),0)+1;return R.__existingIds.push(t),t}__updateDescriptionEl(){if(this.__itemDescription){let t=this.shadowRoot.querySelector("data-item-description");t||(t=document.createElement("p"),t.dataset.itemDescription="true",this.__addSlottedEl(t)),t.innerText=this.__itemDescription}else{const t=this.shadowRoot.querySelector("data-item-description");t&&t.remove()}}__addSlottedEl(t){const e=this.shadowRoot.querySelector("article");e&&e.appendChild(t)}__setCode(){this.code||(this.code=`RAND${Math.random()}`)}__createItems(t){t.forEach((t=>{const e=document.createElement(this.tagName);e.value=t,e.currency=this.currency,e.__computeTotalPrice(),this.__acknowledgeItem(e),this.appendChild(e)}))}__setTotalPrice(){this.total=this.__computeTotalPrice()}__computeTotalPrice(){if(!this.__childPrices)return this.price?this.price*this.quantity:0;let t=0;return this.__childPrices.forEach((e=>{t+=e})),t+=this.price,t*=this.quantity,t}__isValid(){const t=[];return this.name&&this.name.length||t.push("The name attribute of an item is required."),this.price||0===this.price||t.push("The price attribute of an item is required."),this.price&&this.price<0&&t.push("Item added with negative price."),this.quantity_min&&this.quantity&&this.quantity<this.quantity_min&&t.push("Quantity amount is less than minimum quantity."),this.quantity_max&&this.quantity&&this.quantity>this.quantity_max&&t.push("Quantity amount is more than maximum quantity."),console.error(...t),!t.length}__translateAmount(t){return this.currency?t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"}):""}__observeItems(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.nodeType===Node.DOCUMENT_NODE&&this.__acknowledgeItem(t)}))})),this.__setTotalPrice()}__acknowledgeChildItems(){var t;null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t))),this.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t)))}__acknowledgeItem(t){t.addEventListener("change",this.__changedChildItem.bind(this)),t.currency=this.currency,t.isItem=!1,t.isChildItem=!0,this.code&&(t.parent_code=this.code)}__changedChildItem(){const t=[],e=[];let i=0;this.__onEachChildItem([e=>{void 0!==e.total&&t.push(e.total)},t=>{e.push(t.getImageDescription())},()=>i+=1]),this.image&&0===e.length&&e.push(this.getImageDescription()),this.__childPrices=t,this.__images=e,this.__childrenCount=i,this.__setTotalPrice()}__onEachChildItem(t){const e=this.querySelectorAll("[data-bundled]");for(const i of e)for(const e of t)e(i)}}R.__existingIds=[];let z,Q,W,J,U,X,G=t=>t;class K extends P{constructor(){super("items-form"),this.readonly=!1,this.target="_top",this.cart="checkout",this.sub_modify="replace",this.sub_restart="auto",this.frequencies=[],this.handleSubmit={handleEvent:()=>{null!==this.__data&&this.dispatchEvent(new m(this.__data))&&this.shadowRoot.querySelector("form").submit()}},this.__hasValidItems=!1,this.__total=0,this.__handleFrequency={handleEvent:t=>{const e=t.detail.replace(/([wydm])\w*/,"$1").replace(/ /g,"").replace(/^0/,"");K.__validFrequency(e)?this.sub_frequency=e:this.sub_frequency="",this.__updateData()}},this.__data=new FormData,this.__childItemsObserver=new MutationObserver(this.__observeChildren.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}))}static get scopedElements(){return{"x-error-screen":h,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":l,"x-item":R}}static get properties(){return t(t({},super.properties),{},{currency:{type:String},readonly:{type:Boolean},cart:{type:String,converter:t=>t&&!["checkout","add"].includes(t)?null:t},target:{type:String},store:{type:String,attribute:"store"},sub_frequency:{type:String},sub_startdate:{type:String,converter:t=>K.__validDate(t)?t:(console.error("Invalid start date",t),"")},sub_enddate:{type:String,converter:t=>K.__validDateFuture(t)?t:(console.error("Invalid end date",t),"")},sub_token:{type:String},sub_modify:{type:String,converter:t=>""===t||"append"===t?"":"replace"},sub_restart:{type:String,converter:t=>"true"===t?t:"auto"},frequencies:{converter:t=>{if(!t)return[];const e=JSON.parse(t);if(!Array.isArray(e))return console.error("Invalid frequency","Frequency options must be an array."),[];for(const t of e)if(!K.__validFrequency(t))return console.error("Invalid frequency","Invalid frequency option.\n Please, check https://wiki.foxycart.com/v/2.0/products#subscription_product_options for possible values.\n Each frequency must be a in the format:\n - 1d (a number followed by d, for day)\n - 1w (a number followed by w, for week)\n - 1m (a number followed by m, for month)\n - 1y (a number followed by y, for year)\n or .5m (no other decimals are allowed, and this is only for months)\n ",t),[];return e.filter(K.__validFrequency)}},items:{type:Array},__hasValidItems:{attribute:!1},__total:{attribute:!1},__data:{attribute:!1}})}get items(){const t=[];return this.__itemElements.forEach((e=>{const i=new Proxy(e,{set:function(t,e,i){const s=Object.keys(t.value);return!("string"!=typeof e||!s.includes(e))&&(t[e]=i,!0)},get:function(t,e){return t.value[e]}});t.push(i)})),t}set items(t){this.__removeItems(),this.__createItemsFromItemArray(t)}get total(){return this.__total}render(){var t;return this.store&&this.currency?s(Q||(Q=G` <div> <form class="overflow-hidden" method="POST" target="${0}" action="https://${0}/cart" data-testid="form" class="hidden" hidden> ${0} </form> <section class="items"> <slot></slot> </section> ${0} </div> `),this.target,this.store,this.__data?s(W||(W=G` ${0}`),[...this.__data.entries()].map((([t,e])=>s(J||(J=G`<input type="hidden" name="${0}" value="${0}">`),t,e)))):"",this.readonly?"":s(U||(U=G` <section class="actions flex flex-wrap justify-end m-m"> ${0} <vaadin-button class="m-s w-full sm-w-auto" theme="primary" data-testid="submit" ?disabled="${0}" @click="${0}"> <span class="total"> ${0} </span> </vaadin-button> </section> `),this.frequencies&&this.frequencies.length?s(X||(X=G` <x-dropdown type="text" name="frequency" class="subscription m-s w-full sm-w-auto" lang="${0}" .value="${0}" .items="${0}" .getText="${0}" @change="${0}"> </x-dropdown> `),this.lang,null!==(t=this.sub_frequency)&&void 0!==t?t:"0",this.frequencies.concat(["0"]),this.__translateFrequency.bind(this),this.__handleFrequency):"",!this.__hasValidItems,this.handleSubmit,this.__submitBtnText(this.__translateAmount(this.total)))):s(z||(z=G`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`))}addItems(t){for(const e of t){const t=this.createItem(e);this.appendChild(t),this.__acknowledgeItemElement(t)}}removeItems(t){this.__removeItems((e=>t.includes(e.pid)))}updated(){this.dispatchEvent(new u(this.__data))}createItem(t){const e=this.constructor.getScopedTagName("x-item"),i=document.createElement(e);return i.value=t,i.currency=this.currency,i.readonly=this.readonly,i}__submitBtnText(t){if(this.sub_frequency&&"0"!=this.sub_frequency){const e=r(this.sub_frequency);return 1===e.count?this._t("checkout.subscribe_single_unit",{value:t,period:this._t(e.units).toLowerCase()}):this._t("checkout.subscribe_muiltiple_units",{value:t,period:this.__translateFrequency(this.sub_frequency).toLowerCase()})}return this._t("checkout.buy",{value:t})}get __itemElements(){return this.querySelectorAll("[data-item]")}__createItemsFromItemArray(t){this.addItems(t)}__removeItems(t=(()=>!0)){this.__itemElements.forEach((e=>{t(e)&&e.remove()}))}__addSignature(t,e,i){return`${t}||${e}${i?"||open":""}`}__formDataFill(t){let e=0;return this.__itemElements.forEach((i=>{e+=this.__formDataAddItem(t,i)})),this.__formDataAddCartWideSubscriptionFields(t),e}__formDataCustomInputs(t){this.querySelectorAll("[name]").forEach((e=>{const i=e;"INPUT"==i.tagName&&["checkbox","radio"].includes(i.type)&&!i.checked||"OPTION"!=i.tagName&&i.value&&["number","string"].includes(typeof i.value)&&t.set(i.name,i.value)}))}__isAttributeReserved(t){return["alt","currency","description","isChildren","isItem","items","open","pid","signatures","slot","total"].includes(t)}__formDataAddItem(t,e,i=null){let s=0;if(this.__validItem(e)){if(!e.value.pid)throw new Error("Attempt to convert a item without a propper ID");i&&i.getAttribute("code")&&e.setAttribute("parent_code",i.getAttribute("code"));for(let s=0;s<e.attributes.length;s++){const r=e.attributes[s];if(!this.__isAttributeReserved(r.name)&&!r.name.startsWith("data-")){let s=e[r.name];e.code&&["string","number"].includes(typeof s)&&(i&&"quantity"==r.name&&(s=Number(r.value)*i.quantity),t.set(e.signedName(r.name),s.toString()))}}s+=1,this.__formDataAddSubscriptionFields(t,e)}const r=e.querySelectorAll("[data-bundled]");if(r&&e.quantity>0)for(const i of r)s+=this.__formDataAddItem(t,i,e);return s}__formDataAddSubscriptionFields(t,e){if(this.sub_frequency)for(const i of["sub_frequency","sub_startdate","sub_enddate"])this[i]&&t.set(e.signedName(i),this[i])}__formDataAddCartWideSubscriptionFields(t){this.sub_frequency&&(this.sub_token&&t.set(this.signedName("sub_token"),this.sub_token),t.set(this.signedName("sub_modify"),this.sub_modify),t.set(this.signedName("sub_restart"),this.sub_restart))}__formDataAddCartFields(t){this.cart?t.set("cart",this.cart):t.delete("cart")}static __validDate(t){return null!=t&&(t.match(/^(\d{1,2}|\d{8})$/)?!(t.match(/^\d{2}$/)&&Number(t)>31):!(t.match(/^\.5m/)||!K.__validFrequency(t)))}static __validDateFuture(t){let e=!1;if(K.__validDate(t))if(t.match(/^\d{8}/)){e=(new Date).toISOString().replace(/(-|T.*)/g,"")<=t}else e=!0;return e}static __validFrequency(t){return!!t&&!!t.match(/^(\.5m|\d+[dwmy])$/)}__observeChildren(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.addEventListener("change",this.__itemChange.bind(this))}))})),this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}__itemChange(){this.__computeTotalPrice(),this.__updateData()}__computeTotalPrice(){let t=0;this.__itemElements.forEach((e=>{const i=e;i.total&&(t+=Number(i.total))})),this.__total=Number(t.toFixed(2))}__acknowledgeItemElements(){this.__itemElements.forEach((t=>{const e=t;this.__acknowledgeItemElement(e)}))}__acknowledgeItemElement(t){t.addEventListener("change",this.__itemChange.bind(this)),t.currency=this.currency}__validItem(t){const e=t.getAttribute("pid"),i=Number(t.getAttribute("quantity")),s=Number(t.getAttribute("price"));return!!(e&&i>0&&s>=0)}__translateFrequency(t){if(t.startsWith("0"))return this._t("frequency_once");if(".5m"===t)return this._t("frequency_0_5m");const{count:e,units:i}=r(t);return this._t("frequency",{units:this._t(i,{count:e}),count:e})}__translateAmount(t){return t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"})}__updateData(){this.__data=null;if(!this.shadowRoot.querySelector("form"))return;const t=new FormData,e=this.__formDataFill(t);this.__hasValidItems=!!e,this.__formDataAddCartFields(t),this.__formDataCustomInputs(t),this.__data=t}}customElements.define("foxy-items-form",K),customElements.define("foxy-item",R);export{R as Item,K as ItemsForm};