@foxy.io/elements 1.24.1-beta.1 → 1.25.0-beta.1

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 (215) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  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-cancellation-form.js +1 -1
  12. package/dist/cdn/foxy-cart-card.js +1 -1
  13. package/dist/cdn/foxy-cart-form.js +1 -1
  14. package/dist/cdn/foxy-client-card.js +1 -1
  15. package/dist/cdn/foxy-client-form.js +1 -1
  16. package/dist/cdn/foxy-collection-page.js +1 -1
  17. package/dist/cdn/foxy-collection-pages.js +1 -1
  18. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  19. package/dist/cdn/foxy-coupon-card.js +1 -1
  20. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  21. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  22. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-form.js +1 -1
  24. package/dist/cdn/foxy-custom-field-card.js +1 -1
  25. package/dist/cdn/foxy-custom-field-form.js +1 -1
  26. package/dist/cdn/foxy-customer-card.js +1 -1
  27. package/dist/cdn/foxy-customer-form.js +1 -1
  28. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  29. package/dist/cdn/foxy-customer-portal.js +1 -1
  30. package/dist/cdn/foxy-customer.js +3 -3
  31. package/dist/cdn/foxy-customers-table.js +1 -1
  32. package/dist/cdn/foxy-discount-builder.js +1 -1
  33. package/dist/cdn/foxy-discount-card.js +1 -1
  34. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  35. package/dist/cdn/foxy-donation.js +1 -1
  36. package/dist/cdn/foxy-downloadable-card.js +1 -1
  37. package/dist/cdn/foxy-downloadable-form.js +1 -1
  38. package/dist/cdn/foxy-email-template-card.js +1 -1
  39. package/dist/cdn/foxy-email-template-form.js +1 -1
  40. package/dist/cdn/foxy-error-entry-card.js +1 -1
  41. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  42. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  43. package/dist/cdn/foxy-form-dialog.js +1 -1
  44. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  45. package/dist/cdn/foxy-gift-card-card.js +1 -1
  46. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  47. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  48. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  49. package/dist/cdn/foxy-gift-card-form.js +1 -1
  50. package/dist/cdn/foxy-i18n-editor.js +2 -2
  51. package/dist/cdn/foxy-i18n.js +1 -1
  52. package/dist/cdn/foxy-integration-card.js +1 -1
  53. package/dist/cdn/foxy-integration-form.js +1 -1
  54. package/dist/cdn/foxy-item-card.js +1 -1
  55. package/dist/cdn/foxy-item-category-card.js +1 -1
  56. package/dist/cdn/foxy-item-category-form.js +1 -1
  57. package/dist/cdn/foxy-item-form.js +1 -1
  58. package/dist/cdn/foxy-item-option-card.js +1 -1
  59. package/dist/cdn/foxy-item-option-form.js +1 -1
  60. package/dist/cdn/foxy-items-form.js +1 -1
  61. package/dist/cdn/foxy-native-integration-card.js +1 -0
  62. package/dist/cdn/foxy-native-integration-form.js +1 -0
  63. package/dist/cdn/foxy-pagination.js +1 -1
  64. package/dist/cdn/foxy-passkey-card.js +1 -1
  65. package/dist/cdn/foxy-passkey-form.js +1 -1
  66. package/dist/cdn/foxy-payment-card.js +1 -1
  67. package/dist/cdn/foxy-payment-method-card.js +1 -1
  68. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  69. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  70. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  71. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  72. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  73. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  74. package/dist/cdn/foxy-query-builder.js +1 -1
  75. package/dist/cdn/foxy-report-form.js +1 -1
  76. package/dist/cdn/foxy-reports-table.js +5 -5
  77. package/dist/cdn/foxy-shipment-card.js +2 -2
  78. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  79. package/dist/cdn/foxy-sign-in-form.js +1 -1
  80. package/dist/cdn/foxy-spinner.js +2 -2
  81. package/dist/cdn/foxy-store-card.js +1 -1
  82. package/dist/cdn/foxy-store-form.js +1 -1
  83. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  84. package/dist/cdn/foxy-subscription-card.js +1 -1
  85. package/dist/cdn/foxy-subscription-form.js +3 -3
  86. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  87. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  88. package/dist/cdn/foxy-table.js +1 -1
  89. package/dist/cdn/foxy-tax-card.js +1 -1
  90. package/dist/cdn/foxy-tax-form.js +1 -1
  91. package/dist/cdn/foxy-template-config-form.js +1 -1
  92. package/dist/cdn/foxy-template-form.js +1 -1
  93. package/dist/cdn/foxy-template-set-card.js +1 -1
  94. package/dist/cdn/foxy-template-set-form.js +1 -1
  95. package/dist/cdn/foxy-transaction-card.js +1 -1
  96. package/dist/cdn/foxy-transaction.js +1 -1
  97. package/dist/cdn/foxy-transactions-table.js +4 -4
  98. package/dist/cdn/foxy-user-card.js +1 -1
  99. package/dist/cdn/foxy-user-form.js +1 -1
  100. package/dist/cdn/foxy-users-table.js +1 -1
  101. package/dist/cdn/foxy-webhook-card.js +1 -1
  102. package/dist/cdn/foxy-webhook-form.js +1 -1
  103. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  104. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  105. package/dist/cdn/{shared-9aa72495.js → shared-074a74c3.js} +1 -1
  106. package/dist/cdn/{shared-fd40a40c.js → shared-093b64b4.js} +1 -1
  107. package/dist/cdn/{shared-5db85492.js → shared-1105e4b9.js} +1 -1
  108. package/dist/cdn/{shared-31d8e3b8.js → shared-112dbca7.js} +1 -1
  109. package/dist/cdn/{shared-d1f5de89.js → shared-1313f293.js} +1 -1
  110. package/dist/cdn/{shared-7a455b15.js → shared-131988fc.js} +1 -1
  111. package/dist/cdn/{shared-ddac7722.js → shared-18672d26.js} +2 -2
  112. package/dist/cdn/{shared-0c0ee663.js → shared-1a65fd20.js} +1 -1
  113. package/dist/cdn/{shared-bee111d6.js → shared-1dbad347.js} +1 -1
  114. package/dist/cdn/{shared-ff7fd5fa.js → shared-21293163.js} +1 -1
  115. package/dist/cdn/shared-26dea180.js +1 -0
  116. package/dist/cdn/{shared-406ce9ad.js → shared-2f082f50.js} +1 -1
  117. package/dist/cdn/{shared-b446c140.js → shared-417ab233.js} +1 -1
  118. package/dist/cdn/{shared-f0a9f3c2.js → shared-468de081.js} +1 -1
  119. package/dist/cdn/{shared-de3dae6c.js → shared-4c3cb511.js} +1 -1
  120. package/dist/cdn/{shared-9954ee26.js → shared-4d555419.js} +1 -1
  121. package/dist/cdn/{shared-799dc083.js → shared-4e05dfb4.js} +1 -1
  122. package/dist/cdn/{shared-2edcd981.js → shared-51a5af7e.js} +1 -1
  123. package/dist/cdn/{shared-6daeb197.js → shared-53d66db2.js} +3 -3
  124. package/dist/cdn/{shared-601f27b1.js → shared-5742a841.js} +1 -1
  125. package/dist/cdn/{shared-773e7177.js → shared-5d718eaf.js} +1 -1
  126. package/dist/cdn/{shared-7723f756.js → shared-5d795aaf.js} +1 -1
  127. package/dist/cdn/shared-5e932eb5.js +1 -0
  128. package/dist/cdn/{shared-3b709ddc.js → shared-662c576b.js} +1 -1
  129. package/dist/cdn/{shared-099c1f57.js → shared-6e704d83.js} +1 -1
  130. package/dist/cdn/{shared-ba93be6b.js → shared-702eae16.js} +1 -1
  131. package/dist/cdn/{shared-fff03a45.js → shared-71b3559f.js} +3 -3
  132. package/dist/cdn/{shared-9048eeb2.js → shared-732bee4b.js} +1 -1
  133. package/dist/cdn/{shared-f29acc38.js → shared-76e71481.js} +1 -1
  134. package/dist/cdn/{shared-1196b6a7.js → shared-783f5705.js} +1 -1
  135. package/dist/cdn/{shared-f5bbb1e0.js → shared-7b771301.js} +1 -1
  136. package/dist/cdn/{shared-7abbc95c.js → shared-7d933f9d.js} +1 -1
  137. package/dist/cdn/{shared-5280c80a.js → shared-870074ff.js} +1 -1
  138. package/dist/cdn/{shared-27d21f4a.js → shared-8771fb61.js} +1 -1
  139. package/dist/cdn/{shared-621b3283.js → shared-8c681381.js} +1 -1
  140. package/dist/cdn/{shared-9b486845.js → shared-92de4f37.js} +1 -1
  141. package/dist/cdn/{shared-ef7f2d07.js → shared-96215749.js} +1 -1
  142. package/dist/cdn/{shared-ad80244a.js → shared-9771ef0f.js} +1 -1
  143. package/dist/cdn/{shared-8f922de8.js → shared-a52c3d8c.js} +1 -1
  144. package/dist/cdn/{shared-94798eb5.js → shared-b8963ec6.js} +1 -1
  145. package/dist/cdn/{shared-13fbea95.js → shared-c00049b2.js} +1 -1
  146. package/dist/cdn/shared-c320cfef.js +46 -0
  147. package/dist/cdn/{shared-fcfbfbdb.js → shared-ca428891.js} +1 -1
  148. package/dist/cdn/{shared-b87d1af0.js → shared-cb9cdc88.js} +1 -1
  149. package/dist/cdn/{shared-c76ef8d8.js → shared-d01f42d0.js} +7 -7
  150. package/dist/cdn/{shared-59fc6288.js → shared-d123bea6.js} +1 -1
  151. package/dist/cdn/{shared-c839e147.js → shared-da5e32c1.js} +1 -1
  152. package/dist/cdn/{shared-f21e5761.js → shared-e2db3ab5.js} +1 -1
  153. package/dist/cdn/{shared-eb8a0fdf.js → shared-e3096241.js} +1 -1
  154. package/dist/cdn/{shared-5103c1b4.js → shared-e312da08.js} +1 -1
  155. package/dist/cdn/{shared-3f04e4cc.js → shared-e60dc924.js} +1 -1
  156. package/dist/cdn/{shared-efaf8d49.js → shared-e79b5765.js} +1 -1
  157. package/dist/cdn/{shared-d90dbae7.js → shared-f1b36324.js} +1 -1
  158. package/dist/cdn/{shared-e5239bec.js → shared-f3b8de28.js} +1 -1
  159. package/dist/cdn/{shared-3c2414d4.js → shared-fc99076a.js} +1 -1
  160. package/dist/cdn/{shared-5784c088.js → shared-fe927c53.js} +1 -1
  161. package/dist/cdn/{shared-4205699e.js → shared-fed6cd4d.js} +1 -1
  162. package/dist/cdn/{shared-5a889c45.js → shared-fff7db77.js} +1 -1
  163. package/dist/cdn/translations/admin-subscription-card/en.json +1 -0
  164. package/dist/cdn/translations/cart-form/en.json +2 -0
  165. package/dist/cdn/translations/customer/en.json +2 -0
  166. package/dist/cdn/translations/customer-portal/en.json +2 -0
  167. package/dist/cdn/translations/item-form/en.json +2 -0
  168. package/dist/cdn/translations/native-integration-card/en.json +20 -0
  169. package/dist/cdn/translations/native-integration-form/en.json +262 -0
  170. package/dist/cdn/translations/shipment-card/en.json +2 -0
  171. package/dist/cdn/translations/subscription-card/en.json +1 -0
  172. package/dist/cdn/translations/subscription-form/en.json +1 -0
  173. package/dist/cdn/translations/subscriptions-table/en.json +1 -0
  174. package/dist/cdn/translations/transaction/en.json +4 -0
  175. package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.js +17 -6
  176. package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.js.map +1 -1
  177. package/dist/elements/public/NativeIntegrationCard/NativeIntegrationCard.d.ts +19 -0
  178. package/dist/elements/public/NativeIntegrationCard/NativeIntegrationCard.js +87 -0
  179. package/dist/elements/public/NativeIntegrationCard/NativeIntegrationCard.js.map +1 -0
  180. package/dist/elements/public/NativeIntegrationCard/index.d.ts +4 -0
  181. package/dist/elements/public/NativeIntegrationCard/index.js +6 -0
  182. package/dist/elements/public/NativeIntegrationCard/index.js.map +1 -0
  183. package/dist/elements/public/NativeIntegrationCard/types.d.ts +3 -0
  184. package/dist/elements/public/NativeIntegrationCard/types.js +2 -0
  185. package/dist/elements/public/NativeIntegrationCard/types.js.map +1 -0
  186. package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.d.ts +133 -0
  187. package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js +759 -0
  188. package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js.map +1 -0
  189. package/dist/elements/public/NativeIntegrationForm/defaults.d.ts +62 -0
  190. package/dist/elements/public/NativeIntegrationForm/defaults.js +63 -0
  191. package/dist/elements/public/NativeIntegrationForm/defaults.js.map +1 -0
  192. package/dist/elements/public/NativeIntegrationForm/index.d.ts +9 -0
  193. package/dist/elements/public/NativeIntegrationForm/index.js +11 -0
  194. package/dist/elements/public/NativeIntegrationForm/index.js.map +1 -0
  195. package/dist/elements/public/NativeIntegrationForm/types.d.ts +89 -0
  196. package/dist/elements/public/NativeIntegrationForm/types.js +2 -0
  197. package/dist/elements/public/NativeIntegrationForm/types.js.map +1 -0
  198. package/dist/elements/public/SubscriptionCard/SubscriptionCard.js +24 -12
  199. package/dist/elements/public/SubscriptionCard/SubscriptionCard.js.map +1 -1
  200. package/dist/elements/public/SubscriptionForm/SubscriptionForm.js +11 -4
  201. package/dist/elements/public/SubscriptionForm/SubscriptionForm.js.map +1 -1
  202. package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.js +22 -22
  203. package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.js.map +1 -1
  204. package/dist/elements/public/index.d.ts +2 -0
  205. package/dist/elements/public/index.defined.d.ts +2 -0
  206. package/dist/elements/public/index.defined.js +2 -0
  207. package/dist/elements/public/index.defined.js.map +1 -1
  208. package/dist/elements/public/index.js +2 -0
  209. package/dist/elements/public/index.js.map +1 -1
  210. package/dist/mixins/themeable.js +4 -0
  211. package/dist/mixins/themeable.js.map +1 -1
  212. package/package.json +1 -1
  213. package/dist/cdn/shared-584174ff.js +0 -1
  214. package/dist/cdn/shared-630a0ff2.js +0 -1
  215. package/dist/cdn/shared-f29d410a.js +0 -46
@@ -783,6 +783,7 @@
783
783
  "subscription_failed": "Payment failed on {{date, date}}",
784
784
  "subscription_inactive": "Inactive",
785
785
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
786
+ "subscription_will_be_active": "Starts on {{date, date}}",
786
787
  "transaction_plural": "Transactions",
787
788
  "twice_a_month": "Twice a month",
788
789
  "undo_cancel": "Review",
@@ -847,6 +848,7 @@
847
848
  "subscription_failed": "Payment failed on {{date, date}}",
848
849
  "subscription_inactive": "Inactive",
849
850
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
851
+ "subscription_will_be_active": "Starts on {{date, date}}",
850
852
  "transaction_summary": "{{most_expensive_item.name}}",
851
853
  "twice_a_month": "Twice a month",
852
854
  "update": "Update",
@@ -732,6 +732,7 @@
732
732
  "subscription_failed": "Payment failed on {{date, date}}",
733
733
  "subscription_inactive": "Inactive",
734
734
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
735
+ "subscription_will_be_active": "Starts on {{date, date}}",
735
736
  "transaction_summary": "{{most_expensive_item.name}}",
736
737
  "twice_a_month": "twice a month",
737
738
  "weekly": "/ week",
@@ -774,6 +775,7 @@
774
775
  "subscription_failed": "Payment failed on {{date, date}}",
775
776
  "subscription_inactive": "Inactive",
776
777
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
778
+ "subscription_will_be_active": "Starts on {{date, date}}",
777
779
  "transaction_plural": "Transactions",
778
780
  "twice_a_month": "Twice a month",
779
781
  "update_billing": "Update billing",
@@ -79,6 +79,7 @@
79
79
  "subscription_failed": "Payment failed on {{date, date}}",
80
80
  "subscription_inactive": "Inactive",
81
81
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
82
+ "subscription_will_be_active": "Starts on {{date, date}}",
82
83
  "transaction_plural": "Transactions",
83
84
  "twice_a_month": "Twice a month",
84
85
  "undo_cancel": "Review",
@@ -140,6 +141,7 @@
140
141
  "subscription_inactive": "Inactive",
141
142
  "subscription_plural": "Subscriptions",
142
143
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
144
+ "subscription_will_be_active": "Starts on {{date, date}}",
143
145
  "transaction_summary": "{{most_expensive_item.name}}",
144
146
  "twice_a_month": "Twice a month",
145
147
  "weekly": "Weekly",
@@ -0,0 +1,20 @@
1
+ {
2
+ "image_alt": "Native integration logo",
3
+ "title_avalara": "Avalara",
4
+ "title_taxjar": "TaxJar",
5
+ "title_onesource": "ONESOURCE",
6
+ "title_webflow": "Webflow",
7
+ "title_zapier": "Zapier",
8
+ "title_legacy_webhook": "{{ title }}",
9
+ "subtitle_avalara": "Account #{{ id }} • {{ service_url }}",
10
+ "subtitle_taxjar": "SmartCalcs API token ends in ****{{ api_token }}",
11
+ "subtitle_onesource": "{{ service_url }}",
12
+ "subtitle_webflow": "{{ site_name }} • ID {{ site_id }}",
13
+ "subtitle_zapier": "{{ url }}",
14
+ "subtitle_legacy_webhook": "{{ url }}",
15
+ "spinner": {
16
+ "loading_busy": "Loading",
17
+ "loading_empty": "No data",
18
+ "loading_error": "Failed to load"
19
+ }
20
+ }
@@ -0,0 +1,262 @@
1
+ {
2
+ "error": {
3
+ "already_configured": "This integration is already configured. Please edit the existing integration instead."
4
+ },
5
+ "provider": {
6
+ "label": "Provider",
7
+ "option_avalara": "Avalara",
8
+ "option_taxjar": "TaxJar",
9
+ "option_onesource": "ONESOURCE",
10
+ "option_webflow": "Webflow",
11
+ "option_zapier": "Zapier",
12
+ "helper_text": "Changing service provider is not possible after creation.",
13
+ "v8n_required": "Please select a provider."
14
+ },
15
+ "avalara-service-url": {
16
+ "label": "Service URL",
17
+ "placeholder": "Required",
18
+ "helper_text": "If in test mode, it should be https://development.avalara.net. If in production, it should be https://avatax.avalara.net unless a different Service URL has been provided to you by Avalara.",
19
+ "v8n_required": "Please enter a service URL.",
20
+ "v8n_invalid": "Please enter a valid URL."
21
+ },
22
+ "avalara-id": {
23
+ "label": "Account number",
24
+ "placeholder": "Required",
25
+ "helper_text": "Be sure to use either a development or production value based on your Service URL.",
26
+ "v8n_required": "Please enter an account number."
27
+ },
28
+ "avalara-key": {
29
+ "label": "License key",
30
+ "placeholder": "Required",
31
+ "helper_text": "Be sure to use either a development or production value based on your Service URL.",
32
+ "v8n_required": "Please enter a license key."
33
+ },
34
+ "avalara-company-code": {
35
+ "label": "Company code",
36
+ "placeholder": "Required",
37
+ "helper_text": "Be sure to use either a development or production value based on your Service URL.",
38
+ "v8n_required": "Please enter a company code."
39
+ },
40
+ "avalara-options": {
41
+ "label": "Options",
42
+ "option_use_ava_tax": "Use for live taxes",
43
+ "option_enable_colorado_delivery_fee": "Enable Colorado Delivery Fee",
44
+ "option_create_invoice": "Enable Committed Sales Invoice",
45
+ "option_use_address_validation": "Validate customer addresses",
46
+ "helper_text": ""
47
+ },
48
+ "avalara-address-validation-countries": {
49
+ "label": "Address validation countries",
50
+ "option_US": "United States",
51
+ "option_CA": "Canada",
52
+ "helper_text": ""
53
+ },
54
+ "avalara-category-to-product-tax-code-mappings": {
55
+ "label": "Category to product tax code mappings",
56
+ "helper_text": "Replace Foxy category codes with AvaTax tax codes when sending data to Avalara. If left empty, the category code will be sent to AvaTax instead.",
57
+ "placeholder": "foxy_category_code:avatax_tax_code"
58
+ },
59
+ "taxjar-api-token": {
60
+ "label": "API token",
61
+ "placeholder": "Required",
62
+ "helper_text": "Your SmartCalcs API token obtained from TaxJar.",
63
+ "v8n_required": "Please enter an API token."
64
+ },
65
+ "taxjar-category-to-product-tax-code-mappings": {
66
+ "label": "Category to product tax code mappings",
67
+ "helper_text": "Replace Foxy category codes with TaxJar tax codes when sending data to TaxJar. If left empty, the category code will be sent to TaxJar instead.",
68
+ "placeholder": "foxy_category_code:taxjar_tax_code"
69
+ },
70
+ "taxjar-options": {
71
+ "label": "Options",
72
+ "option_create_invoice": "Enable Committed Sales Invoice",
73
+ "helper_text": ""
74
+ },
75
+ "onesource-service-url": {
76
+ "label": "Service URL",
77
+ "placeholder": "Required",
78
+ "helper_text": "The ONESOURCE service URL you want to connect to.",
79
+ "v8n_required": "Please enter a service URL.",
80
+ "v8n_invalid": "Please enter a valid URL."
81
+ },
82
+ "onesource-external-company-id": {
83
+ "label": "External company ID",
84
+ "placeholder": "Required",
85
+ "helper_text": "External company ID mapping to the Determination company owning the audit data.",
86
+ "v8n_required": "Please enter an external company ID."
87
+ },
88
+ "onesource-calling-system-number": {
89
+ "label": "Calling system number",
90
+ "placeholder": "Required",
91
+ "helper_text": "A unique identifier for your ERP system. The combination of Calling System Number, Host System, and Unique Invoice Number form a unique key for an invoice in the Audit Database.",
92
+ "v8n_required": "Please enter a calling system number."
93
+ },
94
+ "onesource-from-city": {
95
+ "label": "From city",
96
+ "placeholder": "Required",
97
+ "helper_text": "This city should match the postal code and country you have configured in your settings.",
98
+ "v8n_required": "Please enter a city."
99
+ },
100
+ "onesource-host-system": {
101
+ "label": "Host system",
102
+ "placeholder": "Required",
103
+ "helper_text": "A unique name for your ERP system. The combination of Calling System Number, Host System, and Unique Invoice Number form a unique key for an invoice in the Audit Database.",
104
+ "v8n_required": "Please enter a host system."
105
+ },
106
+ "onesource-company-role": {
107
+ "label": "Company role",
108
+ "option_buyer": "Buyer",
109
+ "option_seller": "Seller",
110
+ "option_middleman": "Middleman",
111
+ "helper_text": "The role the company plays in a given transaction. Each role results in different transaction tax and reporting requirements."
112
+ },
113
+ "onesource-part-number-product-option": {
114
+ "label": "Custom product option name",
115
+ "placeholder": "Optional",
116
+ "helper_text": "If you use a custom product option name to specify your part number such as SKU or ISBN, enter that name here here. You can also set it to \"code\" to use the standard product code attribute."
117
+ },
118
+ "onesource-product-order-priority": {
119
+ "label": "Custom product order",
120
+ "placeholder": "Optional",
121
+ "helper_text": "The PRODUCT_CODE field in ONESOURCE is populated via the Foxy category code. The first shippable product will have the RELATED_LINE_NUMBER associated with it. To control which product is listed first, add a list of Foxy category codes here based on the order priority you'd like."
122
+ },
123
+ "onesource-audit-settings": {
124
+ "label": "Audit",
125
+ "option_capture_only": "On capture",
126
+ "option_auth_and_capture": "On auth and capture",
127
+ "option_never": "Never",
128
+ "helper_text": "When completing a transaction, use this setting to determine if the information sent to Onesource will be audited and reported."
129
+ },
130
+ "webhook-service": {
131
+ "label": "Payload format",
132
+ "option_json": "JSON",
133
+ "option_legacy_xml": "XML",
134
+ "helper_text": "Use JSON for new services. XML webhooks are deprecated and may be removed in the future."
135
+ },
136
+ "webhook-json-title": {
137
+ "label": "Provider",
138
+ "placeholder": "Required",
139
+ "helper_text": "A descriptive title that identies your custom service.",
140
+ "v8n_required": "Please enter a title."
141
+ },
142
+ "webhook-json-encryption-key": {
143
+ "label": "Encryption key",
144
+ "placeholder": "Required",
145
+ "helper_text": "This value is used as they key to encrypt the and verify the payload sent for the webhook.",
146
+ "v8n_required": "Please enter an encryption key."
147
+ },
148
+ "webhook-json-url": {
149
+ "label": "Webhook URL",
150
+ "placeholder": "Required",
151
+ "helper_text": "The absolute URL (beginning with https:// or http://) to which Foxy will send the webhook on selected events.",
152
+ "v8n_required": "Please enter a webhook URL.",
153
+ "v8n_invalid": "Please enter a valid URL."
154
+ },
155
+ "webhook-json-events": {
156
+ "label": "Events",
157
+ "option_transaction_created": "Transaction created",
158
+ "option_subscription_cancelled": "Subscription cancelled",
159
+ "helper_text": "Select at least one event that will trigger this webhook."
160
+ },
161
+ "webhook-warning": {
162
+ "warning_text": "We are winding down support for custom services that rely on legacy webhooks and XML datafeed. Please consider using the new JSON webhooks instead.",
163
+ "link_text": "Read the announcement"
164
+ },
165
+ "webhook-legacy-xml-title": {
166
+ "label": "Provider",
167
+ "placeholder": "Required",
168
+ "helper_text": "A descriptive title that identies your custom service.",
169
+ "v8n_required": "Please enter a title."
170
+ },
171
+ "webhook-legacy-xml-url": {
172
+ "label": "Webhook URL",
173
+ "placeholder": "Required",
174
+ "helper_text": "The absolute URL (beginning with https:// or http://) to which Foxy will send the webhook on selected events.",
175
+ "v8n_required": "Please enter a webhook URL.",
176
+ "v8n_invalid": "Please enter a valid URL."
177
+ },
178
+ "webhook-webflow-site-id": {
179
+ "label": "Site ID",
180
+ "placeholder": "Required",
181
+ "helper_text": "The Site ID of your Webflow site.",
182
+ "v8n_required": "Please enter a site ID."
183
+ },
184
+ "webhook-webflow-site-name": {
185
+ "label": "Site name",
186
+ "placeholder": "Required",
187
+ "helper_text": "The name of your Webflow site.",
188
+ "v8n_required": "Please enter a site name."
189
+ },
190
+ "webhook-webflow-collection-id": {
191
+ "label": "Collection ID",
192
+ "placeholder": "Required",
193
+ "helper_text": "The ID of the collection that products are stored in.",
194
+ "v8n_required": "Please enter a collection ID."
195
+ },
196
+ "webhook-webflow-collection-name": {
197
+ "label": "Collection name",
198
+ "placeholder": "Required",
199
+ "helper_text": "The name of your products collection.",
200
+ "v8n_required": "Please enter a collection name."
201
+ },
202
+ "webhook-webflow-sku-field-id": {
203
+ "label": "SKU field ID",
204
+ "placeholder": "Required",
205
+ "helper_text": "The ID of the code field in your products collection.",
206
+ "v8n_required": "Please enter a SKU field ID."
207
+ },
208
+ "webhook-webflow-sku-field-name": {
209
+ "label": "SKU field name",
210
+ "placeholder": "Required",
211
+ "helper_text": "The name of the code field in your products collection.",
212
+ "v8n_required": "Please enter a SKU field name."
213
+ },
214
+ "webhook-webflow-inventory-field-id": {
215
+ "label": "Inventory field ID",
216
+ "placeholder": "Required",
217
+ "helper_text": "The ID of the inventory field in your products collection.",
218
+ "v8n_required": "Please enter an inventory field ID."
219
+ },
220
+ "webhook-webflow-inventory-field-name": {
221
+ "label": "Inventory field name",
222
+ "placeholder": "Required",
223
+ "helper_text": "The name of the inventory field in your products collection.",
224
+ "v8n_required": "Please enter an inventory field name."
225
+ },
226
+ "webhook-webflow-auth": {
227
+ "label": "Token",
228
+ "placeholder": "Required",
229
+ "helper_text": "The OAuth2 authorization token for your Webflow site.",
230
+ "v8n_required": "Please enter an authorization token."
231
+ },
232
+ "webhook-zapier-event": {
233
+ "label": "Event",
234
+ "placeholder": "Defined by Zapier",
235
+ "helper_text": "The event this zap is subscribed to."
236
+ },
237
+ "webhook-zapier-url": {
238
+ "label": "URL",
239
+ "placeholder": "Defined by Zapier",
240
+ "helper_text": "The Zapier webhook subscription URL."
241
+ },
242
+ "webhook-zapier-warning": {
243
+ "warning_text": "Note: Zapier service types are read only and can not be created or modified in the Foxy Admin. Zapier webhooks need to be created from zapier.com"
244
+ },
245
+ "timestamps": {
246
+ "date_created": "Created on",
247
+ "date_modified": "Last updated on",
248
+ "date": "{{value, date}}"
249
+ },
250
+ "delete": {
251
+ "delete": "Delete",
252
+ "cancel": "Cancel",
253
+ "delete_prompt": "Please confirm that you want to delete this integration. This action cannot be undone."
254
+ },
255
+ "create": {
256
+ "create": "Create"
257
+ },
258
+ "spinner": {
259
+ "loading_busy": "Loading",
260
+ "loading_error": "Failed to load"
261
+ }
262
+ }
@@ -107,6 +107,7 @@
107
107
  "subscription_failed": "Payment failed on {{date, date}}",
108
108
  "subscription_inactive": "Inactive",
109
109
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
110
+ "subscription_will_be_active": "Starts on {{date, date}}",
110
111
  "transaction_plural": "Transactions",
111
112
  "twice_a_month": "Twice a month",
112
113
  "undo_cancel": "Review",
@@ -168,6 +169,7 @@
168
169
  "subscription_inactive": "Inactive",
169
170
  "subscription_plural": "Subscriptions",
170
171
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
172
+ "subscription_will_be_active": "Starts on {{date, date}}",
171
173
  "transaction_summary": "{{most_expensive_item.name}}",
172
174
  "twice_a_month": "Twice a month",
173
175
  "weekly": "Weekly",
@@ -12,6 +12,7 @@
12
12
  "subscription_inactive": "Inactive",
13
13
  "subscription_plural": "Subscriptions",
14
14
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
15
+ "subscription_will_be_active": "Starts on {{date, date}}",
15
16
  "transaction_summary": "{{most_expensive_item.name}}",
16
17
  "twice_a_month": "Twice a month",
17
18
  "weekly": "Weekly",
@@ -28,6 +28,7 @@
28
28
  "subscription_failed": "Payment failed on {{date, date}}",
29
29
  "subscription_inactive": "Inactive",
30
30
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
31
+ "subscription_will_be_active": "Starts on {{date, date}}",
31
32
  "transaction_plural": "Transactions",
32
33
  "twice_a_month": "Twice a month",
33
34
  "undo_cancel": "Review",
@@ -11,6 +11,7 @@
11
11
  "subscription_failed": "Payment failed on {{date, date}}",
12
12
  "subscription_inactive": "Inactive",
13
13
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
14
+ "subscription_will_be_active": "Starts on {{date, date}}",
14
15
  "transaction_summary": "{{most_expensive_item.name}}",
15
16
  "twice_a_month": "Twice a month",
16
17
  "update": "Update",
@@ -214,6 +214,7 @@
214
214
  "subscription_failed": "Payment failed on {{date, date}}",
215
215
  "subscription_inactive": "Inactive",
216
216
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
217
+ "subscription_will_be_active": "Starts on {{date, date}}",
217
218
  "transaction_plural": "Transactions",
218
219
  "twice_a_month": "Twice a month",
219
220
  "undo_cancel": "Review",
@@ -278,6 +279,7 @@
278
279
  "subscription_failed": "Payment failed on {{date, date}}",
279
280
  "subscription_inactive": "Inactive",
280
281
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
282
+ "subscription_will_be_active": "Starts on {{date, date}}",
281
283
  "transaction_summary": "{{most_expensive_item.name}}",
282
284
  "twice_a_month": "Twice a month",
283
285
  "update": "Update",
@@ -509,6 +511,7 @@
509
511
  "subscription_failed": "Payment failed on {{date, date}}",
510
512
  "subscription_inactive": "Inactive",
511
513
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
514
+ "subscription_will_be_active": "Starts on {{date, date}}",
512
515
  "transaction_plural": "Transactions",
513
516
  "twice_a_month": "Twice a month",
514
517
  "undo_cancel": "Review",
@@ -570,6 +573,7 @@
570
573
  "subscription_inactive": "Inactive",
571
574
  "subscription_plural": "Subscriptions",
572
575
  "subscription_will_be_cancelled": "Ends on {{date, date}}",
576
+ "subscription_will_be_active": "Starts on {{date, date}}",
573
577
  "transaction_summary": "{{most_expensive_item.name}}",
574
578
  "twice_a_month": "Twice a month",
575
579
  "weekly": "Weekly",
@@ -249,11 +249,18 @@ export class AdminSubscriptionCard extends Base {
249
249
  return items.isApproximateCount ? 'summary_approximate' : 'summary';
250
250
  }
251
251
  get __statusOptions() {
252
- var _a, _b;
253
- const d = this.data;
254
- const date = (_b = (_a = d === null || d === void 0 ? void 0 : d.first_failed_transaction_date) !== null && _a !== void 0 ? _a : d === null || d === void 0 ? void 0 : d.end_date) !== null && _b !== void 0 ? _b : d === null || d === void 0 ? void 0 : d.next_transaction_date;
255
- if (date)
256
- return { date };
252
+ const data = this.data;
253
+ if (data === null)
254
+ return;
255
+ if (data.first_failed_transaction_date)
256
+ return { date: data.first_failed_transaction_date };
257
+ if (data.end_date)
258
+ return { date: data.end_date };
259
+ if (data.is_active === false)
260
+ return {};
261
+ if (new Date(data.start_date) > new Date())
262
+ return { date: data.start_date };
263
+ return { date: data.next_transaction_date };
257
264
  }
258
265
  get __currencyCode() {
259
266
  var _a, _b, _c;
@@ -299,7 +306,11 @@ export class AdminSubscriptionCard extends Base {
299
306
  const hasEnded = new Date(data.end_date).getTime() > Date.now();
300
307
  return hasEnded ? 'subscription_will_be_cancelled' : 'subscription_cancelled';
301
308
  }
302
- return `subscription_${data.is_active ? 'active' : 'inactive'}`;
309
+ if (data.is_active === false)
310
+ return 'subscription_inactive';
311
+ if (new Date(data.start_date) > new Date())
312
+ return 'subscription_will_be_active';
313
+ return 'subscription_active';
303
314
  }
304
315
  get __priceKey() {
305
316
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"AdminSubscriptionCard.js","sourceRoot":"","sources":["../../../../src/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.ts"],"names":[],"mapp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pC,OAAO;YACL,GAAG,cAAc,CAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,GAAG,UAAU,IAAI,YAAY,EAAE;YACvC,eAAe;SAChB,CAAC;IACJ,CAAC;IAED,IAAY,WAAW;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEvB,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO;QAC1B,IAAI,IAAI,CAAC,6BAA6B;YAAE,OAAO,qBAAqB,CAAC;QACrE,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAChE,OAAO,QAAQ,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC,wBAAwB,CAAC;SAC/E;QAED,OAAO,gBAAgB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;IAClE,CAAC;IAED,IAAY,UAAU;;QACpB,MAAM,SAAS,SAAG,IAAI,CAAC,IAAI,0CAAE,SAAS,CAAC;QACvC,IAAI,SAAS;YAAE,OAAO,SAAS,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACvF,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { NucleonElement } from '../NucleonElement/NucleonElement';\nimport type { Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { parseFrequency } from '../../../utils/parse-frequency';\nimport { InternalCard } from '../../internal/InternalCard/InternalCard';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-html';\n\nconst NS = 'admin-subscription-card';\nconst Base = ConfigurableMixin(TranslatableMixin(InternalCard, NS));\n\n/**\n * Card element representing a subscription (`fx:subscription`).\n * Admin-only.\n *\n * @element foxy-admin-subscription-card\n * @since 1.21.0\n */\nexport class AdminSubscriptionCard extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n localeCodes: { attribute: 'locale-codes' },\n };\n }\n\n /**\n * URL of the `fx:locale_codes` property helper.\n * This will be used to determine the currency code for subscriptions that link to a\n * transaction template without the code.\n */\n localeCodes: string | null = null;\n\n private readonly __transactionTemplateLoaderId = 'transactionTemplateLoader';\n\n private readonly __defaultTemplateSetLoaderId = 'defaultTemplateSetLoader';\n\n private readonly __localeCodesHelperLoaderId = 'localeCodesLoader';\n\n private readonly __templateSetLoaderId = 'templateSetLoader';\n\n private readonly __itemsLoaderId = 'itemsLoader';\n\n private readonly __storeLoaderId = 'storeLoader';\n\n renderBody(): TemplateResult {\n const isFailed = !!this.data?.first_failed_transaction_date;\n const cart = this.__transactionTemplate;\n\n const priceKey = this.__priceKey;\n const priceOptions = this.__priceOptions;\n const summaryOptions = this.__summaryOptions;\n const summaryKey = this.__summaryKey;\n const statusKey = this.__statusKey;\n const statusOptions = this.__statusOptions;\n\n return html`\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__transactionTemplateHref)}\n id=${this.__transactionTemplateLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__defaultTemplateSetHref)}\n id=${this.__defaultTemplateSetLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__localeCodesHelperHref)}\n id=${this.__localeCodesHelperLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__templateSetHref)}\n id=${this.__templateSetLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__itemsHref)}\n id=${this.__itemsLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__storeHref)}\n id=${this.__storeLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <div class=\"text-left leading-s text-tertiary\">\n <div class=\"flex items-center space-x-s\">\n <span class=\"block flex-1 font-medium text-body truncate\">\n ${summaryOptions && summaryKey\n ? html`<foxy-i18n infer=\"\" key=${summaryKey} .options=${summaryOptions}></foxy-i18n>`\n : html`&ZeroWidthSpace;`}\n </span>\n <span class=\"text-s\">\n ${priceOptions && priceKey\n ? html`<foxy-i18n infer=\"\" key=${priceKey} .options=${priceOptions}></foxy-i18n>`\n : html`&ZeroWidthSpace;`}\n </span>\n </div>\n\n <div class=\"truncate text-s ${isFailed ? 'text-error' : 'text-secondary'}\">\n ${statusOptions && statusKey\n ? html`<foxy-i18n infer=\"\" key=${statusKey} .options=${statusOptions}></foxy-i18n>`\n : html`&ZeroWidthSpace;`}\n </div>\n\n <div class=\"text-tertiary truncate text-s\">${cart?.customer_email}&ZeroWidthSpace;</div>\n </div>\n `;\n }\n\n get isBodyReady(): boolean {\n const isLoaded = !!this.__items && !!this.__currencyCode && !!this.__currencyDisplay;\n return super.isBodyReady && isLoaded;\n }\n\n private get __transactionTemplateHref() {\n const data = this.data;\n\n if (!data) return;\n if ('_embedded' in data && 'fx:transaction_template' in data._embedded) return;\n\n const url = new URL(this.data?._links['fx:transaction_template'].href ?? '');\n url.searchParams.set('zoom', 'items');\n return url.toString();\n }\n\n private get __defaultTemplateSetHref() {\n const templateSetUri = this.__transactionTemplate?.template_set_uri;\n\n if (templateSetUri === '') {\n try {\n const url = new URL(this.__store?._links['fx:template_sets'].href ?? '');\n url.searchParams.set('code', 'DEFAULT');\n return url.toString();\n } catch {\n //\n }\n }\n }\n\n private get __localeCodesHelperHref() {\n if (this.__defaultTemplateSetHref || this.__templateSetHref) {\n return this.localeCodes ?? void 0;\n }\n }\n\n private get __templateSetHref() {\n const cart = this.__transactionTemplate;\n if (!cart?.currency_code) return cart?.template_set_uri || void 0;\n }\n\n private get __itemsHref() {\n const cart = this.__transactionTemplate;\n\n if (!cart) return;\n if ('_embedded' in cart && 'fx:items' in cart._embedded) return;\n\n const url = new URL(cart._links['fx:items'].href);\n url.searchParams.set('limit', '1');\n return url.toString();\n }\n\n private get __storeHref() {\n return this.data?._links['fx:store']?.href;\n }\n\n private get __transactionTemplate() {\n const data = this.data;\n\n if (data && '_embedded' in data && 'fx:transaction_template' in data._embedded) {\n type Cart = Resource<Rels.TransactionTemplate>;\n type CartWithItems = Resource<Rels.TransactionTemplate, { zoom: 'items' }>;\n return data._embedded['fx:transaction_template'] as Cart | CartWithItems;\n } else {\n type Loader = NucleonElement<Resource<Rels.TransactionTemplate, { zoom: 'items' }>>;\n const selector = `#${this.__transactionTemplateLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n }\n\n private get __defaultTemplateSet() {\n type Loader = NucleonElement<Resource<Rels.TemplateSets>>;\n const selector = `#${this.__defaultTemplateSetLoaderId}`;\n const loader = this.renderRoot.querySelector<Loader>(selector);\n return loader?.data?._embedded['fx:template_sets'][0] ?? null;\n }\n\n private get __localeCodesHelper() {\n type Loader = NucleonElement<Resource<Rels.LocaleCodes>>;\n const selector = `#${this.__localeCodesHelperLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __templateSet() {\n type Loader = NucleonElement<Resource<Rels.TemplateSet>>;\n const selector = `#${this.__templateSetLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __items() {\n type Cart = Resource<Rels.TransactionTemplate>;\n type CartWithItems = Resource<Rels.TransactionTemplate, { zoom: 'items' }>;\n\n const cart = this.__transactionTemplate as Cart | CartWithItems | null;\n\n if (cart && '_embedded' in cart && 'fx:items' in cart._embedded) {\n const items = cart._embedded['fx:items'];\n\n return {\n array: items,\n count: items.length,\n isApproximateCount: items.length === 20,\n };\n }\n\n type Loader = NucleonElement<Resource<Rels.Items>>;\n const loader = this.renderRoot.querySelector<Loader>(`#${this.__itemsLoaderId}`);\n if (!loader?.data) return null;\n\n return {\n array: loader.data._embedded['fx:items'],\n count: loader.data.total_items,\n isApproximateCount: false,\n };\n }\n\n private get __store() {\n type Loader = NucleonElement<Resource<Rels.Store>>;\n const selector = `#${this.__storeLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __currencyDisplay() {\n const useCode = this.__store?.use_international_currency_symbol;\n\n if (useCode === true) return 'code';\n if (useCode === false) return 'symbol';\n }\n\n private get __summaryOptions() {\n const { array, count } = this.__items ?? {};\n if (array && count) return { firstItem: array[0], count, countMinus1: count - 1 };\n }\n\n private get __summaryKey() {\n const items = this.__items;\n if (items) return items.isApproximateCount ? 'summary_approximate' : 'summary';\n }\n\n private get __statusOptions() {\n const d = this.data;\n const date = d?.first_failed_transaction_date ?? d?.end_date ?? d?.next_transaction_date;\n if (date) return { date };\n }\n\n private get __currencyCode() {\n const cart = this.__transactionTemplate;\n\n if (cart?.currency_code) {\n return cart.currency_code as string;\n } else {\n const allLocaleCodes = this.__localeCodesHelper;\n const localeCode = (this.__templateSet ?? this.__defaultTemplateSet)?.locale_code;\n const localeInfo = localeCode ? allLocaleCodes?.values[localeCode] : void 0;\n\n if (localeInfo) return /Currency: ([A-Z]{3})/g.exec(localeInfo)?.[1];\n }\n }\n\n private get __priceOptions() {\n const currencyDisplay = this.__currencyDisplay;\n if (currencyDisplay === undefined) return;\n\n const currencyCode = this.__currencyCode;\n if (currencyCode === undefined) return;\n\n const totalOrder = this.__transactionTemplate?.total_order;\n if (totalOrder === undefined) return;\n\n const frequency = this.data?.frequency;\n if (frequency === undefined) return;\n\n return {\n ...parseFrequency(frequency),\n amount: `${totalOrder} ${currencyCode}`,\n currencyDisplay,\n };\n }\n\n private get __statusKey() {\n const data = this.data;\n\n if (data === null) return;\n if (data.first_failed_transaction_date) return 'subscription_failed';\n if (data.end_date) {\n const hasEnded = new Date(data.end_date).getTime() > Date.now();\n return hasEnded ? 'subscription_will_be_cancelled' : 'subscription_cancelled';\n }\n\n return `subscription_${data.is_active ? 'active' : 'inactive'}`;\n }\n\n private get __priceKey() {\n const frequency = this.data?.frequency;\n if (frequency) return `price_${frequency === '.5m' ? 'twice_a_month' : 'recurring'}`;\n }\n}\n"]}
1
+ {"version":3,"file":"AdminSubscriptionCard.js","sourceRoot":"","sources":["../../../../src/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAChE,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,EAAE,GAAG,yBAAyB,CAAC;AACrC,MAAM,IAAI,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,OAAO,qBAAsB,SAAQ,IAAU;IAArD;;QAQE;;;;WAIG;QACH,gBAAW,GAAkB,IAAI,CAAC;QAEjB,kCAA6B,GAAG,2BAA2B,CAAC;QAE5D,iCAA4B,GAAG,0BAA0B,CAAC;QAE1D,gCAA2B,GAAG,mBAAmB,CAAC;QAElD,0BAAqB,GAAG,mBAAmB,CAAC;QAE5C,oBAAe,GAAG,aAAa,CAAC;QAEhC,oB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GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAChE,OAAO,QAAQ,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC,wBAAwB,CAAC;SAC/E;QAED,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK;YAAE,OAAO,uBAAuB,CAAC;QAC7D,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,IAAI,EAAE;YAAE,OAAO,6BAA6B,CAAC;QAEjF,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED,IAAY,UAAU;;QACpB,MAAM,SAAS,SAAG,IAAI,CAAC,IAAI,0CAAE,SAAS,CAAC;QACvC,IAAI,SAAS;YAAE,OAAO,SAAS,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACvF,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { NucleonElement } from '../NucleonElement/NucleonElement';\nimport type { Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { parseFrequency } from '../../../utils/parse-frequency';\nimport { InternalCard } from '../../internal/InternalCard/InternalCard';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-html';\n\nconst NS = 'admin-subscription-card';\nconst Base = ConfigurableMixin(TranslatableMixin(InternalCard, NS));\n\n/**\n * Card element representing a subscription (`fx:subscription`).\n * Admin-only.\n *\n * @element foxy-admin-subscription-card\n * @since 1.21.0\n */\nexport class AdminSubscriptionCard extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n localeCodes: { attribute: 'locale-codes' },\n };\n }\n\n /**\n * URL of the `fx:locale_codes` property helper.\n * This will be used to determine the currency code for subscriptions that link to a\n * transaction template without the code.\n */\n localeCodes: string | null = null;\n\n private readonly __transactionTemplateLoaderId = 'transactionTemplateLoader';\n\n private readonly __defaultTemplateSetLoaderId = 'defaultTemplateSetLoader';\n\n private readonly __localeCodesHelperLoaderId = 'localeCodesLoader';\n\n private readonly __templateSetLoaderId = 'templateSetLoader';\n\n private readonly __itemsLoaderId = 'itemsLoader';\n\n private readonly __storeLoaderId = 'storeLoader';\n\n renderBody(): TemplateResult {\n const isFailed = !!this.data?.first_failed_transaction_date;\n const cart = this.__transactionTemplate;\n\n const priceKey = this.__priceKey;\n const priceOptions = this.__priceOptions;\n const summaryOptions = this.__summaryOptions;\n const summaryKey = this.__summaryKey;\n const statusKey = this.__statusKey;\n const statusOptions = this.__statusOptions;\n\n return html`\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__transactionTemplateHref)}\n id=${this.__transactionTemplateLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__defaultTemplateSetHref)}\n id=${this.__defaultTemplateSetLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__localeCodesHelperHref)}\n id=${this.__localeCodesHelperLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__templateSetHref)}\n id=${this.__templateSetLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__itemsHref)}\n id=${this.__itemsLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__storeHref)}\n id=${this.__storeLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <div class=\"text-left leading-s text-tertiary\">\n <div class=\"flex items-center space-x-s\">\n <span class=\"block flex-1 font-medium text-body truncate\">\n ${summaryOptions && summaryKey\n ? html`<foxy-i18n infer=\"\" key=${summaryKey} .options=${summaryOptions}></foxy-i18n>`\n : html`&ZeroWidthSpace;`}\n </span>\n <span class=\"text-s\">\n ${priceOptions && priceKey\n ? html`<foxy-i18n infer=\"\" key=${priceKey} .options=${priceOptions}></foxy-i18n>`\n : html`&ZeroWidthSpace;`}\n </span>\n </div>\n\n <div class=\"truncate text-s ${isFailed ? 'text-error' : 'text-secondary'}\">\n ${statusOptions && statusKey\n ? html`<foxy-i18n infer=\"\" key=${statusKey} .options=${statusOptions}></foxy-i18n>`\n : html`&ZeroWidthSpace;`}\n </div>\n\n <div class=\"text-tertiary truncate text-s\">${cart?.customer_email}&ZeroWidthSpace;</div>\n </div>\n `;\n }\n\n get isBodyReady(): boolean {\n const isLoaded = !!this.__items && !!this.__currencyCode && !!this.__currencyDisplay;\n return super.isBodyReady && isLoaded;\n }\n\n private get __transactionTemplateHref() {\n const data = this.data;\n\n if (!data) return;\n if ('_embedded' in data && 'fx:transaction_template' in data._embedded) return;\n\n const url = new URL(this.data?._links['fx:transaction_template'].href ?? '');\n url.searchParams.set('zoom', 'items');\n return url.toString();\n }\n\n private get __defaultTemplateSetHref() {\n const templateSetUri = this.__transactionTemplate?.template_set_uri;\n\n if (templateSetUri === '') {\n try {\n const url = new URL(this.__store?._links['fx:template_sets'].href ?? '');\n url.searchParams.set('code', 'DEFAULT');\n return url.toString();\n } catch {\n //\n }\n }\n }\n\n private get __localeCodesHelperHref() {\n if (this.__defaultTemplateSetHref || this.__templateSetHref) {\n return this.localeCodes ?? void 0;\n }\n }\n\n private get __templateSetHref() {\n const cart = this.__transactionTemplate;\n if (!cart?.currency_code) return cart?.template_set_uri || void 0;\n }\n\n private get __itemsHref() {\n const cart = this.__transactionTemplate;\n\n if (!cart) return;\n if ('_embedded' in cart && 'fx:items' in cart._embedded) return;\n\n const url = new URL(cart._links['fx:items'].href);\n url.searchParams.set('limit', '1');\n return url.toString();\n }\n\n private get __storeHref() {\n return this.data?._links['fx:store']?.href;\n }\n\n private get __transactionTemplate() {\n const data = this.data;\n\n if (data && '_embedded' in data && 'fx:transaction_template' in data._embedded) {\n type Cart = Resource<Rels.TransactionTemplate>;\n type CartWithItems = Resource<Rels.TransactionTemplate, { zoom: 'items' }>;\n return data._embedded['fx:transaction_template'] as Cart | CartWithItems;\n } else {\n type Loader = NucleonElement<Resource<Rels.TransactionTemplate, { zoom: 'items' }>>;\n const selector = `#${this.__transactionTemplateLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n }\n\n private get __defaultTemplateSet() {\n type Loader = NucleonElement<Resource<Rels.TemplateSets>>;\n const selector = `#${this.__defaultTemplateSetLoaderId}`;\n const loader = this.renderRoot.querySelector<Loader>(selector);\n return loader?.data?._embedded['fx:template_sets'][0] ?? null;\n }\n\n private get __localeCodesHelper() {\n type Loader = NucleonElement<Resource<Rels.LocaleCodes>>;\n const selector = `#${this.__localeCodesHelperLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __templateSet() {\n type Loader = NucleonElement<Resource<Rels.TemplateSet>>;\n const selector = `#${this.__templateSetLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __items() {\n type Cart = Resource<Rels.TransactionTemplate>;\n type CartWithItems = Resource<Rels.TransactionTemplate, { zoom: 'items' }>;\n\n const cart = this.__transactionTemplate as Cart | CartWithItems | null;\n\n if (cart && '_embedded' in cart && 'fx:items' in cart._embedded) {\n const items = cart._embedded['fx:items'];\n\n return {\n array: items,\n count: items.length,\n isApproximateCount: items.length === 20,\n };\n }\n\n type Loader = NucleonElement<Resource<Rels.Items>>;\n const loader = this.renderRoot.querySelector<Loader>(`#${this.__itemsLoaderId}`);\n if (!loader?.data) return null;\n\n return {\n array: loader.data._embedded['fx:items'],\n count: loader.data.total_items,\n isApproximateCount: false,\n };\n }\n\n private get __store() {\n type Loader = NucleonElement<Resource<Rels.Store>>;\n const selector = `#${this.__storeLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __currencyDisplay() {\n const useCode = this.__store?.use_international_currency_symbol;\n\n if (useCode === true) return 'code';\n if (useCode === false) return 'symbol';\n }\n\n private get __summaryOptions() {\n const { array, count } = this.__items ?? {};\n if (array && count) return { firstItem: array[0], count, countMinus1: count - 1 };\n }\n\n private get __summaryKey() {\n const items = this.__items;\n if (items) return items.isApproximateCount ? 'summary_approximate' : 'summary';\n }\n\n private get __statusOptions() {\n const data = this.data;\n\n if (data === null) return;\n if (data.first_failed_transaction_date) return { date: data.first_failed_transaction_date };\n if (data.end_date) return { date: data.end_date };\n if (data.is_active === false) return {};\n if (new Date(data.start_date) > new Date()) return { date: data.start_date };\n\n return { date: data.next_transaction_date };\n }\n\n private get __currencyCode() {\n const cart = this.__transactionTemplate;\n\n if (cart?.currency_code) {\n return cart.currency_code as string;\n } else {\n const allLocaleCodes = this.__localeCodesHelper;\n const localeCode = (this.__templateSet ?? this.__defaultTemplateSet)?.locale_code;\n const localeInfo = localeCode ? allLocaleCodes?.values[localeCode] : void 0;\n\n if (localeInfo) return /Currency: ([A-Z]{3})/g.exec(localeInfo)?.[1];\n }\n }\n\n private get __priceOptions() {\n const currencyDisplay = this.__currencyDisplay;\n if (currencyDisplay === undefined) return;\n\n const currencyCode = this.__currencyCode;\n if (currencyCode === undefined) return;\n\n const totalOrder = this.__transactionTemplate?.total_order;\n if (totalOrder === undefined) return;\n\n const frequency = this.data?.frequency;\n if (frequency === undefined) return;\n\n return {\n ...parseFrequency(frequency),\n amount: `${totalOrder} ${currencyCode}`,\n currencyDisplay,\n };\n }\n\n private get __statusKey() {\n const data = this.data;\n\n if (data === null) return;\n if (data.first_failed_transaction_date) return 'subscription_failed';\n if (data.end_date) {\n const hasEnded = new Date(data.end_date).getTime() > Date.now();\n return hasEnded ? 'subscription_will_be_cancelled' : 'subscription_cancelled';\n }\n\n if (data.is_active === false) return 'subscription_inactive';\n if (new Date(data.start_date) > new Date()) return 'subscription_will_be_active';\n\n return 'subscription_active';\n }\n\n private get __priceKey() {\n const frequency = this.data?.frequency;\n if (frequency) return `price_${frequency === '.5m' ? 'twice_a_month' : 'recurring'}`;\n }\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import type { TemplateResult } from 'lit-html';
2
+ import type { Data } from './types';
3
+ import { InternalCard } from '../../internal/InternalCard/InternalCard';
4
+ declare const Base: typeof InternalCard & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
5
+ defaultNS: string;
6
+ };
7
+ /**
8
+ * Basic card displaying a native integration (`fx:native_integration`).
9
+ *
10
+ * @element foxy-native-integration-card
11
+ * @since 1.25.0
12
+ */
13
+ export declare class NativeIntegrationCard extends Base<Data> {
14
+ renderBody(): TemplateResult;
15
+ private __getImageSrc;
16
+ private __getSubtitle;
17
+ private __getTitle;
18
+ }
19
+ export {};