@foxy.io/elements 1.29.0-beta.1 → 1.29.0-beta.2

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 (256) 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-admin-subscription-form.js +1 -0
  6. package/dist/cdn/foxy-api-browser.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  8. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  9. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-card.js +1 -1
  11. package/dist/cdn/foxy-attribute-form.js +1 -1
  12. package/dist/cdn/foxy-billing-address-card.js +1 -1
  13. package/dist/cdn/foxy-cancellation-form.js +1 -1
  14. package/dist/cdn/foxy-cart-card.js +1 -1
  15. package/dist/cdn/foxy-cart-form.js +2 -2
  16. package/dist/cdn/foxy-client-card.js +1 -1
  17. package/dist/cdn/foxy-client-form.js +1 -1
  18. package/dist/cdn/foxy-collection-page.js +1 -1
  19. package/dist/cdn/foxy-collection-pages.js +1 -1
  20. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  21. package/dist/cdn/foxy-coupon-card.js +1 -1
  22. package/dist/cdn/foxy-coupon-code-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  24. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  25. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  26. package/dist/cdn/foxy-coupon-form.js +1 -1
  27. package/dist/cdn/foxy-custom-field-card.js +1 -1
  28. package/dist/cdn/foxy-custom-field-form.js +1 -1
  29. package/dist/cdn/foxy-customer-card.js +1 -1
  30. package/dist/cdn/foxy-customer-form.js +1 -1
  31. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  32. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  33. package/dist/cdn/foxy-customer-portal.js +1 -1
  34. package/dist/cdn/foxy-customer.js +1 -1
  35. package/dist/cdn/foxy-customers-table.js +1 -1
  36. package/dist/cdn/foxy-discount-builder.js +1 -1
  37. package/dist/cdn/foxy-discount-card.js +1 -1
  38. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  39. package/dist/cdn/foxy-donation.js +1 -1
  40. package/dist/cdn/foxy-downloadable-card.js +1 -1
  41. package/dist/cdn/foxy-downloadable-form.js +1 -1
  42. package/dist/cdn/foxy-email-template-card.js +1 -1
  43. package/dist/cdn/foxy-email-template-form.js +1 -1
  44. package/dist/cdn/foxy-error-entry-card.js +1 -1
  45. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  46. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  47. package/dist/cdn/foxy-form-dialog.js +1 -1
  48. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  49. package/dist/cdn/foxy-gift-card-card.js +1 -1
  50. package/dist/cdn/foxy-gift-card-code-card.js +1 -1
  51. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  52. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  53. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  54. package/dist/cdn/foxy-gift-card-form.js +1 -1
  55. package/dist/cdn/foxy-i18n-editor.js +1 -1
  56. package/dist/cdn/foxy-i18n.js +1 -1
  57. package/dist/cdn/foxy-integration-card.js +1 -1
  58. package/dist/cdn/foxy-integration-form.js +1 -1
  59. package/dist/cdn/foxy-item-card.js +1 -1
  60. package/dist/cdn/foxy-item-category-card.js +1 -1
  61. package/dist/cdn/foxy-item-category-form.js +1 -1
  62. package/dist/cdn/foxy-item-form.js +2 -2
  63. package/dist/cdn/foxy-item-option-card.js +1 -1
  64. package/dist/cdn/foxy-item-option-form.js +1 -1
  65. package/dist/cdn/foxy-items-form.js +1 -1
  66. package/dist/cdn/foxy-native-integration-card.js +1 -1
  67. package/dist/cdn/foxy-native-integration-form.js +1 -1
  68. package/dist/cdn/foxy-pagination.js +1 -1
  69. package/dist/cdn/foxy-passkey-card.js +1 -1
  70. package/dist/cdn/foxy-passkey-form.js +1 -1
  71. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  72. package/dist/cdn/foxy-payment-card.js +1 -1
  73. package/dist/cdn/foxy-payment-method-card.js +1 -1
  74. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  75. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  76. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  77. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  78. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  80. package/dist/cdn/foxy-query-builder.js +1 -1
  81. package/dist/cdn/foxy-report-form.js +2 -2
  82. package/dist/cdn/foxy-reports-table.js +1 -1
  83. package/dist/cdn/foxy-shipment-card.js +1 -1
  84. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  85. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  86. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  88. package/dist/cdn/foxy-sign-in-form.js +1 -1
  89. package/dist/cdn/foxy-spinner.js +2 -2
  90. package/dist/cdn/foxy-store-card.js +1 -1
  91. package/dist/cdn/foxy-store-form.js +1 -1
  92. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  93. package/dist/cdn/foxy-subscription-card.js +1 -1
  94. package/dist/cdn/foxy-subscription-form.js +1 -1
  95. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  96. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  97. package/dist/cdn/foxy-table.js +1 -1
  98. package/dist/cdn/foxy-tax-card.js +1 -1
  99. package/dist/cdn/foxy-tax-form.js +1 -1
  100. package/dist/cdn/foxy-template-config-form.js +1 -1
  101. package/dist/cdn/foxy-template-form.js +1 -1
  102. package/dist/cdn/foxy-template-set-card.js +1 -1
  103. package/dist/cdn/foxy-template-set-form.js +1 -1
  104. package/dist/cdn/foxy-transaction-card.js +1 -1
  105. package/dist/cdn/foxy-transaction.js +1 -1
  106. package/dist/cdn/foxy-transactions-table.js +1 -1
  107. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  108. package/dist/cdn/foxy-user-card.js +1 -1
  109. package/dist/cdn/foxy-user-form.js +1 -1
  110. package/dist/cdn/foxy-users-table.js +1 -1
  111. package/dist/cdn/foxy-webhook-card.js +1 -1
  112. package/dist/cdn/foxy-webhook-form.js +1 -1
  113. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  114. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  115. package/dist/cdn/{shared-5318a742.js → shared-021c7a22.js} +1 -1
  116. package/dist/cdn/{shared-bedfd929.js → shared-075796e2.js} +1 -1
  117. package/dist/cdn/{shared-39c40d76.js → shared-10325cda.js} +1 -1
  118. package/dist/cdn/{shared-83451a72.js → shared-10b5e78f.js} +1 -1
  119. package/dist/cdn/{shared-ae013b1a.js → shared-12ac8cc6.js} +1 -1
  120. package/dist/cdn/{shared-06119334.js → shared-1cf1e1a4.js} +1 -1
  121. package/dist/cdn/{shared-ee67d0e4.js → shared-2099544a.js} +1 -1
  122. package/dist/cdn/shared-292ba15e.js +1 -0
  123. package/dist/cdn/{shared-6271dae8.js → shared-2a71795e.js} +1 -1
  124. package/dist/cdn/{shared-704ad583.js → shared-2d723710.js} +1 -1
  125. package/dist/cdn/{shared-3df30d85.js → shared-2fc671cd.js} +1 -1
  126. package/dist/cdn/{shared-8d6749b3.js → shared-30221a16.js} +1 -1
  127. package/dist/cdn/{shared-64d3d924.js → shared-303b428e.js} +1 -1
  128. package/dist/cdn/{shared-30792d92.js → shared-339bbd50.js} +1 -1
  129. package/dist/cdn/{shared-9da63461.js → shared-39a33102.js} +1 -1
  130. package/dist/cdn/{shared-cfe1bd8c.js → shared-3e03c988.js} +1 -1
  131. package/dist/cdn/{shared-c5a48553.js → shared-3fa791ca.js} +1 -1
  132. package/dist/cdn/{shared-509a1775.js → shared-4993a79d.js} +1 -1
  133. package/dist/cdn/shared-4c2d43e6.js +1 -0
  134. package/dist/cdn/{shared-0b5eb6d1.js → shared-558bc894.js} +1 -1
  135. package/dist/cdn/{shared-1a6877b1.js → shared-5c05ac06.js} +1 -1
  136. package/dist/cdn/shared-61f4e91a.js +1 -0
  137. package/dist/cdn/{shared-80bfcae3.js → shared-634b670e.js} +1 -1
  138. package/dist/cdn/{shared-665965d3.js → shared-644ee296.js} +1 -1
  139. package/dist/cdn/{shared-94ddc918.js → shared-6a4e81ad.js} +1 -1
  140. package/dist/cdn/{shared-b4d20b03.js → shared-6e355777.js} +1 -1
  141. package/dist/cdn/{shared-61c0bc51.js → shared-7026fb08.js} +1 -1
  142. package/dist/cdn/shared-70a5fad6.js +1 -0
  143. package/dist/cdn/{shared-a3abd1de.js → shared-72c61f43.js} +1 -1
  144. package/dist/cdn/{shared-59978b05.js → shared-72f41a65.js} +1 -1
  145. package/dist/cdn/{shared-30e7450c.js → shared-77051754.js} +1 -1
  146. package/dist/cdn/{shared-cc4dabfb.js → shared-77c4acdd.js} +1 -1
  147. package/dist/cdn/{shared-bc409d96.js → shared-797ba64a.js} +1 -1
  148. package/dist/cdn/{shared-94bae3fb.js → shared-7b8ad9c1.js} +1 -1
  149. package/dist/cdn/shared-7ce91c80.js +1 -0
  150. package/dist/cdn/{shared-2ae42363.js → shared-7fd9a30f.js} +1 -1
  151. package/dist/cdn/{shared-9df5667e.js → shared-81d3a9ae.js} +1 -1
  152. package/dist/cdn/{shared-74a6f365.js → shared-876a4341.js} +1 -1
  153. package/dist/cdn/shared-8c1df97c.js +1 -0
  154. package/dist/cdn/{shared-70d41727.js → shared-8f7a31e0.js} +2 -2
  155. package/dist/cdn/{shared-69a37aba.js → shared-9a90a24e.js} +1 -1
  156. package/dist/cdn/{shared-088655e0.js → shared-a036e345.js} +1 -1
  157. package/dist/cdn/{shared-50db6104.js → shared-a159ccff.js} +1 -1
  158. package/dist/cdn/{shared-248c08ac.js → shared-a6273e4a.js} +1 -1
  159. package/dist/cdn/{shared-bc0421a7.js → shared-abea5e34.js} +1 -1
  160. package/dist/cdn/{shared-5ec4c4b3.js → shared-acdcae7e.js} +1 -1
  161. package/dist/cdn/{shared-4feadd89.js → shared-aefac46b.js} +1 -1
  162. package/dist/cdn/{shared-5860410a.js → shared-b6814728.js} +2 -2
  163. package/dist/cdn/{shared-1101a938.js → shared-b731dfc5.js} +1 -1
  164. package/dist/cdn/{shared-ddde3914.js → shared-b98b8d02.js} +1 -1
  165. package/dist/cdn/{shared-4f0975c8.js → shared-bdd4fbbb.js} +1 -1
  166. package/dist/cdn/shared-cbb0e610.js +1 -0
  167. package/dist/cdn/{shared-67aa8143.js → shared-cc79152c.js} +1 -1
  168. package/dist/cdn/{shared-c47c9449.js → shared-d464d078.js} +1 -1
  169. package/dist/cdn/{shared-3f0e394a.js → shared-d4810405.js} +1 -1
  170. package/dist/cdn/{shared-ef2b5ceb.js → shared-d6010c96.js} +1 -1
  171. package/dist/cdn/{shared-e5a04929.js → shared-df00a537.js} +1 -1
  172. package/dist/cdn/{shared-f293f1ae.js → shared-e2a61f69.js} +1 -1
  173. package/dist/cdn/{shared-c1b96673.js → shared-e5d37737.js} +1 -1
  174. package/dist/cdn/{shared-f1e4e392.js → shared-e6e84ff5.js} +1 -1
  175. package/dist/cdn/{shared-730e6ac7.js → shared-f1d2b5bb.js} +1 -1
  176. package/dist/cdn/{shared-84c5aab1.js → shared-f22f22ae.js} +1 -1
  177. package/dist/cdn/{shared-9ee0844c.js → shared-f5366dda.js} +1 -1
  178. package/dist/cdn/{shared-02d9cca5.js → shared-fa9e5c7f.js} +1 -1
  179. package/dist/cdn/{shared-4b7f8c12.js → shared-fb56178f.js} +1 -1
  180. package/dist/cdn/{shared-dfab3fb1.js → shared-fe77f6f6.js} +1 -1
  181. package/dist/cdn/{shared-a917b3e5.js → shared-ff63a551.js} +1 -1
  182. package/dist/cdn/{shared-b5cd2b39.js → shared-ffd3690b.js} +1 -1
  183. package/dist/cdn/translations/admin-subscription-form/en.json +1840 -0
  184. package/dist/cdn/translations/cart-form/en.json +1 -1
  185. package/dist/cdn/translations/transaction/en.json +0 -1
  186. package/dist/elements/internal/InternalDateControl/InternalDateControl.d.ts +4 -1
  187. package/dist/elements/internal/InternalDateControl/InternalDateControl.js +36 -3
  188. package/dist/elements/internal/InternalDateControl/InternalDateControl.js.map +1 -1
  189. package/dist/elements/internal/InternalDateControl/getMonthNames.d.ts +1 -0
  190. package/dist/elements/internal/InternalDateControl/getMonthNames.js +7 -0
  191. package/dist/elements/internal/InternalDateControl/getMonthNames.js.map +1 -0
  192. package/dist/elements/internal/InternalDateControl/getWeekdayLongNames.d.ts +1 -0
  193. package/dist/elements/internal/InternalDateControl/getWeekdayLongNames.js +8 -0
  194. package/dist/elements/internal/InternalDateControl/getWeekdayLongNames.js.map +1 -0
  195. package/dist/elements/internal/InternalDateControl/getWeekdayShortNames.d.ts +1 -0
  196. package/dist/elements/internal/InternalDateControl/getWeekdayShortNames.js +8 -0
  197. package/dist/elements/internal/InternalDateControl/getWeekdayShortNames.js.map +1 -0
  198. package/dist/elements/internal/InternalDateControl/index.d.ts +1 -0
  199. package/dist/elements/internal/InternalDateControl/index.js +1 -0
  200. package/dist/elements/internal/InternalDateControl/index.js.map +1 -1
  201. package/dist/elements/internal/InternalDateControl/vaadinStyles.d.ts +1 -0
  202. package/dist/elements/internal/InternalDateControl/vaadinStyles.js +73 -0
  203. package/dist/elements/internal/InternalDateControl/vaadinStyles.js.map +1 -0
  204. package/dist/elements/internal/InternalForm/InternalForm.js +1 -1
  205. package/dist/elements/internal/InternalForm/InternalForm.js.map +1 -1
  206. package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.d.ts +3 -0
  207. package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.js +128 -1
  208. package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.js.map +1 -1
  209. package/dist/elements/internal/InternalNumberControl/InternalNumberControl.d.ts +4 -1
  210. package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js +93 -1
  211. package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js.map +1 -1
  212. package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.d.ts +1 -1
  213. package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js +3 -3
  214. package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js.map +1 -1
  215. package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.d.ts +14 -0
  216. package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js +109 -0
  217. package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js.map +1 -0
  218. package/dist/elements/public/AdminSubscriptionForm/index.d.ts +13 -0
  219. package/dist/elements/public/AdminSubscriptionForm/index.js +15 -0
  220. package/dist/elements/public/AdminSubscriptionForm/index.js.map +1 -0
  221. package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormError/InternalAdminSubscriptionFormError.d.ts +5 -0
  222. package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormError/InternalAdminSubscriptionFormError.js +17 -0
  223. package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormError/InternalAdminSubscriptionFormError.js.map +1 -0
  224. package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormError/index.d.ts +3 -0
  225. package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormError/index.js +5 -0
  226. package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormError/index.js.map +1 -0
  227. package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLoadInCartAction/InternalAdminSubscriptionFormLoadInCartAction.d.ts +8 -0
  228. package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLoadInCartAction/InternalAdminSubscriptionFormLoadInCartAction.js +40 -0
  229. package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLoadInCartAction/InternalAdminSubscriptionFormLoadInCartAction.js.map +1 -0
  230. package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLoadInCartAction/index.d.ts +4 -0
  231. package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLoadInCartAction/index.js +6 -0
  232. package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLoadInCartAction/index.js.map +1 -0
  233. package/dist/elements/public/AdminSubscriptionForm/types.d.ts +5 -0
  234. package/dist/elements/public/AdminSubscriptionForm/types.js +2 -0
  235. package/dist/elements/public/AdminSubscriptionForm/types.js.map +1 -0
  236. package/dist/elements/public/CartForm/CartForm.d.ts +1 -0
  237. package/dist/elements/public/CartForm/CartForm.js +23 -21
  238. package/dist/elements/public/CartForm/CartForm.js.map +1 -1
  239. package/dist/elements/public/FormDialog/FormDialog.js +2 -3
  240. package/dist/elements/public/FormDialog/FormDialog.js.map +1 -1
  241. package/dist/elements/public/index.d.ts +1 -0
  242. package/dist/elements/public/index.defined.d.ts +1 -0
  243. package/dist/elements/public/index.defined.js +1 -0
  244. package/dist/elements/public/index.defined.js.map +1 -1
  245. package/dist/elements/public/index.js +1 -0
  246. package/dist/elements/public/index.js.map +1 -1
  247. package/dist/mixins/themeable.js +4 -0
  248. package/dist/mixins/themeable.js.map +1 -1
  249. package/package.json +1 -1
  250. package/dist/cdn/shared-55b621e8.js +0 -1
  251. package/dist/cdn/shared-64fcd0da.js +0 -1
  252. package/dist/cdn/shared-7e39ec54.js +0 -1
  253. package/dist/cdn/shared-963d252e.js +0 -1
  254. package/dist/cdn/shared-a636184a.js +0 -1
  255. package/dist/cdn/shared-d6b4d84f.js +0 -1
  256. package/dist/cdn/shared-deab9fa5.js +0 -1
@@ -1 +1 @@
1
- import"./shared-1a6877b1.js";import"./shared-4b7f8c12.js";import"./shared-cfe1bd8c.js";import"./shared-088655e0.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-730e6ac7.js";import{_ as e,B as t}from"./shared-0f6e4584.js";import{l as s}from"./shared-2bf89a21.js";import{C as i,a as o}from"./shared-509a1775.js";import{h as n}from"./shared-dc73b9a5.js";import{C as a}from"./shared-6271dae8.js";import{C as r}from"./shared-0b01f721.js";import{N as l}from"./shared-24d71d01.js";import{T as d,a as c,S as u,R as h}from"./shared-bedfd929.js";import{c as g}from"./shared-4e709717.js";import{i as p}from"./shared-9803aa7c.js";import{G as f}from"./shared-69a37aba.js";import{l as y}from"./shared-22ba9566.js";import"./shared-8d6749b3.js";import"./shared-94ddc918.js";import"./shared-dfab3fb1.js";import"./shared-c1b96673.js";import"./shared-5ec4c4b3.js";import"./shared-61ade33e.js";import"./shared-70d41727.js";import"./shared-94bae3fb.js";import"./shared-f7a1193f.js";import"./shared-a0c6a159.js";import"./shared-343d1fd7.js";import"./shared-a917b3e5.js";import"./shared-e5a04929.js";import"./shared-30792d92.js";import"./shared-cc4dabfb.js";import"./shared-f293f1ae.js";import"./shared-bc409d96.js";import"./shared-39c40d76.js";import"./shared-5318a742.js";import"./shared-ee67d0e4.js";import"./shared-3df30d85.js";import"./shared-651c44fa.js";import"./shared-5860410a.js";import"./shared-80bfcae3.js";import"./shared-99940888.js";import"./shared-ee36b83f.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";let _,x,b,m,$,v=e=>e;const k=r(d(c(l)));class w extends k{constructor(){super(...arguments),this.regions=[],this.name="",this.code="",this.__newRegion=""}static get properties(){return e(e({},super.properties),{},{__newRegion:{attribute:!1},regions:{type:Array},name:{type:String},code:{type:String}})}render(){var e,t;return n(_||(_=v` <div class="${0}"> <div data-testid="country" class="h-m flex justify-between items-center border-b border-contrast-10"> <div class="ml-m"> <span>${0}</span> ${0} </div> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> <div data-testid="regions" class="flex flex-wrap p-xs"> ${0} <div data-testid="new-region" style="border-radius:var(--lumo-size-s)" class="${0}"> <input placeholder="${0}" class="bg-transparent appearance-none h-s text-s px-s focus-outline-none" style="width:8rem" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> <datalist id="list"> ${0} </datalist> </div> </div> `),g({"border border-contrast-10 rounded text-s":!0,"text-disabled":this.disabled}),this.name||this.code,this.name?n(x||(x=v`<span class="text-secondary">${0}</span>`),this.code):"",this.t("delete"),g({"mr-xs items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>this.dispatchEvent(new CustomEvent("delete"))),this.regions.map((e=>{var t,s;const i=null===(s=null===(t=this.data)||void 0===t?void 0:t.values[e])||void 0===s?void 0:s.default;return n(b||(b=v` <div class="flex items-center border border-contrast-10 h-s m-xs" style="border-radius:var(--lumo-size-s)"> <span class="mx-s"> <span>${0}</span> ${0} </span> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),i||e,i?n(m||(m=v`<span class="text-secondary">${0}</span>`),e):"",this.t("delete"),g({"items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),g({"h-s m-xs items-center transition-colors border border-contrast-10":!0,"hover-border-contrast-40":!this.disabled,"focus-within-ring-1 ring-primary-50 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),this.t("add_region"),this.__newRegion,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newRegion&&this.__addRegion()}),(e=>{const t=e.currentTarget;this.__newRegion=t.value}),g({"flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__newRegion,"bg-success-10 text-success cursor-pointer":!!this.__newRegion,"hover-bg-success hover-text-success-contrast":!!this.__newRegion,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.__newRegion}),this.disabled||!this.__newRegion,this.__addRegion,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>n($||($=v`<option value="${0}">${0}</option>`),e.code,e.default))))}__addRegion(){this.regions=[...new Set([...this.regions,this.__newRegion])],this.__newRegion="",this.dispatchEvent(new CustomEvent("update:regions"))}}let j,S,O,q=e=>e;const T=u(r(d(c(l))));class J extends T{constructor(){super(...arguments),this.countries={},this.regions="",this.__newCountry=""}static get scopedElements(){return{"x-country-card":w,"iron-icon":customElements.get("iron-icon")}}static get properties(){return e(e({},super.properties),{},{__newCountry:{attribute:!1},countries:{type:Object},regions:{type:String}})}render(){var t,s;return n(j||(j=q` <div> <div class="space-y-s" data-testid="countries"> ${0} <div data-testid="new-country" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m text-s px-m focus-outline-none" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </div> <datalist id="list"> ${0} </datalist> </div> `),Object.entries(this.countries).map((([t,s])=>{var i,o;let a;try{const e=new URL(this.regions);e.searchParams.set("country_code",t),a=e.toString()}catch(e){a=""}return n(S||(S=q` <x-country-card regions="${0}" code="${0}" name="${0}" href="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </x-country-card> `),JSON.stringify("*"===s?[]:s),t,p(null===(o=null===(i=this.data)||void 0===i?void 0:i.values[t])||void 0===o?void 0:o.default),a,this.lang,this.ns,this.disabled,this.readonly,(s=>{const i=e({},this.countries),o=s.currentTarget.regions;i[t]=o.length?o:"*",this.countries=i,this.dispatchEvent(new CustomEvent("update:countries"))}),(()=>{const s=e({},this.countries);delete s[t],this.countries=s,this.dispatchEvent(new CustomEvent("update:countries"))}))})),g({"h-m flex items-center rounded transition-colors":!0,"border border-contrast-10 ring-primary-50":!0,"hover-border-contrast-40":!this.disabled,"focus-within-ring-1 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),this.t("add_country"),this.__newCountry,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newCountry&&this.__addCountry()}),(e=>{const t=e.currentTarget;this.__newCountry=t.value}),this.t("create"),g({"mr-xs flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__newCountry,"bg-success-10 text-success cursor-pointer":!!this.__newCountry,"hover-bg-success hover-text-success-contrast":!!this.__newCountry,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.__newCountry}),!this.__newCountry||this.disabled,this.__addCountry,Object.entries(null!==(s=null===(t=this.data)||void 0===t?void 0:t.values)&&void 0!==s?s:{}).map((([e,t])=>n(O||(O=q`<option value="${0}">${0}</option>`),e,t.default))))}__addCountry(){this.countries=e(e({},this.countries),{},{[this.__newCountry]:"*"}),this.__newCountry="",this.dispatchEvent(new CustomEvent("update:countries"))}}let N,C,E,F,V,R,H,I,z,A,D,G,B,L,U,P,M,W,K,Q,X,Y,Z,ee=e=>e;const te=u(h(r(d(c(l,"template-config-form")))));class se extends te{constructor(){super(...arguments),this.countries="",this.regions="",this.__addHiddenFieldInputValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"foxy-internal-source-control":customElements.get("foxy-internal-source-control"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-countries-list":J,"x-checkbox":a,"x-choice":i,"x-group":f}}static get properties(){return e(e({},super.properties),{},{__addHiddenFieldInputValue:{attribute:!1},countries:{type:String},regions:{type:String}})}render(){var e,t;const s=this.hiddenSelector,i=this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},google_tag:{usage:"none",send_to:"",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}};return n(N||(N=ee` <div class="relative" aria-busy="${0}" aria-live="polite"> <div class="space-y-l"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-source-control data-testid="custom-config" helper-text="${0}" placeholder='{ "key": "value" }' label="${0}" infer="custom-config" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control data-testid="header" placeholder="<style>h1 { color: red }</style>" helper-text="${0}" label="${0}" infer="header" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control data-testid="custom-fields" placeholder='<label>Comment: <input name="comment"></label>' helper-text="${0}" label="${0}" infer="custom-fields" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control data-testid="footer" placeholder='<script src="https://example.com/code.js"></script>' helper-text="${0}" label="${0}" infer="footer" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> </div> <div class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),s.matches("cart-type",!0)?"":this.__renderCartType(i),s.matches("foxycomplete",!0)?"":this.__renderFoxycomplete(i),s.matches("locations",!0)?"":this.__renderLocations(i),s.matches("hidden-fields",!0)?"":this.__renderHiddenFields(i),s.matches("cards",!0)?"":this.__renderCards(i),s.matches("checkout-type",!0)?"":this.__renderCheckoutType(i),s.matches("consent",!0)?"":this.__renderConsent(i),s.matches("fields",!0)?"":this.__renderFields(i),s.matches("google-analytics",!0)?"":this.__renderGoogleAnalytics(i),s.matches("google-tag",!0)?"":this.__renderGoogleTag(i),s.matches("troubleshooting",!0)?"":this.__renderTroubleshooting(i),this.t("custom_config_helper_text"),this.t("custom_config"),(()=>"string"==typeof i.custom_config?i.custom_config:JSON.stringify(i.custom_config,null,2)),(e=>{try{i.custom_config=JSON.parse(e)}catch(t){i.custom_config=e}this.edit({json:JSON.stringify(i)})}),this.t("custom_header_helper_text"),this.t("custom_header"),(()=>i.custom_script_values.header),(e=>{i.custom_script_values.header=e,this.edit({json:JSON.stringify(i)})}),this.t("custom_fields_helper_text"),this.t("custom_fields"),(()=>i.custom_script_values.checkout_fields),(e=>{i.custom_script_values.checkout_fields=e,this.edit({json:JSON.stringify(i)})}),this.t("custom_footer_helper_text"),this.t("custom_footer"),(()=>i.custom_script_values.footer),(e=>{i.custom_script_values.footer=e,this.edit({json:JSON.stringify(i)})}),g({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}get hiddenSelector(){var e;const s=[super.hiddenSelector.toString()],i=(null===(e=this.data)||void 0===e?void 0:e.json)?JSON.parse(this.data.json):null;return i&&"none"!==i.analytics_config.google_analytics.usage||s.push("google-analytics"),new t(s.join(" ").trim())}__renderCartType(t){const{lang:s,ns:i}=this,o=["default","fullpage","custom"],a=!this.in("idle")||this.disabledSelector.matches("cart-type",!0);return n(C||(C=ee` <div data-testid="cart-type"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="cart_type" ns="${0}"> </foxy-i18n> <x-choice data-testid="cart-type-choice" .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("cart-type:before"),a?"text-disabled":"",s,i,t.cart_type,o,a,this.readonlySelector.matches("cart-type",!0),(s=>{this.edit({json:JSON.stringify(e(e({},t),{},{cart_type:s.detail}))})}),o.map((e=>n(E||(E=ee` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="cart_type_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs ${0}" lang="${0}" key="cart_type_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,s,e,i,a?"text-disabled":"text-secondary",s,e,i))),this.renderTemplateOrSlot("cart-type:after"))}__renderFoxycomplete(e){const{lang:t,ns:s}=this,i=!this.in("idle")||this.disabledSelector.matches("foxycomplete",!0),a=this.readonlySelector.matches("foxycomplete",!0),r=e.foxycomplete,l=["combobox","search","disabled"],d="none"===r.usage?"disabled":r.show_combobox?"combobox":"search",c=n(F||(F=ee` <x-checkbox data-testid="foxycomplete-flags-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="show_country_flags" ns="${0}"></foxy-i18n> </x-checkbox> `),i,a,r.show_flags,(t=>{r.show_flags=t.detail,this.edit({json:JSON.stringify(e)})}),t,s);return n(V||(V=ee` <div data-testid="foxycomplete"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="foxycomplete" ns="${0}"> </foxy-i18n> <x-choice data-testid="foxycomplete-choice" .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} <div slot="combobox" class="space-y-m pb-s" ?hidden="${0}"> <div class="grid grid-cols-2 gap-m" style="max-width:16rem"> ${0} </div> ${0} </div> <div slot="search" class="pb-s" ?hidden="${0}">${0}</div> </x-choice> <div class="border-t border-contrast-10 p-m"> <x-checkbox data-testid="foxycomplete-lookup-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="enable_postcode_lookup" ns="${0}"></foxy-i18n> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("foxycomplete:before"),i?"text-disabled":"",t,s,d,l,i,a,(t=>{t instanceof o&&(r.usage="disabled"===t.detail?"none":"required",r.show_combobox="combobox"===t.detail,this.edit({json:JSON.stringify(e)}))}),l.map((e=>n(R||(R=ee` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="foxycomplete_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs ${0}" lang="${0}" key="foxycomplete_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,t,e,s,i?"text-disabled":"text-secondary",t,e,s))),"combobox"!==d,["open","close"].map((t=>{const s="open"===t?"combobox_open":"combobox_close";return n(H||(H=ee` <vaadin-text-field data-testid="foxycomplete-${0}-icon" style="--lumo-border-radius:var(--lumo-border-radius-s)" label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> `),t,this.t(`${t}_icon`),r[s],i,a,(e=>"Enter"===e.key&&this.submit()),(t=>{r[s]=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}))})),c,"search"!==d,c,i,a,"enabled"===e.postal_code_lookup.usage,(t=>{e.postal_code_lookup.usage=t.detail?"enabled":"none",this.edit({json:JSON.stringify(e)})}),t,s,this.renderTemplateOrSlot("foxycomplete:after"))}__renderLocations(e){const{lang:t,ns:s}=this,i=e.location_filtering,o=!this.in("idle")||this.disabledSelector.matches("locations",!0),a=this.readonlySelector.matches("locations",!0),r="blacklist"===i.shipping_filter_type?"block":"allow",l="both"===i.usage?"copy":"blacklist"===i.billing_filter_type?"block":"allow",d=()=>{if("both"===i.usage)i.billing_filter_type=i.shipping_filter_type,i.billing_filter_values=i.shipping_filter_values;else{const e=Object.keys(i.billing_filter_values).length>0,t=Object.keys(i.shipping_filter_values).length>0;i.usage=e||t?e&&!t?"billing":t&&!e?"shipping":"independent":"none"}};return n(I||(I=ee` <div data-testid="locations"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="location_plural" ns="${0}"> </foxy-i18n> <div class="grid sm-grid-cols-2 bg-contrast-10" style="gap:1px"> <x-group class="bg-base pt-m"> <foxy-i18n class="${0}" slot="header" lang="${0}" key="shipping" ns="${0}"> </foxy-i18n> <x-choice data-testid="locations-shipping-choice" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <x-countries-list data-testid="locations-shipping-list" countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> <x-group class="bg-base pt-m"> <foxy-i18n class="${0}" slot="header" lang="${0}" key="billing" ns="${0}"> </foxy-i18n> <x-choice data-testid="locations-billing-choice" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <foxy-i18n slot="copy-label" lang="${0}" key="same_as_shipping" ns="${0}"> </foxy-i18n> <x-countries-list data-testid="locations-billing-list" countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" ?hidden="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("locations:before"),o?"text-disabled":"",t,s,o?"text-disabled":"text-tertiary",t,s,["allow","block"],r,o,a,(t=>{"both"!==i.usage&&(i.usage="independent"),i.shipping_filter_type="block"===t.detail?"blacklist":"whitelist",d(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,JSON.stringify(i.shipping_filter_values),this.regions,this.countries,r,t,s,o,a,(t=>{i.shipping_filter_values=t.currentTarget.countries,d(),this.edit({json:JSON.stringify(e)})}),o?"text-disabled":"text-tertiary",t,s,["allow","block","copy"],l,o,a,(t=>{"copy"===t.detail?i.usage="both":(i.usage="independent",i.billing_filter_type="block"===t.detail?"blacklist":"whitelist"),d(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,t,s,JSON.stringify(i.billing_filter_values),this.regions,this.countries,l,t,s,o,a,"copy"===l,(t=>{i.billing_filter_values=t.currentTarget.countries,d(),this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("locations:after"))}__renderHiddenFields(e){const{lang:t,ns:s}=this,i=[],o=[],a=e.cart_display_config,r=!this.in("idle")||this.disabledSelector.matches("hidden-fields",!0),l=this.readonlySelector.matches("hidden-fields",!0);for(const e in a){if(!e.startsWith("show_"))continue;const t=e.substring(5);i.push(t),"required"!==a.usage||a[e]||o.push(t)}"required"===a.usage&&o.push(...a.hidden_product_options);const d=()=>{a.usage="required",i.includes(this.__addHiddenFieldInputValue)?a[`show_${this.__addHiddenFieldInputValue}`]=!1:a.hidden_product_options.includes(this.__addHiddenFieldInputValue)||a.hidden_product_options.push(this.__addHiddenFieldInputValue),this.edit({json:JSON.stringify(e)}),this.__addHiddenFieldInputValue=""},c="calc(var(--lumo-border-radius-l) / 1.2)",u=0===o.length?[c]:["0","0",c,c],h=r||!this.__addHiddenFieldInputValue;return n(z||(z=ee` <div data-testid="hidden-fields"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="hidden_fields" ns="${0}"> </foxy-i18n> <div class="divide-y divide-contrast-10" data-testid="hidden-fields-list"> ${0} </div> <div data-testid="hidden-fields-new" style="border-radius:${0}" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m px-m focus-outline-none" list="hidden-fields-list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <datalist id="hidden-fields-list"> ${0} </datalist> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("hidden-fields:before"),r?"text-disabled":"",t,s,o.map((o=>n(A||(A=ee` <div class="${0}"> ${0} <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m m-auto"></iron-icon> </button> </div> `),g({"h-m ml-m pr-xs flex items-center justify-between":!0,"text-secondary":l,"text-disabled":r}),i.includes(o)?n(D||(D=ee`<foxy-i18n lang="${0}" key="${0}" ns="${0}"></foxy-i18n>`),t,o,s):n(G||(G=ee`<span>${0}</span>`),o),this.t("delete"),g({"w-xs h-xs rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!r,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!r,"cursor-default":r,flex:!l,hidden:l}),r,(()=>{"boolean"==typeof a[`show_${o}`]?a[`show_${o}`]=!0:a.hidden_product_options=a.hidden_product_options.filter((e=>e!==o)),this.edit({json:JSON.stringify(e)})})))),u.join(" "),g({"h-m flex items-center ring-inset ring-primary-50 focus-within-ring-2":!0,"border-t border-contrast-10":o.length>0,flex:!l,hidden:l}),this.t("add_field"),y(this.__addHiddenFieldInputValue),r,l,(e=>"Enter"===e.key&&d()),(e=>{this.__addHiddenFieldInputValue=e.currentTarget.value}),i.filter((e=>!o.includes(e))).map((e=>n(B||(B=ee`<option value="${0}">${0}</option>`),e,this.t(e)))),this.t("add_field"),g({"w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":h,"bg-success-10 text-success cursor-pointer":!h,"hover-bg-success hover-text-success-contrast":!h,"focus-outline-none focus-ring-2":!h}),h,d,this.renderTemplateOrSlot("hidden-fields:after"))}__renderCards(e){const{lang:t,ns:i}=this,o=!this.in("idle")||this.disabledSelector.matches("cards",!0),a=this.readonlySelector.matches("cards",!0),r=e.supported_payment_cards;let l,d;"all_cards"===e.csc_requirements?(l=!1,d=!1):"sso_only"===e.csc_requirements?(l=!0,d=!1):(l=!0,d=!0);const c={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return n(L||(L=ee` <div data-testid="cards"> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="supported_cards" ns="${0}"> </foxy-i18n> <div class="flex flex-wrap m-xs p-s"> ${0} </div> <div class="flex flex-wrap p-s border-t border-contrast-10"> <x-checkbox data-testid="cards-saved-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_saved" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox data-testid="cards-sso-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_sso" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </x-group> <foxy-i18n class="text-xs leading-s block ${0}" lang="${0}" key="supported_cards_disclaimer" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("cards:before"),o?"text-disabled":"",t,i,Object.entries(s).map((([t,s])=>{if(!c[t])return;const i=r.includes(t);return n(U||(U=ee` <div class="${0}"> <label class="${0}"> <div class="h-s">${0}</div> <div class="text-s font-medium mx-s my-auto leading-none"> ${0} </div> <input type="checkbox" class="sr-only" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> </label> </div> `),g({"m-xs rounded":!0,"opacity-50 cursor-default":o,"cursor-pointer ring-primary-50 focus-within-ring-2":!o}),g({"overflow-hidden transition-colors flex rounded-s border":!0,"border-primary bg-primary-10 text-primary":i&&!a,"border-contrast bg-contrast-5 text-secondary":i&&a,"hover-text-body":i&&!o&&!a,"border-contrast-10":!i,"hover-border-primary":!i&&!o&&!a,"hover-text-primary":!i&&!o&&!a}),s,c[t],o,a,i,(s=>{if(a)return s.preventDefault();s.stopPropagation(),s.currentTarget.checked?r.push(t):r.splice(r.indexOf(t),1),this.edit({json:JSON.stringify(e)})}))})),o||"new_cards_only"===e.csc_requirements,a,l,(t=>{e.csc_requirements=t.detail?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),t,i,o,a,d,(t=>{e.csc_requirements=t.detail?"new_cards_only":l?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),t,i,o?"text-disabled":"text-secondary",t,i,this.renderTemplateOrSlot("cards:after"))}__renderCheckoutType(e){const{lang:t,ns:s}=this,i=!this.in("idle")||this.disabledSelector.matches("checkout-type",!0),o=this.readonlySelector.matches("checkout-type",!0);return n(P||(P=ee` <div data-testid="checkout-type"> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="checkout_type" ns="${0}"> </foxy-i18n> <x-choice data-testid="checkout-type-choice" ?disabled="${0}" ?readonly="${0}" .items="${0}" .value="${0}" .getText="${0}" @change="${0}"> </x-choice> </x-group> <foxy-i18n class="text-xs leading-s block ${0}" lang="${0}" key="checkout_type_helper_text" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("checkout-type:before"),i?"text-disabled":"",t,s,i,o,["default_account","default_guest","guest_only","account_only"],e.checkout_type,(e=>this.t(`checkout_type_${e}`)),(t=>{e.checkout_type=t.detail,this.edit({json:JSON.stringify(e)})}),i?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("checkout-type:after"))}__renderConsent(e){const{lang:t,ns:s}=this,i=e.tos_checkbox_settings,o=e.newsletter_subscribe,a=e.eu_secure_data_transfer_consent,r=!this.in("idle")||this.disabledSelector.matches("consent",!0),l=this.readonlySelector.matches("consent",!0),d="margin-left: calc(1.125rem + (var(--lumo-space-m) * 2))";return n(M||(M=ee` <div data-testid="consent"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="consent" ns="${0}"> </foxy-i18n> <x-checkbox data-testid="consent-tos-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_tos_link" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="display_tos_link_explainer" ns="${0}"> </foxy-i18n> </div> <div slot="content" ?hidden="${0}"> <vaadin-text-field data-testid="consent-tos-field" label="${0}" class="w-full mt-m" placeholder="https://example.com/path/to/tos" clear-button-visible ?disabled="${0}" ?readonly="${0}" .value="${0}" @input="${0}"> </vaadin-text-field> <div class="flex flex-wrap -mx-s -mb-s mt-s"> <x-checkbox data-testid="consent-tos-require-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="require_consent" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox data-testid="consent-tos-state-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="checked_by_default" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox data-testid="consent-mail-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="newsletter_subscribe" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="newsletter_subscribe_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox data-testid="consent-sdta-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_sdta" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="display_sdta_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </x-group> ${0} </div> `),this.renderTemplateOrSlot("consent:before"),r?"text-disabled":"",t,s,r,l,"required"===i.usage||"optional"===i.usage,(t=>{i.initial_state=t.detail?i.initial_state:"unchecked",i.is_hidden=!1,i.usage=t.detail?"required":"none",i.url=t.detail?i.url:"",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,"none"===i.usage,this.t("location_url"),r,l,i.url,(t=>{i.url=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}),r,l,"required"===i.usage,(t=>{i.usage=t.detail?"required":"optional",this.edit({json:JSON.stringify(e)})}),t,s,r,l,"checked"===i.initial_state,(t=>{i.initial_state=t.detail?"checked":"unchecked",this.edit({json:JSON.stringify(e)})}),t,s,d,r,l,"required"===o.usage,(t=>{o.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,d,r,l,"required"===a.usage,(t=>{a.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("consent:after"))}__renderFields(e){const{lang:t,ns:s}=this,i=!this.in("idle")||this.disabledSelector.matches("fields",!0),o=this.readonlySelector.matches("fields",!0),a=e.custom_checkout_field_requirements;return n(W||(W=ee` <div data-testid="fields"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="field_plural" ns="${0}"> </foxy-i18n> <div class="bg-contrast-10 grid grid-cols-1 sm-grid-cols-2" style="gap:1px"> ${0} <div class="bg-base hidden sm-block"></div> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("fields:before"),i?"text-disabled":"",t,s,Object.entries({cart_controls:["enabled","disabled"],coupon_entry:["enabled","disabled"],billing_first_name:["default","optional","required","hidden"],billing_last_name:["default","optional","required","hidden"],billing_company:["default","optional","required","hidden"],billing_tax_id:["default","optional","required","hidden"],billing_phone:["default","optional","required","hidden"],billing_address1:["default","optional","required","hidden"],billing_address2:["default","optional","required","hidden"],billing_city:["default","optional","required","hidden"],billing_region:["default","optional","required","hidden"],billing_postal_code:["default","optional","required","hidden"],billing_country:["default","optional","required","hidden"]}).map((([r,l])=>n(K||(K=ee` <label class="${0}"> <foxy-i18n class="flex-1" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="${0}"> ${0} </div> <div class="${0}"> <select data-testid="fields-${0}" class="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </select> <iron-icon class="pointer-events-none icon-inline text-xl" icon="icons:expand-more"> </iron-icon> </div> </label> `),g({"flex items-center pl-m bg-base":!0,"text-secondary":o,"text-disabled":i}),t,r.replace("billing_",""),s,g({"flex items-center text-right font-medium h-s px-s m-xs":o,hidden:!o}),this.t(l.find((e=>a[r]===e))),g({"px-s m-xs flex items-center rounded leading-none":!0,"ring-primary-50 ring-inset focus-within-ring-2":!i,"hover-text-primary":!i,"cursor-pointer":!i,"cursor-default":i,flex:!o,hidden:o}),r,g({"h-s mr-xs text-right appearance-none bg-transparent font-medium":!0,"focus-outline-none cursor-pointer":!i,"cursor-default":i}),i,o,(t=>{const s=t.currentTarget,i=s.options[s.options.selectedIndex].value;a[r]=i,this.edit({json:JSON.stringify(e)})}),l.map((e=>n(Q||(Q=ee` <option value="${0}" ?selected="${0}"> ${0} </option> `),e,a[r]===e,this.t(e))))))),this.renderTemplateOrSlot("fields:after"))}__renderGoogleAnalytics(e){const{lang:t,ns:s}=this,i=e.analytics_config,o=i.google_tag,a=i.google_analytics,r=!this.in("idle")||this.disabledSelector.matches("google-analytics",!0),l=this.readonlySelector.matches("google-analytics",!0);return n(X||(X=ee` <div data-testid="google-analytics"> ${0} <x-group frame> <span class="${0}" slot="header">Google Analytics</span> <foxy-i18n class="block bg-error-10 text-error font-medium rounded-t p-m" infer="" key="ga_deprecation_notice"> </foxy-i18n> <div class="p-m space-y-m"> <vaadin-text-field data-testid="google-analytics-field" style="--lumo-border-radius:var(--lumo-border-radius-s)" class="w-full" label="${0}" placeholder="UA-1234567-1" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <x-checkbox data-testid="google-analytics-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="ga_include_on_site" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="ga_include_on_site_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("google-analytics:before"),r?"text-disabled":"",this.t("ga_account_id"),this.t("ga_account_id_explainer"),y(a.account_id),r,l,(e=>"Enter"===e.key&&this.submit()),(t=>{a.account_id=t.currentTarget.value,a.usage=a.account_id?"required":"none",i.usage=a.account_id||o.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),r,l,a.include_on_site,(t=>{a.include_on_site=t.detail,this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("google-analytics:after"))}__renderGoogleTag(e){const t=e.analytics_config,s=t.google_tag,i=t.google_analytics,o=!this.in("idle")||this.disabledSelector.matches("google-tag",!0),a=this.readonlySelector.matches("google-tag",!0);return n(Y||(Y=ee` <div data-testid="google-tag"> ${0} <x-group frame> <span class="${0}" slot="header">Google Tag</span> <div class="p-m space-y-m"> <vaadin-text-field data-testid="google-tag-account-id" style="--lumo-border-radius:var(--lumo-border-radius-s)" class="w-full" label="${0}" placeholder="G-123456789" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-text-field data-testid="google-tag-send-to" style="--lumo-border-radius:var(--lumo-border-radius-s)" class="w-full" label="${0}" placeholder="AW-123456789/sABDCLqU3K2BEJb8cxDE" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <p class="text-xs text-secondary"> <foxy-i18n infer="" key="gt_usage_notice"></foxy-i18n> <a target="_blank" class="cursor-pointer group text-primary rounded-s font-medium focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://wiki.foxycart.com/v/2.0/analytics#google_tag_ga4_google_ads" rel="nofollow noreferrer noopener"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="gt_docs_link"> </foxy-i18n> </a> </p> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("google-tag:before"),o?"text-disabled":"",this.t("gt_account_id"),this.t("gt_account_id_explainer"),y(s.account_id),o,a,(e=>"Enter"===e.key&&this.submit()),(o=>{s.account_id=o.currentTarget.value,s.usage=s.account_id?"required":"none",t.usage=s.account_id||i.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),this.t("gt_send_to"),this.t("gt_send_to_explainer"),y(s.send_to),o,a,(e=>"Enter"===e.key&&this.submit()),(o=>{s.send_to=o.currentTarget.value,s.usage=s.account_id?"required":"none",t.usage=s.account_id||i.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("google-tag:after"))}__renderTroubleshooting(e){const{lang:t,ns:s}=this,i=e.debug,o=!this.in("idle")||this.disabledSelector.matches("troubleshooting",!0),a=this.readonlySelector.matches("troubleshooting",!0);return n(Z||(Z=ee` <div data-testid="troubleshooting"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="troubleshooting" ns="${0}"> </foxy-i18n> <div class="p-m space-y-m"> <x-checkbox data-testid="troubleshooting-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="troubleshooting_debug" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="troubleshooting_debug_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("troubleshooting:before"),o?"text-disabled":"",t,s,o,a,"required"===i.usage,(t=>{i.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,o?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("troubleshooting:after"))}}customElements.define("foxy-template-config-form",se);export{se as TemplateConfigForm};
1
+ import"./shared-5c05ac06.js";import"./shared-fb56178f.js";import"./shared-3e03c988.js";import"./shared-a036e345.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-f1d2b5bb.js";import{_ as e,B as t}from"./shared-0f6e4584.js";import{l as s}from"./shared-2bf89a21.js";import{C as i,a as o}from"./shared-4993a79d.js";import{h as n}from"./shared-dc73b9a5.js";import{C as a}from"./shared-2a71795e.js";import{C as r}from"./shared-0b01f721.js";import{N as l}from"./shared-24d71d01.js";import{T as d,a as c,S as u,R as h}from"./shared-075796e2.js";import{c as g}from"./shared-4e709717.js";import{i as p}from"./shared-9803aa7c.js";import{G as f}from"./shared-9a90a24e.js";import{l as y}from"./shared-22ba9566.js";import"./shared-30221a16.js";import"./shared-6a4e81ad.js";import"./shared-fe77f6f6.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-61ade33e.js";import"./shared-8f7a31e0.js";import"./shared-7b8ad9c1.js";import"./shared-f7a1193f.js";import"./shared-a0c6a159.js";import"./shared-343d1fd7.js";import"./shared-ff63a551.js";import"./shared-df00a537.js";import"./shared-339bbd50.js";import"./shared-77c4acdd.js";import"./shared-e2a61f69.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2099544a.js";import"./shared-2fc671cd.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-99940888.js";import"./shared-ee36b83f.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";let _,x,b,m,$,v=e=>e;const k=r(d(c(l)));class w extends k{constructor(){super(...arguments),this.regions=[],this.name="",this.code="",this.__newRegion=""}static get properties(){return e(e({},super.properties),{},{__newRegion:{attribute:!1},regions:{type:Array},name:{type:String},code:{type:String}})}render(){var e,t;return n(_||(_=v` <div class="${0}"> <div data-testid="country" class="h-m flex justify-between items-center border-b border-contrast-10"> <div class="ml-m"> <span>${0}</span> ${0} </div> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> <div data-testid="regions" class="flex flex-wrap p-xs"> ${0} <div data-testid="new-region" style="border-radius:var(--lumo-size-s)" class="${0}"> <input placeholder="${0}" class="bg-transparent appearance-none h-s text-s px-s focus-outline-none" style="width:8rem" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> <datalist id="list"> ${0} </datalist> </div> </div> `),g({"border border-contrast-10 rounded text-s":!0,"text-disabled":this.disabled}),this.name||this.code,this.name?n(x||(x=v`<span class="text-secondary">${0}</span>`),this.code):"",this.t("delete"),g({"mr-xs items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>this.dispatchEvent(new CustomEvent("delete"))),this.regions.map((e=>{var t,s;const i=null===(s=null===(t=this.data)||void 0===t?void 0:t.values[e])||void 0===s?void 0:s.default;return n(b||(b=v` <div class="flex items-center border border-contrast-10 h-s m-xs" style="border-radius:var(--lumo-size-s)"> <span class="mx-s"> <span>${0}</span> ${0} </span> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),i||e,i?n(m||(m=v`<span class="text-secondary">${0}</span>`),e):"",this.t("delete"),g({"items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),g({"h-s m-xs items-center transition-colors border border-contrast-10":!0,"hover-border-contrast-40":!this.disabled,"focus-within-ring-1 ring-primary-50 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),this.t("add_region"),this.__newRegion,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newRegion&&this.__addRegion()}),(e=>{const t=e.currentTarget;this.__newRegion=t.value}),g({"flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__newRegion,"bg-success-10 text-success cursor-pointer":!!this.__newRegion,"hover-bg-success hover-text-success-contrast":!!this.__newRegion,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.__newRegion}),this.disabled||!this.__newRegion,this.__addRegion,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>n($||($=v`<option value="${0}">${0}</option>`),e.code,e.default))))}__addRegion(){this.regions=[...new Set([...this.regions,this.__newRegion])],this.__newRegion="",this.dispatchEvent(new CustomEvent("update:regions"))}}let j,S,O,q=e=>e;const T=u(r(d(c(l))));class J extends T{constructor(){super(...arguments),this.countries={},this.regions="",this.__newCountry=""}static get scopedElements(){return{"x-country-card":w,"iron-icon":customElements.get("iron-icon")}}static get properties(){return e(e({},super.properties),{},{__newCountry:{attribute:!1},countries:{type:Object},regions:{type:String}})}render(){var t,s;return n(j||(j=q` <div> <div class="space-y-s" data-testid="countries"> ${0} <div data-testid="new-country" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m text-s px-m focus-outline-none" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </div> <datalist id="list"> ${0} </datalist> </div> `),Object.entries(this.countries).map((([t,s])=>{var i,o;let a;try{const e=new URL(this.regions);e.searchParams.set("country_code",t),a=e.toString()}catch(e){a=""}return n(S||(S=q` <x-country-card regions="${0}" code="${0}" name="${0}" href="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </x-country-card> `),JSON.stringify("*"===s?[]:s),t,p(null===(o=null===(i=this.data)||void 0===i?void 0:i.values[t])||void 0===o?void 0:o.default),a,this.lang,this.ns,this.disabled,this.readonly,(s=>{const i=e({},this.countries),o=s.currentTarget.regions;i[t]=o.length?o:"*",this.countries=i,this.dispatchEvent(new CustomEvent("update:countries"))}),(()=>{const s=e({},this.countries);delete s[t],this.countries=s,this.dispatchEvent(new CustomEvent("update:countries"))}))})),g({"h-m flex items-center rounded transition-colors":!0,"border border-contrast-10 ring-primary-50":!0,"hover-border-contrast-40":!this.disabled,"focus-within-ring-1 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),this.t("add_country"),this.__newCountry,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newCountry&&this.__addCountry()}),(e=>{const t=e.currentTarget;this.__newCountry=t.value}),this.t("create"),g({"mr-xs flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__newCountry,"bg-success-10 text-success cursor-pointer":!!this.__newCountry,"hover-bg-success hover-text-success-contrast":!!this.__newCountry,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.__newCountry}),!this.__newCountry||this.disabled,this.__addCountry,Object.entries(null!==(s=null===(t=this.data)||void 0===t?void 0:t.values)&&void 0!==s?s:{}).map((([e,t])=>n(O||(O=q`<option value="${0}">${0}</option>`),e,t.default))))}__addCountry(){this.countries=e(e({},this.countries),{},{[this.__newCountry]:"*"}),this.__newCountry="",this.dispatchEvent(new CustomEvent("update:countries"))}}let N,C,E,F,V,R,H,I,z,A,D,G,B,L,U,P,M,W,K,Q,X,Y,Z,ee=e=>e;const te=u(h(r(d(c(l,"template-config-form")))));class se extends te{constructor(){super(...arguments),this.countries="",this.regions="",this.__addHiddenFieldInputValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"foxy-internal-source-control":customElements.get("foxy-internal-source-control"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-countries-list":J,"x-checkbox":a,"x-choice":i,"x-group":f}}static get properties(){return e(e({},super.properties),{},{__addHiddenFieldInputValue:{attribute:!1},countries:{type:String},regions:{type:String}})}render(){var e,t;const s=this.hiddenSelector,i=this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},google_tag:{usage:"none",send_to:"",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}};return n(N||(N=ee` <div class="relative" aria-busy="${0}" aria-live="polite"> <div class="space-y-l"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-source-control data-testid="custom-config" helper-text="${0}" placeholder='{ "key": "value" }' label="${0}" infer="custom-config" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control data-testid="header" placeholder="<style>h1 { color: red }</style>" helper-text="${0}" label="${0}" infer="header" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control data-testid="custom-fields" placeholder='<label>Comment: <input name="comment"></label>' helper-text="${0}" label="${0}" infer="custom-fields" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control data-testid="footer" placeholder='<script src="https://example.com/code.js"></script>' helper-text="${0}" label="${0}" infer="footer" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> </div> <div class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),s.matches("cart-type",!0)?"":this.__renderCartType(i),s.matches("foxycomplete",!0)?"":this.__renderFoxycomplete(i),s.matches("locations",!0)?"":this.__renderLocations(i),s.matches("hidden-fields",!0)?"":this.__renderHiddenFields(i),s.matches("cards",!0)?"":this.__renderCards(i),s.matches("checkout-type",!0)?"":this.__renderCheckoutType(i),s.matches("consent",!0)?"":this.__renderConsent(i),s.matches("fields",!0)?"":this.__renderFields(i),s.matches("google-analytics",!0)?"":this.__renderGoogleAnalytics(i),s.matches("google-tag",!0)?"":this.__renderGoogleTag(i),s.matches("troubleshooting",!0)?"":this.__renderTroubleshooting(i),this.t("custom_config_helper_text"),this.t("custom_config"),(()=>"string"==typeof i.custom_config?i.custom_config:JSON.stringify(i.custom_config,null,2)),(e=>{try{i.custom_config=JSON.parse(e)}catch(t){i.custom_config=e}this.edit({json:JSON.stringify(i)})}),this.t("custom_header_helper_text"),this.t("custom_header"),(()=>i.custom_script_values.header),(e=>{i.custom_script_values.header=e,this.edit({json:JSON.stringify(i)})}),this.t("custom_fields_helper_text"),this.t("custom_fields"),(()=>i.custom_script_values.checkout_fields),(e=>{i.custom_script_values.checkout_fields=e,this.edit({json:JSON.stringify(i)})}),this.t("custom_footer_helper_text"),this.t("custom_footer"),(()=>i.custom_script_values.footer),(e=>{i.custom_script_values.footer=e,this.edit({json:JSON.stringify(i)})}),g({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}get hiddenSelector(){var e;const s=[super.hiddenSelector.toString()],i=(null===(e=this.data)||void 0===e?void 0:e.json)?JSON.parse(this.data.json):null;return i&&"none"!==i.analytics_config.google_analytics.usage||s.push("google-analytics"),new t(s.join(" ").trim())}__renderCartType(t){const{lang:s,ns:i}=this,o=["default","fullpage","custom"],a=!this.in("idle")||this.disabledSelector.matches("cart-type",!0);return n(C||(C=ee` <div data-testid="cart-type"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="cart_type" ns="${0}"> </foxy-i18n> <x-choice data-testid="cart-type-choice" .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("cart-type:before"),a?"text-disabled":"",s,i,t.cart_type,o,a,this.readonlySelector.matches("cart-type",!0),(s=>{this.edit({json:JSON.stringify(e(e({},t),{},{cart_type:s.detail}))})}),o.map((e=>n(E||(E=ee` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="cart_type_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs ${0}" lang="${0}" key="cart_type_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,s,e,i,a?"text-disabled":"text-secondary",s,e,i))),this.renderTemplateOrSlot("cart-type:after"))}__renderFoxycomplete(e){const{lang:t,ns:s}=this,i=!this.in("idle")||this.disabledSelector.matches("foxycomplete",!0),a=this.readonlySelector.matches("foxycomplete",!0),r=e.foxycomplete,l=["combobox","search","disabled"],d="none"===r.usage?"disabled":r.show_combobox?"combobox":"search",c=n(F||(F=ee` <x-checkbox data-testid="foxycomplete-flags-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="show_country_flags" ns="${0}"></foxy-i18n> </x-checkbox> `),i,a,r.show_flags,(t=>{r.show_flags=t.detail,this.edit({json:JSON.stringify(e)})}),t,s);return n(V||(V=ee` <div data-testid="foxycomplete"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="foxycomplete" ns="${0}"> </foxy-i18n> <x-choice data-testid="foxycomplete-choice" .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} <div slot="combobox" class="space-y-m pb-s" ?hidden="${0}"> <div class="grid grid-cols-2 gap-m" style="max-width:16rem"> ${0} </div> ${0} </div> <div slot="search" class="pb-s" ?hidden="${0}">${0}</div> </x-choice> <div class="border-t border-contrast-10 p-m"> <x-checkbox data-testid="foxycomplete-lookup-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="enable_postcode_lookup" ns="${0}"></foxy-i18n> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("foxycomplete:before"),i?"text-disabled":"",t,s,d,l,i,a,(t=>{t instanceof o&&(r.usage="disabled"===t.detail?"none":"required",r.show_combobox="combobox"===t.detail,this.edit({json:JSON.stringify(e)}))}),l.map((e=>n(R||(R=ee` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="foxycomplete_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs ${0}" lang="${0}" key="foxycomplete_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,t,e,s,i?"text-disabled":"text-secondary",t,e,s))),"combobox"!==d,["open","close"].map((t=>{const s="open"===t?"combobox_open":"combobox_close";return n(H||(H=ee` <vaadin-text-field data-testid="foxycomplete-${0}-icon" style="--lumo-border-radius:var(--lumo-border-radius-s)" label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> `),t,this.t(`${t}_icon`),r[s],i,a,(e=>"Enter"===e.key&&this.submit()),(t=>{r[s]=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}))})),c,"search"!==d,c,i,a,"enabled"===e.postal_code_lookup.usage,(t=>{e.postal_code_lookup.usage=t.detail?"enabled":"none",this.edit({json:JSON.stringify(e)})}),t,s,this.renderTemplateOrSlot("foxycomplete:after"))}__renderLocations(e){const{lang:t,ns:s}=this,i=e.location_filtering,o=!this.in("idle")||this.disabledSelector.matches("locations",!0),a=this.readonlySelector.matches("locations",!0),r="blacklist"===i.shipping_filter_type?"block":"allow",l="both"===i.usage?"copy":"blacklist"===i.billing_filter_type?"block":"allow",d=()=>{if("both"===i.usage)i.billing_filter_type=i.shipping_filter_type,i.billing_filter_values=i.shipping_filter_values;else{const e=Object.keys(i.billing_filter_values).length>0,t=Object.keys(i.shipping_filter_values).length>0;i.usage=e||t?e&&!t?"billing":t&&!e?"shipping":"independent":"none"}};return n(I||(I=ee` <div data-testid="locations"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="location_plural" ns="${0}"> </foxy-i18n> <div class="grid sm-grid-cols-2 bg-contrast-10" style="gap:1px"> <x-group class="bg-base pt-m"> <foxy-i18n class="${0}" slot="header" lang="${0}" key="shipping" ns="${0}"> </foxy-i18n> <x-choice data-testid="locations-shipping-choice" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <x-countries-list data-testid="locations-shipping-list" countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> <x-group class="bg-base pt-m"> <foxy-i18n class="${0}" slot="header" lang="${0}" key="billing" ns="${0}"> </foxy-i18n> <x-choice data-testid="locations-billing-choice" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <foxy-i18n slot="copy-label" lang="${0}" key="same_as_shipping" ns="${0}"> </foxy-i18n> <x-countries-list data-testid="locations-billing-list" countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" ?hidden="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("locations:before"),o?"text-disabled":"",t,s,o?"text-disabled":"text-tertiary",t,s,["allow","block"],r,o,a,(t=>{"both"!==i.usage&&(i.usage="independent"),i.shipping_filter_type="block"===t.detail?"blacklist":"whitelist",d(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,JSON.stringify(i.shipping_filter_values),this.regions,this.countries,r,t,s,o,a,(t=>{i.shipping_filter_values=t.currentTarget.countries,d(),this.edit({json:JSON.stringify(e)})}),o?"text-disabled":"text-tertiary",t,s,["allow","block","copy"],l,o,a,(t=>{"copy"===t.detail?i.usage="both":(i.usage="independent",i.billing_filter_type="block"===t.detail?"blacklist":"whitelist"),d(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,t,s,JSON.stringify(i.billing_filter_values),this.regions,this.countries,l,t,s,o,a,"copy"===l,(t=>{i.billing_filter_values=t.currentTarget.countries,d(),this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("locations:after"))}__renderHiddenFields(e){const{lang:t,ns:s}=this,i=[],o=[],a=e.cart_display_config,r=!this.in("idle")||this.disabledSelector.matches("hidden-fields",!0),l=this.readonlySelector.matches("hidden-fields",!0);for(const e in a){if(!e.startsWith("show_"))continue;const t=e.substring(5);i.push(t),"required"!==a.usage||a[e]||o.push(t)}"required"===a.usage&&o.push(...a.hidden_product_options);const d=()=>{a.usage="required",i.includes(this.__addHiddenFieldInputValue)?a[`show_${this.__addHiddenFieldInputValue}`]=!1:a.hidden_product_options.includes(this.__addHiddenFieldInputValue)||a.hidden_product_options.push(this.__addHiddenFieldInputValue),this.edit({json:JSON.stringify(e)}),this.__addHiddenFieldInputValue=""},c="calc(var(--lumo-border-radius-l) / 1.2)",u=0===o.length?[c]:["0","0",c,c],h=r||!this.__addHiddenFieldInputValue;return n(z||(z=ee` <div data-testid="hidden-fields"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="hidden_fields" ns="${0}"> </foxy-i18n> <div class="divide-y divide-contrast-10" data-testid="hidden-fields-list"> ${0} </div> <div data-testid="hidden-fields-new" style="border-radius:${0}" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m px-m focus-outline-none" list="hidden-fields-list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <datalist id="hidden-fields-list"> ${0} </datalist> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("hidden-fields:before"),r?"text-disabled":"",t,s,o.map((o=>n(A||(A=ee` <div class="${0}"> ${0} <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m m-auto"></iron-icon> </button> </div> `),g({"h-m ml-m pr-xs flex items-center justify-between":!0,"text-secondary":l,"text-disabled":r}),i.includes(o)?n(D||(D=ee`<foxy-i18n lang="${0}" key="${0}" ns="${0}"></foxy-i18n>`),t,o,s):n(G||(G=ee`<span>${0}</span>`),o),this.t("delete"),g({"w-xs h-xs rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!r,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!r,"cursor-default":r,flex:!l,hidden:l}),r,(()=>{"boolean"==typeof a[`show_${o}`]?a[`show_${o}`]=!0:a.hidden_product_options=a.hidden_product_options.filter((e=>e!==o)),this.edit({json:JSON.stringify(e)})})))),u.join(" "),g({"h-m flex items-center ring-inset ring-primary-50 focus-within-ring-2":!0,"border-t border-contrast-10":o.length>0,flex:!l,hidden:l}),this.t("add_field"),y(this.__addHiddenFieldInputValue),r,l,(e=>"Enter"===e.key&&d()),(e=>{this.__addHiddenFieldInputValue=e.currentTarget.value}),i.filter((e=>!o.includes(e))).map((e=>n(B||(B=ee`<option value="${0}">${0}</option>`),e,this.t(e)))),this.t("add_field"),g({"w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":h,"bg-success-10 text-success cursor-pointer":!h,"hover-bg-success hover-text-success-contrast":!h,"focus-outline-none focus-ring-2":!h}),h,d,this.renderTemplateOrSlot("hidden-fields:after"))}__renderCards(e){const{lang:t,ns:i}=this,o=!this.in("idle")||this.disabledSelector.matches("cards",!0),a=this.readonlySelector.matches("cards",!0),r=e.supported_payment_cards;let l,d;"all_cards"===e.csc_requirements?(l=!1,d=!1):"sso_only"===e.csc_requirements?(l=!0,d=!1):(l=!0,d=!0);const c={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return n(L||(L=ee` <div data-testid="cards"> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="supported_cards" ns="${0}"> </foxy-i18n> <div class="flex flex-wrap m-xs p-s"> ${0} </div> <div class="flex flex-wrap p-s border-t border-contrast-10"> <x-checkbox data-testid="cards-saved-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_saved" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox data-testid="cards-sso-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_sso" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </x-group> <foxy-i18n class="text-xs leading-s block ${0}" lang="${0}" key="supported_cards_disclaimer" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("cards:before"),o?"text-disabled":"",t,i,Object.entries(s).map((([t,s])=>{if(!c[t])return;const i=r.includes(t);return n(U||(U=ee` <div class="${0}"> <label class="${0}"> <div class="h-s">${0}</div> <div class="text-s font-medium mx-s my-auto leading-none"> ${0} </div> <input type="checkbox" class="sr-only" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> </label> </div> `),g({"m-xs rounded":!0,"opacity-50 cursor-default":o,"cursor-pointer ring-primary-50 focus-within-ring-2":!o}),g({"overflow-hidden transition-colors flex rounded-s border":!0,"border-primary bg-primary-10 text-primary":i&&!a,"border-contrast bg-contrast-5 text-secondary":i&&a,"hover-text-body":i&&!o&&!a,"border-contrast-10":!i,"hover-border-primary":!i&&!o&&!a,"hover-text-primary":!i&&!o&&!a}),s,c[t],o,a,i,(s=>{if(a)return s.preventDefault();s.stopPropagation(),s.currentTarget.checked?r.push(t):r.splice(r.indexOf(t),1),this.edit({json:JSON.stringify(e)})}))})),o||"new_cards_only"===e.csc_requirements,a,l,(t=>{e.csc_requirements=t.detail?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),t,i,o,a,d,(t=>{e.csc_requirements=t.detail?"new_cards_only":l?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),t,i,o?"text-disabled":"text-secondary",t,i,this.renderTemplateOrSlot("cards:after"))}__renderCheckoutType(e){const{lang:t,ns:s}=this,i=!this.in("idle")||this.disabledSelector.matches("checkout-type",!0),o=this.readonlySelector.matches("checkout-type",!0);return n(P||(P=ee` <div data-testid="checkout-type"> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="checkout_type" ns="${0}"> </foxy-i18n> <x-choice data-testid="checkout-type-choice" ?disabled="${0}" ?readonly="${0}" .items="${0}" .value="${0}" .getText="${0}" @change="${0}"> </x-choice> </x-group> <foxy-i18n class="text-xs leading-s block ${0}" lang="${0}" key="checkout_type_helper_text" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("checkout-type:before"),i?"text-disabled":"",t,s,i,o,["default_account","default_guest","guest_only","account_only"],e.checkout_type,(e=>this.t(`checkout_type_${e}`)),(t=>{e.checkout_type=t.detail,this.edit({json:JSON.stringify(e)})}),i?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("checkout-type:after"))}__renderConsent(e){const{lang:t,ns:s}=this,i=e.tos_checkbox_settings,o=e.newsletter_subscribe,a=e.eu_secure_data_transfer_consent,r=!this.in("idle")||this.disabledSelector.matches("consent",!0),l=this.readonlySelector.matches("consent",!0),d="margin-left: calc(1.125rem + (var(--lumo-space-m) * 2))";return n(M||(M=ee` <div data-testid="consent"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="consent" ns="${0}"> </foxy-i18n> <x-checkbox data-testid="consent-tos-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_tos_link" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="display_tos_link_explainer" ns="${0}"> </foxy-i18n> </div> <div slot="content" ?hidden="${0}"> <vaadin-text-field data-testid="consent-tos-field" label="${0}" class="w-full mt-m" placeholder="https://example.com/path/to/tos" clear-button-visible ?disabled="${0}" ?readonly="${0}" .value="${0}" @input="${0}"> </vaadin-text-field> <div class="flex flex-wrap -mx-s -mb-s mt-s"> <x-checkbox data-testid="consent-tos-require-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="require_consent" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox data-testid="consent-tos-state-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="checked_by_default" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox data-testid="consent-mail-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="newsletter_subscribe" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="newsletter_subscribe_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox data-testid="consent-sdta-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_sdta" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="display_sdta_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </x-group> ${0} </div> `),this.renderTemplateOrSlot("consent:before"),r?"text-disabled":"",t,s,r,l,"required"===i.usage||"optional"===i.usage,(t=>{i.initial_state=t.detail?i.initial_state:"unchecked",i.is_hidden=!1,i.usage=t.detail?"required":"none",i.url=t.detail?i.url:"",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,"none"===i.usage,this.t("location_url"),r,l,i.url,(t=>{i.url=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}),r,l,"required"===i.usage,(t=>{i.usage=t.detail?"required":"optional",this.edit({json:JSON.stringify(e)})}),t,s,r,l,"checked"===i.initial_state,(t=>{i.initial_state=t.detail?"checked":"unchecked",this.edit({json:JSON.stringify(e)})}),t,s,d,r,l,"required"===o.usage,(t=>{o.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,d,r,l,"required"===a.usage,(t=>{a.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("consent:after"))}__renderFields(e){const{lang:t,ns:s}=this,i=!this.in("idle")||this.disabledSelector.matches("fields",!0),o=this.readonlySelector.matches("fields",!0),a=e.custom_checkout_field_requirements;return n(W||(W=ee` <div data-testid="fields"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="field_plural" ns="${0}"> </foxy-i18n> <div class="bg-contrast-10 grid grid-cols-1 sm-grid-cols-2" style="gap:1px"> ${0} <div class="bg-base hidden sm-block"></div> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("fields:before"),i?"text-disabled":"",t,s,Object.entries({cart_controls:["enabled","disabled"],coupon_entry:["enabled","disabled"],billing_first_name:["default","optional","required","hidden"],billing_last_name:["default","optional","required","hidden"],billing_company:["default","optional","required","hidden"],billing_tax_id:["default","optional","required","hidden"],billing_phone:["default","optional","required","hidden"],billing_address1:["default","optional","required","hidden"],billing_address2:["default","optional","required","hidden"],billing_city:["default","optional","required","hidden"],billing_region:["default","optional","required","hidden"],billing_postal_code:["default","optional","required","hidden"],billing_country:["default","optional","required","hidden"]}).map((([r,l])=>n(K||(K=ee` <label class="${0}"> <foxy-i18n class="flex-1" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="${0}"> ${0} </div> <div class="${0}"> <select data-testid="fields-${0}" class="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </select> <iron-icon class="pointer-events-none icon-inline text-xl" icon="icons:expand-more"> </iron-icon> </div> </label> `),g({"flex items-center pl-m bg-base":!0,"text-secondary":o,"text-disabled":i}),t,r.replace("billing_",""),s,g({"flex items-center text-right font-medium h-s px-s m-xs":o,hidden:!o}),this.t(l.find((e=>a[r]===e))),g({"px-s m-xs flex items-center rounded leading-none":!0,"ring-primary-50 ring-inset focus-within-ring-2":!i,"hover-text-primary":!i,"cursor-pointer":!i,"cursor-default":i,flex:!o,hidden:o}),r,g({"h-s mr-xs text-right appearance-none bg-transparent font-medium":!0,"focus-outline-none cursor-pointer":!i,"cursor-default":i}),i,o,(t=>{const s=t.currentTarget,i=s.options[s.options.selectedIndex].value;a[r]=i,this.edit({json:JSON.stringify(e)})}),l.map((e=>n(Q||(Q=ee` <option value="${0}" ?selected="${0}"> ${0} </option> `),e,a[r]===e,this.t(e))))))),this.renderTemplateOrSlot("fields:after"))}__renderGoogleAnalytics(e){const{lang:t,ns:s}=this,i=e.analytics_config,o=i.google_tag,a=i.google_analytics,r=!this.in("idle")||this.disabledSelector.matches("google-analytics",!0),l=this.readonlySelector.matches("google-analytics",!0);return n(X||(X=ee` <div data-testid="google-analytics"> ${0} <x-group frame> <span class="${0}" slot="header">Google Analytics</span> <foxy-i18n class="block bg-error-10 text-error font-medium rounded-t p-m" infer="" key="ga_deprecation_notice"> </foxy-i18n> <div class="p-m space-y-m"> <vaadin-text-field data-testid="google-analytics-field" style="--lumo-border-radius:var(--lumo-border-radius-s)" class="w-full" label="${0}" placeholder="UA-1234567-1" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <x-checkbox data-testid="google-analytics-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="ga_include_on_site" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="ga_include_on_site_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("google-analytics:before"),r?"text-disabled":"",this.t("ga_account_id"),this.t("ga_account_id_explainer"),y(a.account_id),r,l,(e=>"Enter"===e.key&&this.submit()),(t=>{a.account_id=t.currentTarget.value,a.usage=a.account_id?"required":"none",i.usage=a.account_id||o.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),r,l,a.include_on_site,(t=>{a.include_on_site=t.detail,this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("google-analytics:after"))}__renderGoogleTag(e){const t=e.analytics_config,s=t.google_tag,i=t.google_analytics,o=!this.in("idle")||this.disabledSelector.matches("google-tag",!0),a=this.readonlySelector.matches("google-tag",!0);return n(Y||(Y=ee` <div data-testid="google-tag"> ${0} <x-group frame> <span class="${0}" slot="header">Google Tag</span> <div class="p-m space-y-m"> <vaadin-text-field data-testid="google-tag-account-id" style="--lumo-border-radius:var(--lumo-border-radius-s)" class="w-full" label="${0}" placeholder="G-123456789" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-text-field data-testid="google-tag-send-to" style="--lumo-border-radius:var(--lumo-border-radius-s)" class="w-full" label="${0}" placeholder="AW-123456789/sABDCLqU3K2BEJb8cxDE" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <p class="text-xs text-secondary"> <foxy-i18n infer="" key="gt_usage_notice"></foxy-i18n> <a target="_blank" class="cursor-pointer group text-primary rounded-s font-medium focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://wiki.foxycart.com/v/2.0/analytics#google_tag_ga4_google_ads" rel="nofollow noreferrer noopener"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="gt_docs_link"> </foxy-i18n> </a> </p> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("google-tag:before"),o?"text-disabled":"",this.t("gt_account_id"),this.t("gt_account_id_explainer"),y(s.account_id),o,a,(e=>"Enter"===e.key&&this.submit()),(o=>{s.account_id=o.currentTarget.value,s.usage=s.account_id?"required":"none",t.usage=s.account_id||i.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),this.t("gt_send_to"),this.t("gt_send_to_explainer"),y(s.send_to),o,a,(e=>"Enter"===e.key&&this.submit()),(o=>{s.send_to=o.currentTarget.value,s.usage=s.account_id?"required":"none",t.usage=s.account_id||i.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("google-tag:after"))}__renderTroubleshooting(e){const{lang:t,ns:s}=this,i=e.debug,o=!this.in("idle")||this.disabledSelector.matches("troubleshooting",!0),a=this.readonlySelector.matches("troubleshooting",!0);return n(Z||(Z=ee` <div data-testid="troubleshooting"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="troubleshooting" ns="${0}"> </foxy-i18n> <div class="p-m space-y-m"> <x-checkbox data-testid="troubleshooting-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="troubleshooting_debug" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="troubleshooting_debug_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("troubleshooting:before"),o?"text-disabled":"",t,s,o,a,"required"===i.usage,(t=>{i.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,o?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("troubleshooting:after"))}}customElements.define("foxy-template-config-form",se);export{se as TemplateConfigForm};
@@ -1 +1 @@
1
- import"./shared-cfe1bd8c.js";import"./shared-704ad583.js";import"./shared-bc0421a7.js";import"./shared-088655e0.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-730e6ac7.js";import{_ as e}from"./shared-0f6e4584.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-4b7f8c12.js";import"./shared-94ddc918.js";import"./shared-a917b3e5.js";import{S as s,T as a,a as i}from"./shared-bedfd929.js";import{c as r}from"./shared-4e709717.js";import{C as o,a as d}from"./shared-509a1775.js";import"./shared-61c0bc51.js";import"./shared-4f0975c8.js";import{G as n}from"./shared-69a37aba.js";import"./shared-5ec4c4b3.js";import"./shared-3df30d85.js";import"./shared-5318a742.js";import"./shared-dfab3fb1.js";import"./shared-9da63461.js";import"./shared-c1b96673.js";import{M as l}from"./shared-a3abd1de.js";import{C as c}from"./shared-0b01f721.js";import{N as h}from"./shared-24d71d01.js";import"./shared-8d6749b3.js";import"./shared-61ade33e.js";import"./shared-70d41727.js";import"./shared-94bae3fb.js";import"./shared-f7a1193f.js";import"./shared-a0c6a159.js";import"./shared-1a6877b1.js";import"./shared-343d1fd7.js";import"./shared-e5a04929.js";import"./shared-30792d92.js";import"./shared-cc4dabfb.js";import"./shared-f293f1ae.js";import"./shared-bc409d96.js";import"./shared-39c40d76.js";import"./shared-ee67d0e4.js";import"./shared-651c44fa.js";import"./shared-5860410a.js";import"./shared-80bfcae3.js";import"./shared-99940888.js";import"./shared-ee36b83f.js";import"./shared-c286c5ad.js";import"./shared-665965d3.js";import"./shared-64d3d924.js";import"./shared-9803aa7c.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";let m,p,f,u,_,b,$=e=>e;const y=s(a(c(i(h,"template-form"))));class v extends y{constructor(){super(...arguments),this.__cacheState="idle",this.__contentChoice="default"}static get properties(){return e(e({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-source-control":customElements.get("foxy-internal-source-control"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-metadata":l,"x-choice":o,"x-group":n}}render(){var e,s;const{hiddenSelector:a,href:i,lang:o,ns:d}=this,n=i?"delete":"create",l=this.in("busy"),c=this.in("fail");return t(m||(m=$` <div class="space-y-m relative"> ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),a.matches("description",!0)?"":this.__renderDescription(),a.matches("content",!0)?"":this.__renderContent(),a.matches("timestamps",!0)||!i?"":this.__renderTimestamps(),a.matches(n)?"":this.__renderAction(n),r({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!l&&!c}),c?"error":l?"busy":"empty",o,d,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}async _sendPost(e){const t=await super._sendPost(e);if(!t.content_url)return t;this.__cacheState="busy";const s=t._links["fx:cache"].href,a=await new v.API(this).fetch(s,{method:"POST"});return this.__cacheState=a.ok?"idle":"fail",await this._fetch(t._links.self.href)}async _sendPatch(e){const t=await super._sendPatch(e);if(!e.content_url)return t;this.__cacheState="busy";const s=t._links["fx:cache"].href,a=await new v.API(this).fetch(s,{method:"POST"});return this.__cacheState=a.ok?"idle":"fail",await this._fetch(t._links.self.href)}__renderDescription(){var e,s;const a="description";return t(p||(p=$` <div> ${0} <vaadin-text-field data-testid="${0}" class="w-full mb-s" label="${0}" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),a,this.t(a),!this.in("idle")||this.disabledSelector.matches(a),this.readonlySelector.matches(a),null!==(s=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==s?s:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot(`${a}:after`))}__renderContent(){var e,s;const a="content",i=this.form.content_url,o=this.form.content,n=i?"url":o?"clipboard":this.__contentChoice,l=!this.in("idle")||this.disabledSelector.matches(a),c=this.readonlySelector.matches(a),h=c||!(null===(e=this.data)||void 0===e?void 0:e.content_url)||i!==this.data.content_url;return t(f||(f=$` <div data-testid="content"> <x-group frame> <foxy-i18n class="${0}" lang="${0}" slot="header" key="template" ns="${0}"> </foxy-i18n> <x-choice data-testid="content-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div style="--lumo-border-radius:var(--lumo-border-radius-s)" class="mb-m" slot="url" ?hidden="${0}"> <div class="flex items-end mt-0"> <vaadin-text-field data-testid="content-url" placeholder="https://example.com/my-template" label="${0}" class="flex-1 min-w-0" ?readonly="${0}" ?disabled="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-button data-testid="cache" class="relative flex-shrink-0 ml-s" ?hidden="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="cache" ns="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" class="m-auto" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </vaadin-button> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" label="${0}" infer="content" class="mt-m${0}"> </foxy-internal-source-control> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" label="${0}" infer="content" class="mb-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)" slot="clipboard"> </foxy-internal-source-control> </x-choice> </x-group> </div> `),r({"transition-colors":!0,"text-disabled":l}),this.lang,this.ns,n,["default","url","clipboard"],c,l,(e=>{e instanceof d&&(this.edit({content:"",content_url:""}),this.__contentChoice=e.detail)}),["default","url","clipboard"].map((e=>t(u||(u=$` <div slot="${0}-label" class="py-s leading-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns))),"url"!==n,this.t("url"),c,l,this.form.content_url,(e=>"Enter"===e.key&&this.submit()),(e=>{const t=e.currentTarget.value;this.edit({content:"",content_url:t})}),h,l||"busy"===this.__cacheState,this.__cache,r({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,r({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns,this.t("url_source_placeholder"),this.t("url_source_label"),(null===(s=this.data)||void 0===s?void 0:s.content)?"":" hidden",this.t("clipboard_source_placeholder"),this.t("clipboard_source_label"),"clipboard"===n?"":" hidden")}__renderTimestamps(){const e="timestamps";return t(_||(_=$` <div> ${0} <x-metadata data-testid="timestamps" .items="${0}"> </x-metadata> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot(`${e}:after`))}__renderAction(e){const{disabledSelector:s,href:a,lang:i,ns:r}=this,o=this.in({idle:{template:{dirty:"valid"}}}),d=this.in({idle:{snapshot:{dirty:"valid"}}}),n=!this.in("idle")||s.matches(e,!0),l=o||d;return t(b||(b=$` <div> ${0} <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),i,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?a?"error":"primary success":"",e,this.in({idle:"template"})&&!l||n,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,i,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const s=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",a=await new v.API(this).fetch(s,{method:"POST"});this.__cacheState=a.ok?"idle":"fail",this.refresh()}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-template-form",v);export{v as TemplateForm};
1
+ import"./shared-3e03c988.js";import"./shared-2d723710.js";import"./shared-abea5e34.js";import"./shared-a036e345.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-f1d2b5bb.js";import{_ as e}from"./shared-0f6e4584.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-fb56178f.js";import"./shared-6a4e81ad.js";import"./shared-ff63a551.js";import{S as s,T as a,a as i}from"./shared-075796e2.js";import{c as r}from"./shared-4e709717.js";import{C as o,a as n}from"./shared-4993a79d.js";import"./shared-7026fb08.js";import"./shared-bdd4fbbb.js";import{G as d}from"./shared-9a90a24e.js";import"./shared-acdcae7e.js";import"./shared-2fc671cd.js";import"./shared-021c7a22.js";import"./shared-fe77f6f6.js";import"./shared-39a33102.js";import"./shared-e5d37737.js";import{M as l}from"./shared-72c61f43.js";import{C as c}from"./shared-0b01f721.js";import{N as h}from"./shared-24d71d01.js";import"./shared-30221a16.js";import"./shared-61ade33e.js";import"./shared-8f7a31e0.js";import"./shared-7b8ad9c1.js";import"./shared-f7a1193f.js";import"./shared-a0c6a159.js";import"./shared-5c05ac06.js";import"./shared-343d1fd7.js";import"./shared-df00a537.js";import"./shared-339bbd50.js";import"./shared-77c4acdd.js";import"./shared-e2a61f69.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-2099544a.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-99940888.js";import"./shared-ee36b83f.js";import"./shared-c286c5ad.js";import"./shared-644ee296.js";import"./shared-303b428e.js";import"./shared-9803aa7c.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";let m,p,f,u,_,b,$=e=>e;const y=s(a(c(i(h,"template-form"))));class v extends y{constructor(){super(...arguments),this.__cacheState="idle",this.__contentChoice="default"}static get properties(){return e(e({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-source-control":customElements.get("foxy-internal-source-control"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-metadata":l,"x-choice":o,"x-group":d}}render(){var e,s;const{hiddenSelector:a,href:i,lang:o,ns:n}=this,d=i?"delete":"create",l=this.in("busy"),c=this.in("fail");return t(m||(m=$` <div class="space-y-m relative"> ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),a.matches("description",!0)?"":this.__renderDescription(),a.matches("content",!0)?"":this.__renderContent(),a.matches("timestamps",!0)||!i?"":this.__renderTimestamps(),a.matches(d)?"":this.__renderAction(d),r({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!l&&!c}),c?"error":l?"busy":"empty",o,n,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}async _sendPost(e){const t=await super._sendPost(e);if(!t.content_url)return t;this.__cacheState="busy";const s=t._links["fx:cache"].href,a=await new v.API(this).fetch(s,{method:"POST"});return this.__cacheState=a.ok?"idle":"fail",await this._fetch(t._links.self.href)}async _sendPatch(e){const t=await super._sendPatch(e);if(!e.content_url)return t;this.__cacheState="busy";const s=t._links["fx:cache"].href,a=await new v.API(this).fetch(s,{method:"POST"});return this.__cacheState=a.ok?"idle":"fail",await this._fetch(t._links.self.href)}__renderDescription(){var e,s;const a="description";return t(p||(p=$` <div> ${0} <vaadin-text-field data-testid="${0}" class="w-full mb-s" label="${0}" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),a,this.t(a),!this.in("idle")||this.disabledSelector.matches(a),this.readonlySelector.matches(a),null!==(s=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==s?s:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot(`${a}:after`))}__renderContent(){var e,s;const a="content",i=this.form.content_url,o=this.form.content,d=i?"url":o?"clipboard":this.__contentChoice,l=!this.in("idle")||this.disabledSelector.matches(a),c=this.readonlySelector.matches(a),h=c||!(null===(e=this.data)||void 0===e?void 0:e.content_url)||i!==this.data.content_url;return t(f||(f=$` <div data-testid="content"> <x-group frame> <foxy-i18n class="${0}" lang="${0}" slot="header" key="template" ns="${0}"> </foxy-i18n> <x-choice data-testid="content-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div style="--lumo-border-radius:var(--lumo-border-radius-s)" class="mb-m" slot="url" ?hidden="${0}"> <div class="flex items-end mt-0"> <vaadin-text-field data-testid="content-url" placeholder="https://example.com/my-template" label="${0}" class="flex-1 min-w-0" ?readonly="${0}" ?disabled="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-button data-testid="cache" class="relative flex-shrink-0 ml-s" ?hidden="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="cache" ns="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" class="m-auto" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </vaadin-button> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" label="${0}" infer="content" class="mt-m${0}"> </foxy-internal-source-control> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" label="${0}" infer="content" class="mb-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)" slot="clipboard"> </foxy-internal-source-control> </x-choice> </x-group> </div> `),r({"transition-colors":!0,"text-disabled":l}),this.lang,this.ns,d,["default","url","clipboard"],c,l,(e=>{e instanceof n&&(this.edit({content:"",content_url:""}),this.__contentChoice=e.detail)}),["default","url","clipboard"].map((e=>t(u||(u=$` <div slot="${0}-label" class="py-s leading-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns))),"url"!==d,this.t("url"),c,l,this.form.content_url,(e=>"Enter"===e.key&&this.submit()),(e=>{const t=e.currentTarget.value;this.edit({content:"",content_url:t})}),h,l||"busy"===this.__cacheState,this.__cache,r({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,r({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns,this.t("url_source_placeholder"),this.t("url_source_label"),(null===(s=this.data)||void 0===s?void 0:s.content)?"":" hidden",this.t("clipboard_source_placeholder"),this.t("clipboard_source_label"),"clipboard"===d?"":" hidden")}__renderTimestamps(){const e="timestamps";return t(_||(_=$` <div> ${0} <x-metadata data-testid="timestamps" .items="${0}"> </x-metadata> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot(`${e}:after`))}__renderAction(e){const{disabledSelector:s,href:a,lang:i,ns:r}=this,o=this.in({idle:{template:{dirty:"valid"}}}),n=this.in({idle:{snapshot:{dirty:"valid"}}}),d=!this.in("idle")||s.matches(e,!0),l=o||n;return t(b||(b=$` <div> ${0} <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),i,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?a?"error":"primary success":"",e,this.in({idle:"template"})&&!l||d,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,i,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const s=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",a=await new v.API(this).fetch(s,{method:"POST"});this.__cacheState=a.ok?"idle":"fail",this.refresh()}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-template-form",v);export{v as TemplateForm};
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import{a as r}from"./shared-bedfd929.js";import{T as s}from"./shared-30e7450c.js";import{h as e}from"./shared-dc73b9a5.js";import"./shared-4b7f8c12.js";import"./shared-8d6749b3.js";import"./shared-1a6877b1.js";import"./shared-730e6ac7.js";import"./shared-0f6e4584.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-248c08ac.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";let d,a,t=r=>r;const o=r(s,"template-set-card");class m extends o{renderBody(){return super.renderBody({title:r=>e(d||(d=t`${0}`),r.description),subtitle:r=>e(a||(a=t`${0}`),r.code)})}}customElements.define("foxy-template-set-card",m);export{m as TemplateSetCard};
1
+ import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import{a as r}from"./shared-075796e2.js";import{T as s}from"./shared-77051754.js";import{h as e}from"./shared-dc73b9a5.js";import"./shared-fb56178f.js";import"./shared-30221a16.js";import"./shared-5c05ac06.js";import"./shared-f1d2b5bb.js";import"./shared-0f6e4584.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-a6273e4a.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";let a,d,t=r=>r;const o=r(s,"template-set-card");class m extends o{renderBody(){return super.renderBody({title:r=>e(a||(a=t`${0}`),r.description),subtitle:r=>e(d||(d=t`${0}`),r.code)})}}customElements.define("foxy-template-set-card",m);export{m as TemplateSetCard};
@@ -1 +1 @@
1
- import"./shared-d6b4d84f.js";import"./shared-3f0e394a.js";import"./shared-b4d20b03.js";import"./shared-51c4a6dd.js";import{I as e}from"./shared-55b621e8.js";import"./foxy-payments-api-payment-preset-card.js";import"./foxy-nucleon-element.js";import"./foxy-i18n-editor.js";import{_ as r,B as o}from"./shared-0f6e4584.js";import{R as t,a as s}from"./shared-bedfd929.js";import{i as a}from"./shared-9803aa7c.js";import{h as d}from"./shared-dc73b9a5.js";import"./shared-ddde3914.js";import"./shared-39c40d76.js";import"./shared-5318a742.js";import"./shared-94ddc918.js";import"./shared-8d6749b3.js";import"./shared-4b7f8c12.js";import"./shared-ee67d0e4.js";import"./shared-70d41727.js";import"./shared-704ad583.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-1a6877b1.js";import"./shared-730e6ac7.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-bc0421a7.js";import"./shared-61c0bc51.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-94bae3fb.js";import"./shared-bc409d96.js";import"./shared-3df30d85.js";import"./shared-c1b96673.js";import"./shared-651c44fa.js";import"./shared-5ec4c4b3.js";import"./shared-cfe1bd8c.js";import"./shared-dfab3fb1.js";import"./shared-5860410a.js";import"./shared-80bfcae3.js";import"./foxy-copy-to-clipboard.js";import"./shared-ae013b1a.js";import"./shared-a917b3e5.js";import"./shared-bab2ea2c.js";import"./shared-30e7450c.js";import"./shared-248c08ac.js";import"./shared-9df5667e.js";import"./shared-665965d3.js";let i,n,l=e=>e;const p=t(s(e,"template-set-form"));class c extends p{constructor(){super(...arguments),this.paymentMethodSets=null,this.languageStrings=null,this.localeCodes=null,this.languages=null,this.__localeCodesLoaderId="localeCodesLoader",this.__languagesLoaderId="languagesLoader"}static get properties(){return r(r({},super.properties),{},{paymentMethodSets:{attribute:"payment-method-sets"},languageStrings:{attribute:"language-strings"},localeCodes:{attribute:"locale-codes"},languages:{}})}static get v8n(){return[({description:e})=>!!e||"description:v8n_required",({description:e})=>!!e&&e.length<=100||"description:v8n_too_long",({code:e})=>!!e||"code:v8n_required",({code:e})=>!!e&&e.length<=50||"code:v8n_too_long",({language:e})=>!!e||"language:v8n_required",({locale_code:e})=>!!e||"locale_code:v8n_required"]}get headerSubtitleOptions(){var e;return r(r({},super.headerSubtitleOptions),{},{context:"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)?"default":""})}get disabledSelector(){var e,r;const t=[];return(null===(e=this.__languagesLoader)||void 0===e?void 0:e.data)||t.push("language"),(null===(r=this.__localeCodesLoader)||void 0===r?void 0:r.data)||t.push("locale-code"),new o(`${t.join(" ")} ${super.disabledSelector}`)}get hiddenSelector(){var e;const r=[];return"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)&&r.push("delete","code","description"),new o(`${r.join(" ")} ${super.hiddenSelector}`)}renderBody(){var e,r,o,t,s,p,c,h;const m=Object.entries(null!==(o=null===(r=null===(e=this.__localeCodesLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.values)&&void 0!==o?o:{}).map((([e,r])=>({value:e,rawLabel:r}))),u=Object.entries(null!==(p=null===(s=null===(t=this.__languagesLoader)||void 0===t?void 0:t.data)||void 0===s?void 0:s.values)&&void 0!==p?p:{}).map((([e,r])=>({value:e,label:r})));return d(i||(i=l` ${0} <div class="grid grid-cols-1 gap-m sm-grid-cols-2"> <foxy-internal-text-control infer="description"></foxy-internal-text-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-select-control infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="locale-code" .options="${0}"> </foxy-internal-select-control> </div> <foxy-internal-resource-picker-control infer="payment-method-set-uri" first="${0}" item="foxy-payments-api-payment-preset-card"> </foxy-internal-resource-picker-control> ${0} ${0} <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> `),this.renderHeader(),u,m,this.paymentMethodSets,this.data&&this.languageStrings&&!this.hiddenSelector.matches("language-overrides",!0)?d(n||(n=l` <div> ${0} <foxy-i18n-editor language-overrides="${0}" selected-language="${0}" infer="language-overrides" href="${0}"> </foxy-i18n-editor> ${0} </div> `),this.renderTemplateOrSlot("language-overrides:before"),this.data._links["fx:language_overrides"].href,this.form.language,this.languageStrings,this.renderTemplateOrSlot("language-overrides:after")):"",super.renderBody(),a(null!==(c=this.languages)&&void 0!==c?c:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),a(null!==(h=this.localeCodes)&&void 0!==h?h:void 0),this.__localeCodesLoaderId,(()=>this.requestUpdate()))}get __localeCodesLoader(){return this.renderRoot.querySelector(`#${this.__localeCodesLoaderId}`)}get __languagesLoader(){return this.renderRoot.querySelector(`#${this.__languagesLoaderId}`)}}customElements.define("foxy-template-set-form",c);export{c as TemplateSetForm};
1
+ import"./shared-7ce91c80.js";import"./shared-d4810405.js";import"./shared-6e355777.js";import"./shared-51c4a6dd.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-payments-api-payment-preset-card.js";import"./foxy-nucleon-element.js";import"./foxy-i18n-editor.js";import{_ as r,B as o}from"./shared-0f6e4584.js";import{R as t,a}from"./shared-075796e2.js";import{i as s}from"./shared-9803aa7c.js";import{h as d}from"./shared-dc73b9a5.js";import"./shared-b98b8d02.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-fb56178f.js";import"./shared-2099544a.js";import"./shared-8f7a31e0.js";import"./shared-2d723710.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5c05ac06.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-7b8ad9c1.js";import"./shared-797ba64a.js";import"./shared-2fc671cd.js";import"./shared-e5d37737.js";import"./shared-651c44fa.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-bab2ea2c.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./shared-81d3a9ae.js";import"./shared-644ee296.js";let i,n,l=e=>e;const p=t(a(e,"template-set-form"));class c extends p{constructor(){super(...arguments),this.paymentMethodSets=null,this.languageStrings=null,this.localeCodes=null,this.languages=null,this.__localeCodesLoaderId="localeCodesLoader",this.__languagesLoaderId="languagesLoader"}static get properties(){return r(r({},super.properties),{},{paymentMethodSets:{attribute:"payment-method-sets"},languageStrings:{attribute:"language-strings"},localeCodes:{attribute:"locale-codes"},languages:{}})}static get v8n(){return[({description:e})=>!!e||"description:v8n_required",({description:e})=>!!e&&e.length<=100||"description:v8n_too_long",({code:e})=>!!e||"code:v8n_required",({code:e})=>!!e&&e.length<=50||"code:v8n_too_long",({language:e})=>!!e||"language:v8n_required",({locale_code:e})=>!!e||"locale_code:v8n_required"]}get headerSubtitleOptions(){var e;return r(r({},super.headerSubtitleOptions),{},{context:"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)?"default":""})}get disabledSelector(){var e,r;const t=[];return(null===(e=this.__languagesLoader)||void 0===e?void 0:e.data)||t.push("language"),(null===(r=this.__localeCodesLoader)||void 0===r?void 0:r.data)||t.push("locale-code"),new o(`${t.join(" ")} ${super.disabledSelector}`)}get hiddenSelector(){var e;const r=[];return"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)&&r.push("delete","code","description"),new o(`${r.join(" ")} ${super.hiddenSelector}`)}renderBody(){var e,r,o,t,a,p,c,h;const m=Object.entries(null!==(o=null===(r=null===(e=this.__localeCodesLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.values)&&void 0!==o?o:{}).map((([e,r])=>({value:e,rawLabel:r}))),u=Object.entries(null!==(p=null===(a=null===(t=this.__languagesLoader)||void 0===t?void 0:t.data)||void 0===a?void 0:a.values)&&void 0!==p?p:{}).map((([e,r])=>({value:e,label:r})));return d(i||(i=l` ${0} <div class="grid grid-cols-1 gap-m sm-grid-cols-2"> <foxy-internal-text-control infer="description"></foxy-internal-text-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-select-control infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="locale-code" .options="${0}"> </foxy-internal-select-control> </div> <foxy-internal-resource-picker-control infer="payment-method-set-uri" first="${0}" item="foxy-payments-api-payment-preset-card"> </foxy-internal-resource-picker-control> ${0} ${0} <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> `),this.renderHeader(),u,m,this.paymentMethodSets,this.data&&this.languageStrings&&!this.hiddenSelector.matches("language-overrides",!0)?d(n||(n=l` <div> ${0} <foxy-i18n-editor language-overrides="${0}" selected-language="${0}" infer="language-overrides" href="${0}"> </foxy-i18n-editor> ${0} </div> `),this.renderTemplateOrSlot("language-overrides:before"),this.data._links["fx:language_overrides"].href,this.form.language,this.languageStrings,this.renderTemplateOrSlot("language-overrides:after")):"",super.renderBody(),s(null!==(c=this.languages)&&void 0!==c?c:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),s(null!==(h=this.localeCodes)&&void 0!==h?h:void 0),this.__localeCodesLoaderId,(()=>this.requestUpdate()))}get __localeCodesLoader(){return this.renderRoot.querySelector(`#${this.__localeCodesLoaderId}`)}get __languagesLoader(){return this.renderRoot.querySelector(`#${this.__languagesLoaderId}`)}}customElements.define("foxy-template-set-form",c);export{c as TemplateSetForm};
@@ -1 +1 @@
1
- import"./shared-ae013b1a.js";import"./shared-51c4a6dd.js";import"./shared-64fcd0da.js";import"./shared-730e6ac7.js";import"./shared-0f6e4584.js";import{g as e}from"./shared-bab2ea2c.js";import{C as t}from"./shared-0b01f721.js";import{a as s}from"./shared-bedfd929.js";import{I as i}from"./shared-248c08ac.js";import{c as r}from"./shared-4e709717.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-8d6749b3.js";import"./shared-70d41727.js";import"./shared-94ddc918.js";import"./shared-4b7f8c12.js";import"./shared-a917b3e5.js";import"./foxy-spinner.js";import"./shared-1a6877b1.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";let a,n,d,c,l,p,u,m,h,f,v,y,_,x,$=e=>e;const b=t(s(i,"transaction-card"));class j extends b{constructor(){super(...arguments),this.__currencyDisplay=""}renderBody(){var e,t;const s=this.hiddenSelector,i=!s.matches("total",!0),d=!s.matches("status",!0);return o(a||(a=$` <div aria-busy="${0}" aria-live="polite" class="relative leading-s font-lumo text-m"> <div class="${0}"> ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"transition-opacity":!0,"opacity-0":!this.data}),i||d?o(n||(n=$` <div class="flex items-center justify-between gap-s"> ${0} ${0} </div> `),i?this.__renderIdAndTotal():"",d?this.__renderStatus():""):"",s.matches("description",!0)?"":this.__renderSummary(),s.matches("customer",!0)?"":this.__renderCustomer(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}async _sendGet(){var e;const t=await super._sendGet(),s=null===(e=t._links["fx:store"])||void 0===e?void 0:e.href;if("string"==typeof s){const e=await super._fetch(s);this.__currencyDisplay=e.use_international_currency_symbol?"code":"symbol"}else this.__currencyDisplay="symbol";return t}__renderIdAndTotal(){const t=this.data;let s;if(t){const i={amount:`${t.total_order} ${t.currency_code}`,currencyDisplay:this.__currencyDisplay};s=o(d||(d=$` <span class="truncate">ID ${0}</span> ${0} `),t.display_id||e(t._links.self.href),"updateinfo"!==t.type&&"subscription_cancellation"!==t.type?o(c||(c=$` <span>&bull;</span> <foxy-i18n .options="${0}" infer="" key="price"></foxy-i18n> `),i):"")}else s=o(l||(l=$`&ZeroWidthSpace;`));return o(p||(p=$` <div class="min-w-0" data-testid="total"> ${0} <div class="font-medium flex items-center gap-xs">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("total:before"),s,this.renderTemplateOrSlot("total:after"))}__renderStatus(){var e,t,s,i,r,a;const n=(null===(e=this.data)||void 0===e?void 0:e.status)||"completed",d=null===(s=null===(t=this.data)||void 0===t?void 0:t.source)||void 0===s?void 0:s.substring(0,3).toUpperCase();return o(u||(u=$` <div class="flex-shrink-0" data-testid="status"> ${0} <div class="text-tertiary text-s flex items-center space-x-xs"> ${0} <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> <iron-icon data-testid="status-icon" class="icon-inline cursor-default text-l ${0}" id="status" icon="${0}"> </iron-icon> <vcf-tooltip for="status" theme="light" position="top"> <foxy-i18n infer="" key="status_${0}"></foxy-i18n> </vcf-tooltip> </div> ${0} </div> `),this.renderTemplateOrSlot("status:before"),d?o(m||(m=$` <vcf-tooltip for="source" theme="light" position="top"> <foxy-i18n infer="" key="source_${0}"></foxy-i18n> </vcf-tooltip> <span class="cursor-default" id="source">${0}</span> `),d,d):"",JSON.stringify({value:null===(i=this.data)||void 0===i?void 0:i.transaction_date}),this.lang,this.ns,null!==(r={authorized:"text-success",completed:"text-success",capturing:"text-success",captured:"text-success",approved:"text-success",pending:"text-success",pending_fraud_review:"text-error",declined:"text-error",rejected:"text-error",problem:"text-error"}[n])&&void 0!==r?r:"text-tertiary",null!==(a={authorized:"icons:done",capturing:"icons:done",captured:"icons:done",approved:"icons:done",pending:"icons:done",completed:"icons:done-all",pending_fraud_review:"icons:info-outline",declined:"icons:highlight-off",rejected:"icons:highlight-off",problem:"icons:info-outline",refunded:"icons:restore",voided:"icons:remove-circle-outline"}[n])&&void 0!==a?a:"icons:schedule",n,this.renderTemplateOrSlot("status:after"))}__renderSummary(){var e,t,s;const i=null===(t=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:items"],r=null===(s=this.data)||void 0===s?void 0:s.type;let a,n;if(n="updateinfo"===r?"summary_payment_method_change":"subscription_modification"===r?"summary_subscription_modification":"subscription_cancellation"===r?"summary_subscription_cancellation":"summary",i){const e={most_expensive_item:[...i].sort(((e,t)=>e.price-t.price))[0],count_minus_one:i.length-1,count:i.length};a=o(h||(h=$`<foxy-i18n .options="${0}" infer="" key="${0}"></foxy-i18n>`),e,n)}else a=o(f||(f=$`&ZeroWidthSpace;`));return o(v||(v=$` <div data-testid="description"> ${0} <div class="text-s text-secondary truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),a,this.renderTemplateOrSlot("description:after"))}__renderCustomer(){const e=this.data,t=e?o(y||(y=$`${0} ${0} (${0})`),e.customer_first_name,e.customer_last_name,e.customer_email):o(_||(_=$`&ZeroWidthSpace;`));return o(x||(x=$` <div data-testid="customer"> ${0} <div class="text-tertiary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),t,this.renderTemplateOrSlot("customer:after"))}}customElements.define("foxy-transaction-card",j);export{j as TransactionCard};
1
+ import"./shared-12ac8cc6.js";import"./shared-51c4a6dd.js";import"./shared-61f4e91a.js";import"./shared-f1d2b5bb.js";import"./shared-0f6e4584.js";import{g as e}from"./shared-bab2ea2c.js";import{C as t}from"./shared-0b01f721.js";import{a as s}from"./shared-075796e2.js";import{I as i}from"./shared-a6273e4a.js";import{c as r}from"./shared-4e709717.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-6a4e81ad.js";import"./shared-fb56178f.js";import"./shared-ff63a551.js";import"./foxy-spinner.js";import"./shared-5c05ac06.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";let a,n,d,c,l,p,u,m,f,h,v,y,_,x,$=e=>e;const b=t(s(i,"transaction-card"));class j extends b{constructor(){super(...arguments),this.__currencyDisplay=""}renderBody(){var e,t;const s=this.hiddenSelector,i=!s.matches("total",!0),d=!s.matches("status",!0);return o(a||(a=$` <div aria-busy="${0}" aria-live="polite" class="relative leading-s font-lumo text-m"> <div class="${0}"> ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"transition-opacity":!0,"opacity-0":!this.data}),i||d?o(n||(n=$` <div class="flex items-center justify-between gap-s"> ${0} ${0} </div> `),i?this.__renderIdAndTotal():"",d?this.__renderStatus():""):"",s.matches("description",!0)?"":this.__renderSummary(),s.matches("customer",!0)?"":this.__renderCustomer(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}async _sendGet(){var e;const t=await super._sendGet(),s=null===(e=t._links["fx:store"])||void 0===e?void 0:e.href;if("string"==typeof s){const e=await super._fetch(s);this.__currencyDisplay=e.use_international_currency_symbol?"code":"symbol"}else this.__currencyDisplay="symbol";return t}__renderIdAndTotal(){const t=this.data;let s;if(t){const i={amount:`${t.total_order} ${t.currency_code}`,currencyDisplay:this.__currencyDisplay};s=o(d||(d=$` <span class="truncate">ID ${0}</span> ${0} `),t.display_id||e(t._links.self.href),"updateinfo"!==t.type&&"subscription_cancellation"!==t.type?o(c||(c=$` <span>&bull;</span> <foxy-i18n .options="${0}" infer="" key="price"></foxy-i18n> `),i):"")}else s=o(l||(l=$`&ZeroWidthSpace;`));return o(p||(p=$` <div class="min-w-0" data-testid="total"> ${0} <div class="font-medium flex items-center gap-xs">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("total:before"),s,this.renderTemplateOrSlot("total:after"))}__renderStatus(){var e,t,s,i,r,a;const n=(null===(e=this.data)||void 0===e?void 0:e.status)||"completed",d=null===(s=null===(t=this.data)||void 0===t?void 0:t.source)||void 0===s?void 0:s.substring(0,3).toUpperCase();return o(u||(u=$` <div class="flex-shrink-0" data-testid="status"> ${0} <div class="text-tertiary text-s flex items-center space-x-xs"> ${0} <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> <iron-icon data-testid="status-icon" class="icon-inline cursor-default text-l ${0}" id="status" icon="${0}"> </iron-icon> <vcf-tooltip for="status" theme="light" position="top"> <foxy-i18n infer="" key="status_${0}"></foxy-i18n> </vcf-tooltip> </div> ${0} </div> `),this.renderTemplateOrSlot("status:before"),d?o(m||(m=$` <vcf-tooltip for="source" theme="light" position="top"> <foxy-i18n infer="" key="source_${0}"></foxy-i18n> </vcf-tooltip> <span class="cursor-default" id="source">${0}</span> `),d,d):"",JSON.stringify({value:null===(i=this.data)||void 0===i?void 0:i.transaction_date}),this.lang,this.ns,null!==(r={authorized:"text-success",completed:"text-success",capturing:"text-success",captured:"text-success",approved:"text-success",pending:"text-success",pending_fraud_review:"text-error",declined:"text-error",rejected:"text-error",problem:"text-error"}[n])&&void 0!==r?r:"text-tertiary",null!==(a={authorized:"icons:done",capturing:"icons:done",captured:"icons:done",approved:"icons:done",pending:"icons:done",completed:"icons:done-all",pending_fraud_review:"icons:info-outline",declined:"icons:highlight-off",rejected:"icons:highlight-off",problem:"icons:info-outline",refunded:"icons:restore",voided:"icons:remove-circle-outline"}[n])&&void 0!==a?a:"icons:schedule",n,this.renderTemplateOrSlot("status:after"))}__renderSummary(){var e,t,s;const i=null===(t=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:items"],r=null===(s=this.data)||void 0===s?void 0:s.type;let a,n;if(n="updateinfo"===r?"summary_payment_method_change":"subscription_modification"===r?"summary_subscription_modification":"subscription_cancellation"===r?"summary_subscription_cancellation":"summary",i){const e={most_expensive_item:[...i].sort(((e,t)=>e.price-t.price))[0],count_minus_one:i.length-1,count:i.length};a=o(f||(f=$`<foxy-i18n .options="${0}" infer="" key="${0}"></foxy-i18n>`),e,n)}else a=o(h||(h=$`&ZeroWidthSpace;`));return o(v||(v=$` <div data-testid="description"> ${0} <div class="text-s text-secondary truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),a,this.renderTemplateOrSlot("description:after"))}__renderCustomer(){const e=this.data,t=e?o(y||(y=$`${0} ${0} (${0})`),e.customer_first_name,e.customer_last_name,e.customer_email):o(_||(_=$`&ZeroWidthSpace;`));return o(x||(x=$` <div data-testid="customer"> ${0} <div class="text-tertiary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),t,this.renderTemplateOrSlot("customer:after"))}}customElements.define("foxy-transaction-card",j);export{j as TransactionCard};
@@ -1 +1 @@
1
- import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-730e6ac7.js";import"./shared-ddde3914.js";import{I as t}from"./shared-55b621e8.js";import{a as e}from"./shared-94bae3fb.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{_ as i,B as o}from"./shared-0f6e4584.js";import{g as r}from"./shared-bab2ea2c.js";import{i as s}from"./shared-9803aa7c.js";import{h as n,s as a}from"./shared-dc73b9a5.js";import{c as d}from"./shared-4e709717.js";import"./shared-704ad583.js";import"./shared-bc0421a7.js";import{N as l}from"./shared-24d71d01.js";import"./foxy-nucleon-element.js";import{R as c,a as u}from"./shared-bedfd929.js";import"./shared-64fcd0da.js";import"./shared-248c08ac.js";import"./shared-4b7f8c12.js";import"./shared-8d6749b3.js";import"./shared-1a6877b1.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-67aa8143.js";import"./shared-94ddc918.js";import"./shared-70d41727.js";import"./shared-61ade33e.js";import"./shared-dfab3fb1.js";import"./shared-088655e0.js";import"./shared-a0c6a159.js";import"./shared-61c0bc51.js";import"./shared-ae013b1a.js";import"./shared-a917b3e5.js";import"./shared-83451a72.js";import"./shared-f1e4e392.js";import"./shared-30e7450c.js";import"./shared-6ac0d05e.js";import"./shared-2bf89a21.js";import"./shared-963d252e.js";import"./shared-c1b96673.js";import"./shared-d6b4d84f.js";import"./foxy-form-dialog.js";import"./shared-99940888.js";import"./shared-a636184a.js";import"./shared-e5a04929.js";import"./shared-5ec4c4b3.js";import"./shared-cfe1bd8c.js";import"./shared-30792d92.js";import"./shared-f293f1ae.js";import"./shared-bc409d96.js";import"./shared-39c40d76.js";import"./shared-5318a742.js";import"./shared-ee67d0e4.js";import"./shared-3df30d85.js";import"./shared-651c44fa.js";import"./shared-5860410a.js";import"./shared-80bfcae3.js";import"./shared-59978b05.js";import"./shared-cc4dabfb.js";import"./shared-c5a48553.js";import"./shared-deab9fa5.js";import"./shared-b4d20b03.js";import"./shared-7e39ec54.js";import"./shared-b5cd2b39.js";import"./shared-64d3d924.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let p,m,f,h,_=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends e{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return i(i({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var t,e,i,o;const l=this.nucleon,c=null===(t=null==l?void 0:l.data)||void 0===t?void 0:t._links["fx:customer"].href,u=c?null===(e=null==l?void 0:l.getCustomerPageHref)||void 0===e?void 0:e.call(l,c):void 0;return n(p||(p=_` <foxy-i18n infer="" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),d({"block ring-inset rounded transition-colors":!0,"ring-1 ring-contrast-10":!u,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),s(u),s(c),this.__renderCopyAction(a(m||(m=_`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",c?String(r(c)):""),this.__renderCopyAction(a(f||(f=_`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(o=null===(i=null==l?void 0:l.data)||void 0===i?void 0:i.customer_email)&&void 0!==o?o:""))}__renderCopyAction(t,e,i,o){const r=this[i],s="fail"===r?"error":"done"===r?"end":"busy";return n(h||(h=_` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==r,(()=>"idle"===r&&this.__copy(o,i)),(t=>"idle"!==r&&t.stopPropagation()),(t=>"idle"!==r&&t.stopPropagation()),d({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==r}),t,e,d({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===r}),s)}async __copy(t,e){this[e]="busy";try{await navigator.clipboard.writeText(t),this[e]="done"}catch(t){this[e]="fail"}setTimeout((()=>this[e]="idle"),3e3)}});let y,v=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends e{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return i(i({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"idle"===t?this.theme:"";return n(y||(y=v` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0} tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),e,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const e=new l.API(this),i=await e.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=i.ok?"idle":"fail",i.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let x,b,g,j,$,w,k=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends e{renderControl(){var t,e,i,o,r,s,a,d,l,c;return n(x||(x=k` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} </div> `),(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"])?this.__renderCaptureAction():"",(null===(o=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===o?void 0:o._links["fx:void"])?this.__renderVoidAction():"",(null===(s=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===s?void 0:s._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(l=this.nucleon)||void 0===l?void 0:l.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"")}__renderSendEmailsAction(){var t,e;return n(b||(b=k` <foxy-internal-transaction-post-action-control infer="send-emails" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),s(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,e;return n(g||(g=k` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),s(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,e,i;return n(j||(j=k` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),s(null===(i=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:void"])||void 0===i?void 0:i.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,e,i;return n($||($=k` <foxy-internal-transaction-post-action-control infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),s(null===(i=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:refund"])||void 0===i?void 0:i.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderSubscriptionAction(){var t,e,i;const o=this.nucleon,r=null===(e=null===(t=null==o?void 0:o.data)||void 0===t?void 0:t._links["fx:subscription"])||void 0===e?void 0:e.href,a=r?null===(i=null==o?void 0:o.getSubscriptionPageHref)||void 0===i?void 0:i.call(o,r):void 0;return n(w||(w=k` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),s(a))}});let S,P,H,A,C,E,L,I,R,G,B=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var t,e,i,o,r,a,d,l,c;const u=null===(t=this.nucleon)||void 0===t?void 0:t.data;if(!u)return n(S||(S=B``));const p=null!==(i=null===(e=null==u?void 0:u._embedded)||void 0===e?void 0:e["fx:applied_taxes"])&&void 0!==i?i:[],m=null!==(r=null===(o=u._embedded)||void 0===o?void 0:o["fx:shipments"])&&void 0!==r?r:[];return n(P||(P=B` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>&colon;</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>&colon; ${0} </span> </span> </p> `),s(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===m.length||0===u.total_shipping?n(H||(H=B` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>&colon;</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):m.map((t=>n(A||(A=B` <span>${0}&colon;</span> <span>${0}</span> `),t.shipping_service_description,this.__renderPrice(t.total_shipping,!0)))),0===p.length||0===u.total_tax?n(C||(C=B` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>&colon;</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):p.map((t=>n(E||(E=B` <span>${0}&colon;</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),null===(d=null===(a=null==u?void 0:u._embedded)||void 0===a?void 0:a["fx:applied_gift_card_codes"])||void 0===d?void 0:d.map((t=>{var e;return n(L||(L=B` <span>${0}&colon;</span> <span>${0}</span> `),t._embedded["fx:gift_card"].name,this.__renderPrice(null!==(e=t.balance_adjustment)&&void 0!==e?e:0,!0))})),null===(c=null===(l=null==u?void 0:u._embedded)||void 0===l?void 0:l["fx:discounts"])||void 0===c?void 0:c.map((t=>n(I||(I=B` <span data-testclass="discount">${0}&colon;</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}get __storeHref(){var t,e,i;return null===(i=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:store"])||void 0===i?void 0:i.href}get __store(){var t,e;const i=`#${this.__storeLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}__renderPrice(t,e=!1){var i,o,r;const s=(null===(i=this.__store)||void 0===i?void 0:i.use_international_currency_symbol)?"code":"symbol",a=null===(r=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===r?void 0:r.currency_code;return n(R||(R=B` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),e&&0!==t?t>0?"text-success":"text-error":"",{currencyDisplay:s,signDisplay:e?"exceptZero":"auto",amount:`${t} ${a}`})}__renderStatus(){var t,e;const i=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e.status)||"completed";let o="";return o=["capturing","captured","approved","authorized","pending"].includes(i)?"text-success bg-success-10":i&&"completed"!==i?["problem","pending_fraud_review","rejected","declined"].includes(i)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",n(G||(G=B` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),o,i)}});let Z,M,T,W=t=>t;const q=c(u(t,"transaction"));class z extends q{constructor(){super(...arguments),this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null}static get properties(){return i(i({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1}})}get readonlySelector(){var t,e,i;const r=Boolean(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==e?e:null===(i=this.data)||void 0===i?void 0:i._links["fx:refund"]);return new o(r?`${super.readonlySelector} billing-addresses`:`${super.readonlySelector} billing-addresses items attributes custom-fields`)}get hiddenSelector(){var t,e;const i=["billing-addresses:dialog:delete billing-addresses:dialog:timestamps"],r=null===(t=this.data)||void 0===t?void 0:t.type;return(null===(e=this.data)||void 0===e?void 0:e._links["fx:subscription"])||i.push("subscription"),"subscription_modification"===r&&i.push("actions"),"updateinfo"===r&&i.push("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===r&&i.push("not=customer,subscription,custom-fields,attributes"),new o(`${super.hiddenSelector} ${i.join(" ")}`.trim())}get headerSubtitleOptions(){var t,e,i,o,r;const s=null===(t=this.data)||void 0===t?void 0:t.source,n=null===(e=this.data)||void 0===e?void 0:e.type;let a="";return"updateinfo"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===s?"admin_changed_payment_method_with_uoe":"mit_api"===s?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===s?"admin_changed_subscription_with_uoe":"mit_api"===s?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===n?"mit_recurring"===s?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===s?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===s&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===n?"cit_recurring_cancellation"===s?a="customer_canceled_subscription":"mit_recurring_cancellation"===s&&(a="admin_canceled_subscription"):(null===(i=this.data)||void 0===i?void 0:i._links["fx:subscription"])?(null==s?void 0:s.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===s?a="admin_subscribed_with_uoe":"mit_api"===s&&(a="integration_subscribed"):(null==s?void 0:s.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===s?a="admin_placed_order_with_uoe":"mit_api"===s&&(a="integration_placed_order"),{transaction_date:null===(o=this.data)||void 0===o?void 0:o.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerCopyIdValue(){var t,e,i;return null!==(i=null===(e=null===(t=this.data)||void 0===t?void 0:t.display_id)||void 0===e?void 0:e.toString())&&void 0!==i?i:""}renderHeaderActions(){return n(Z||(Z=W` <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> `))}renderBody(){var t,e,i,o,r,a,d;let l,c;const u=this.hiddenSelector;if(this.data)try{const t=new URL(this.data._links["fx:shipments"].href),e=new URL(this.data._links["fx:items"].href);t.searchParams.set("zoom","items:item_category"),e.searchParams.set("zoom","item_options"),l=t.toString(),c=e.toString()}catch(t){}return n(M||(M=W` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert .related="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <div class="grid gap-m sm-grid-cols-2" ?hidden="${0}"> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> </div> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(e=null===(t=this.data)||void 0===t?void 0:t.status)&&void 0!==e?e:"")?n(T||(T=W` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(i=this.data)||void 0===i?void 0:i.status):"",u.matches("items",!0)&&u.matches("summary",!0),s(c),[this.href],s(null===(o=this.data)||void 0===o?void 0:o._links["fx:billing_addresses"].href),s(null===(r=this.data)||void 0===r?void 0:r._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},u.matches("custom-fields",!0)&&u.matches("attributes",!0),s(null===(a=this.data)||void 0===a?void 0:a._links["fx:custom_fields"].href),s(null===(d=this.data)||void 0===d?void 0:d._links["fx:attributes"].href),s(l))}}customElements.define("foxy-transaction",z);export{z as Transaction};
1
+ import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-f1d2b5bb.js";import"./shared-b98b8d02.js";import{I as t}from"./shared-8c1df97c.js";import{a as e}from"./shared-7b8ad9c1.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{_ as i,B as o}from"./shared-0f6e4584.js";import{g as r}from"./shared-bab2ea2c.js";import{i as s}from"./shared-9803aa7c.js";import{h as n,s as a}from"./shared-dc73b9a5.js";import{c as d}from"./shared-4e709717.js";import"./shared-2d723710.js";import"./shared-abea5e34.js";import{N as l}from"./shared-24d71d01.js";import"./foxy-nucleon-element.js";import{R as c,a as u}from"./shared-075796e2.js";import"./shared-61f4e91a.js";import"./shared-a6273e4a.js";import"./shared-5c05ac06.js";import"./shared-fb56178f.js";import"./shared-30221a16.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-cc79152c.js";import"./shared-6a4e81ad.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-fe77f6f6.js";import"./shared-a036e345.js";import"./shared-a0c6a159.js";import"./shared-7026fb08.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-10b5e78f.js";import"./shared-e6e84ff5.js";import"./shared-77051754.js";import"./shared-6ac0d05e.js";import"./shared-2bf89a21.js";import"./shared-4c2d43e6.js";import"./shared-e5d37737.js";import"./shared-7ce91c80.js";import"./foxy-form-dialog.js";import"./shared-99940888.js";import"./shared-70a5fad6.js";import"./shared-df00a537.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-339bbd50.js";import"./shared-e2a61f69.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2099544a.js";import"./shared-2fc671cd.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-72f41a65.js";import"./shared-77c4acdd.js";import"./shared-3fa791ca.js";import"./shared-292ba15e.js";import"./shared-6e355777.js";import"./shared-cbb0e610.js";import"./shared-ffd3690b.js";import"./shared-303b428e.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let p,m,f,h,_=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends e{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return i(i({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var t,e,i,o;const l=this.nucleon,c=null===(t=null==l?void 0:l.data)||void 0===t?void 0:t._links["fx:customer"].href,u=c?null===(e=null==l?void 0:l.getCustomerPageHref)||void 0===e?void 0:e.call(l,c):void 0;return n(p||(p=_` <foxy-i18n infer="" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),d({"block ring-inset rounded transition-colors":!0,"ring-1 ring-contrast-10":!u,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),s(u),s(c),this.__renderCopyAction(a(m||(m=_`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",c?String(r(c)):""),this.__renderCopyAction(a(f||(f=_`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(o=null===(i=null==l?void 0:l.data)||void 0===i?void 0:i.customer_email)&&void 0!==o?o:""))}__renderCopyAction(t,e,i,o){const r=this[i],s="fail"===r?"error":"done"===r?"end":"busy";return n(h||(h=_` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==r,(()=>"idle"===r&&this.__copy(o,i)),(t=>"idle"!==r&&t.stopPropagation()),(t=>"idle"!==r&&t.stopPropagation()),d({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==r}),t,e,d({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===r}),s)}async __copy(t,e){this[e]="busy";try{await navigator.clipboard.writeText(t),this[e]="done"}catch(t){this[e]="fail"}setTimeout((()=>this[e]="idle"),3e3)}});let y,v=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends e{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return i(i({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"idle"===t?this.theme:"";return n(y||(y=v` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0} tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),e,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const e=new l.API(this),i=await e.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=i.ok?"idle":"fail",i.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let x,b,g,j,$,w,k=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends e{renderControl(){var t,e,i,o,r,s,a,d,l,c;return n(x||(x=k` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} </div> `),(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"])?this.__renderCaptureAction():"",(null===(o=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===o?void 0:o._links["fx:void"])?this.__renderVoidAction():"",(null===(s=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===s?void 0:s._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(l=this.nucleon)||void 0===l?void 0:l.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"")}__renderSendEmailsAction(){var t,e;return n(b||(b=k` <foxy-internal-transaction-post-action-control infer="send-emails" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),s(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,e;return n(g||(g=k` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),s(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,e,i;return n(j||(j=k` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),s(null===(i=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:void"])||void 0===i?void 0:i.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,e,i;return n($||($=k` <foxy-internal-transaction-post-action-control infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),s(null===(i=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:refund"])||void 0===i?void 0:i.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderSubscriptionAction(){var t,e,i;const o=this.nucleon,r=null===(e=null===(t=null==o?void 0:o.data)||void 0===t?void 0:t._links["fx:subscription"])||void 0===e?void 0:e.href,a=r?null===(i=null==o?void 0:o.getSubscriptionPageHref)||void 0===i?void 0:i.call(o,r):void 0;return n(w||(w=k` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),s(a))}});let S,P,H,A,C,E,L,I,R,G,B=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var t,e,i,o,r,a,d,l,c;const u=null===(t=this.nucleon)||void 0===t?void 0:t.data;if(!u)return n(S||(S=B``));const p=null!==(i=null===(e=null==u?void 0:u._embedded)||void 0===e?void 0:e["fx:applied_taxes"])&&void 0!==i?i:[],m=null!==(r=null===(o=u._embedded)||void 0===o?void 0:o["fx:shipments"])&&void 0!==r?r:[];return n(P||(P=B` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>&colon;</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>&colon; ${0} </span> </span> </p> `),s(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===m.length||0===u.total_shipping?n(H||(H=B` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>&colon;</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):m.map((t=>n(A||(A=B` <span>${0}&colon;</span> <span>${0}</span> `),t.shipping_service_description,this.__renderPrice(t.total_shipping,!0)))),0===p.length||0===u.total_tax?n(C||(C=B` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>&colon;</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):p.map((t=>n(E||(E=B` <span>${0}&colon;</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),null===(d=null===(a=null==u?void 0:u._embedded)||void 0===a?void 0:a["fx:applied_gift_card_codes"])||void 0===d?void 0:d.map((t=>{var e;return n(L||(L=B` <span>${0}&colon;</span> <span>${0}</span> `),t._embedded["fx:gift_card"].name,this.__renderPrice(null!==(e=t.balance_adjustment)&&void 0!==e?e:0,!0))})),null===(c=null===(l=null==u?void 0:u._embedded)||void 0===l?void 0:l["fx:discounts"])||void 0===c?void 0:c.map((t=>n(I||(I=B` <span data-testclass="discount">${0}&colon;</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}get __storeHref(){var t,e,i;return null===(i=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:store"])||void 0===i?void 0:i.href}get __store(){var t,e;const i=`#${this.__storeLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}__renderPrice(t,e=!1){var i,o,r;const s=(null===(i=this.__store)||void 0===i?void 0:i.use_international_currency_symbol)?"code":"symbol",a=null===(r=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===r?void 0:r.currency_code;return n(R||(R=B` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),e&&0!==t?t>0?"text-success":"text-error":"",{currencyDisplay:s,signDisplay:e?"exceptZero":"auto",amount:`${t} ${a}`})}__renderStatus(){var t,e;const i=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e.status)||"completed";let o="";return o=["capturing","captured","approved","authorized","pending"].includes(i)?"text-success bg-success-10":i&&"completed"!==i?["problem","pending_fraud_review","rejected","declined"].includes(i)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",n(G||(G=B` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),o,i)}});let Z,M,T,W=t=>t;const q=c(u(t,"transaction"));class z extends q{constructor(){super(...arguments),this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null}static get properties(){return i(i({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1}})}get readonlySelector(){var t,e,i;const r=Boolean(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==e?e:null===(i=this.data)||void 0===i?void 0:i._links["fx:refund"]);return new o(r?`${super.readonlySelector} billing-addresses`:`${super.readonlySelector} billing-addresses items attributes custom-fields`)}get hiddenSelector(){var t,e;const i=["billing-addresses:dialog:delete billing-addresses:dialog:timestamps"],r=null===(t=this.data)||void 0===t?void 0:t.type;return(null===(e=this.data)||void 0===e?void 0:e._links["fx:subscription"])||i.push("subscription"),"subscription_modification"===r&&i.push("actions"),"updateinfo"===r&&i.push("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===r&&i.push("not=customer,subscription,custom-fields,attributes"),new o(`${super.hiddenSelector} ${i.join(" ")}`.trim())}get headerSubtitleOptions(){var t,e,i,o,r;const s=null===(t=this.data)||void 0===t?void 0:t.source,n=null===(e=this.data)||void 0===e?void 0:e.type;let a="";return"updateinfo"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===s?"admin_changed_payment_method_with_uoe":"mit_api"===s?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===s?"admin_changed_subscription_with_uoe":"mit_api"===s?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===n?"mit_recurring"===s?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===s?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===s&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===n?"cit_recurring_cancellation"===s?a="customer_canceled_subscription":"mit_recurring_cancellation"===s&&(a="admin_canceled_subscription"):(null===(i=this.data)||void 0===i?void 0:i._links["fx:subscription"])?(null==s?void 0:s.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===s?a="admin_subscribed_with_uoe":"mit_api"===s&&(a="integration_subscribed"):(null==s?void 0:s.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===s?a="admin_placed_order_with_uoe":"mit_api"===s&&(a="integration_placed_order"),{transaction_date:null===(o=this.data)||void 0===o?void 0:o.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerCopyIdValue(){var t,e,i;return null!==(i=null===(e=null===(t=this.data)||void 0===t?void 0:t.display_id)||void 0===e?void 0:e.toString())&&void 0!==i?i:""}renderHeaderActions(){return n(Z||(Z=W` <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> `))}renderBody(){var t,e,i,o,r,a,d;let l,c;const u=this.hiddenSelector;if(this.data)try{const t=new URL(this.data._links["fx:shipments"].href),e=new URL(this.data._links["fx:items"].href);t.searchParams.set("zoom","items:item_category"),e.searchParams.set("zoom","item_options"),l=t.toString(),c=e.toString()}catch(t){}return n(M||(M=W` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert .related="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <div class="grid gap-m sm-grid-cols-2" ?hidden="${0}"> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> </div> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(e=null===(t=this.data)||void 0===t?void 0:t.status)&&void 0!==e?e:"")?n(T||(T=W` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(i=this.data)||void 0===i?void 0:i.status):"",u.matches("items",!0)&&u.matches("summary",!0),s(c),[this.href],s(null===(o=this.data)||void 0===o?void 0:o._links["fx:billing_addresses"].href),s(null===(r=this.data)||void 0===r?void 0:r._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},u.matches("custom-fields",!0)&&u.matches("attributes",!0),s(null===(a=this.data)||void 0===a?void 0:a._links["fx:custom_fields"].href),s(null===(d=this.data)||void 0===d?void 0:d._links["fx:attributes"].href),s(l))}}customElements.define("foxy-transaction",z);export{z as Transaction};
@@ -1,4 +1,4 @@
1
- import"./shared-1a6877b1.js";import"./shared-4b7f8c12.js";import"./foxy-spinner.js";import"./shared-730e6ac7.js";import{T as t}from"./shared-1101a938.js";import{a as s}from"./shared-bedfd929.js";import"./shared-8d6749b3.js";import"./shared-0f6e4584.js";import"./shared-dc73b9a5.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./foxy-nucleon-element.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";let e,a,n,o,r,i,l=t=>t;class d extends(s(t,"transactions-table")){constructor(){super(...arguments),this.columns=[d.priceColumn,d.summaryColumn,d.statusColumn,d.idColumn,d.dateColumn,d.receiptColumn]}}d.priceColumn={cell:t=>t.html(e||(e=l`
1
+ import"./shared-5c05ac06.js";import"./shared-fb56178f.js";import"./foxy-spinner.js";import"./shared-f1d2b5bb.js";import{T as t}from"./shared-b731dfc5.js";import{a as s}from"./shared-075796e2.js";import"./shared-30221a16.js";import"./shared-0f6e4584.js";import"./shared-dc73b9a5.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./foxy-nucleon-element.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";let e,a,n,o,r,i,l=t=>t;class d extends(s(t,"transactions-table")){constructor(){super(...arguments),this.columns=[d.priceColumn,d.summaryColumn,d.statusColumn,d.idColumn,d.dateColumn,d.receiptColumn]}}d.priceColumn={cell:t=>t.html(e||(e=l`
2
2
  <foxy-i18n
3
3
  data-testclass="i18n totals"
4
4
  class="text-m font-medium font-tnum"
@@ -1 +1 @@
1
- import"./shared-d6b4d84f.js";import{I as e}from"./shared-55b621e8.js";import"./foxy-template-set-card.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import{a as t}from"./shared-94bae3fb.js";import"./foxy-payment-card-embed.js";import"./shared-730e6ac7.js";import"./shared-704ad583.js";import{_ as r,B as s}from"./shared-0f6e4584.js";import{i as o}from"./shared-9803aa7c.js";import{h as a}from"./shared-dc73b9a5.js";import{g as i}from"./shared-bab2ea2c.js";import{a as d}from"./shared-bedfd929.js";import"./shared-ddde3914.js";import"./shared-39c40d76.js";import"./shared-5318a742.js";import"./shared-94ddc918.js";import"./shared-8d6749b3.js";import"./shared-4b7f8c12.js";import"./shared-ee67d0e4.js";import"./shared-70d41727.js";import"./foxy-collection-page.js";import"./shared-0b01f721.js";import"./shared-343d1fd7.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-f7a1193f.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./shared-1a6877b1.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-bc0421a7.js";import"./shared-61c0bc51.js";import"./shared-4e709717.js";import"./shared-61ade33e.js";import"./foxy-pagination.js";import"./foxy-copy-to-clipboard.js";import"./shared-ae013b1a.js";import"./shared-a917b3e5.js";import"./shared-51c4a6dd.js";import"./shared-30e7450c.js";import"./shared-248c08ac.js";import"./shared-5ec4c4b3.js";import"./shared-c1b96673.js";import"./shared-3df30d85.js";import"./shared-dfab3fb1.js";import"./shared-9da63461.js";import"./shared-01b2cad8.js";import"./shared-6d645dc5.js";let n,m=e=>e;customElements.define("foxy-internal-update-payment-method-form-cc-token-control",class extends t{constructor(){super(...arguments),this.embedUrl=null}static get properties(){return r(r({},super.properties),{},{embedUrl:{attribute:"embed-url"}})}renderControl(){return a(n||(n=m` <foxy-payment-card-embed infer="payment-card-embed" url="${0}" @submit="${0}"> </foxy-payment-card-embed> <vaadin-button theme="primary" class="w-full mt-l" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="tokenize"></foxy-i18n> </vaadin-button> `),o(this.embedUrl),this.__tokenize,this.disabled,(()=>this.__tokenize()))}async __tokenize(){var e,t,r;const s=this.renderRoot.querySelector("[infer=payment-card-embed]");try{null===(e=this.nucleon)||void 0===e||e.edit({cc_token:await s.tokenize()}),null===(t=this.nucleon)||void 0===t||t.submit()}catch(e){null===(r=this.nucleon)||void 0===r||r.undo()}}});let p,l,c=e=>e;const h=d(e,"update-payment-method-form");class f extends h{constructor(){super(...arguments),this.embedUrl=null,this.__templateSetGetValue=()=>this.__templateSetOverride,this.__templateSetSetValue=e=>this.__templateSetOverride=e,this.__templateSetOverride=null}static get properties(){return r(r({},super.properties),{},{__templateSetOverride:{attribute:!1},embedUrl:{attribute:"embed-url"}})}get hiddenSelector(){var e;const t=null===(e=this.__formEmbedUrl)||void 0===e?void 0:e.searchParams,r=["header:copy-id","header:copy-json",super.hiddenSelector.toString()],o=null==t?void 0:t.has("demo");return(this.__isPreConfigured||o)&&r.unshift("template-set"),(null==t?void 0:t.has("template_set_id"))||o||r.unshift("cc-token"),new s(r.join(" ").trim())}renderBody(){var e;if(!this.href)return a(p||(p=c` <div class="flex items-center justify-center p-xl"> <foxy-spinner layout="vertical" infer="spinner" state="empty"></foxy-spinner> </div> `));const t=this.__formEmbedUrl,r=this.renderRoot.querySelector("#store-loader");return a(l||(l=c` ${0} <foxy-internal-resource-picker-control first="${0}" infer="template-set" item="foxy-template-set-card" .getValue="${0}" .setValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-update-payment-method-form-cc-token-control embed-url="${0}" infer="cc-token"> </foxy-internal-update-payment-method-form-cc-token-control> <foxy-nucleon infer="" class="hidden" href="${0}" id="store-loader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),o(null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:template_sets"].href),this.__templateSetGetValue,this.__templateSetSetValue,o(null==t?void 0:t.toString()),o(this.__storeLoaderHref),(()=>this.requestUpdate()))}updated(e){super.updated(e),(e.has("embedUrl")||e.has("href"))&&(this.__templateSetOverride=null)}async _fetch(...e){try{const t=await super._fetch(...e);return"PATCH"===new f.API.WHATWGRequest(...e).method&&(this.status={key:"cc_token_success"}),t}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw t.includes("cc_token you provided is invalid")?["error:cc_token_invalid"]:e}}get __storeLoaderHref(){const e=this.data;return e&&"fx:store"in e._links?e._links["fx:store"].href:void 0}get __isPreConfigured(){var e;try{return new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"").searchParams.has("template_set_id")}catch(e){return!1}}get __formEmbedUrl(){var e;try{const t=new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"");if(this.__templateSetOverride){const e=i(this.__templateSetOverride);null!==e&&t.searchParams.set("template_set_id",String(e))}return t}catch(e){}}}customElements.define("foxy-update-payment-method-form",f);export{f as UpdatePaymentMethodForm};
1
+ import"./shared-7ce91c80.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-template-set-card.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import{a as t}from"./shared-7b8ad9c1.js";import"./foxy-payment-card-embed.js";import"./shared-f1d2b5bb.js";import"./shared-2d723710.js";import{_ as r,B as s}from"./shared-0f6e4584.js";import{i as a}from"./shared-9803aa7c.js";import{h as o}from"./shared-dc73b9a5.js";import{g as i}from"./shared-bab2ea2c.js";import{a as d}from"./shared-075796e2.js";import"./shared-b98b8d02.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-fb56178f.js";import"./shared-2099544a.js";import"./shared-8f7a31e0.js";import"./foxy-collection-page.js";import"./shared-0b01f721.js";import"./shared-343d1fd7.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-f7a1193f.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./shared-5c05ac06.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./shared-4e709717.js";import"./shared-61ade33e.js";import"./foxy-pagination.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-51c4a6dd.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./shared-acdcae7e.js";import"./shared-e5d37737.js";import"./shared-2fc671cd.js";import"./shared-fe77f6f6.js";import"./shared-39a33102.js";import"./shared-01b2cad8.js";import"./shared-6d645dc5.js";let n,m=e=>e;customElements.define("foxy-internal-update-payment-method-form-cc-token-control",class extends t{constructor(){super(...arguments),this.embedUrl=null}static get properties(){return r(r({},super.properties),{},{embedUrl:{attribute:"embed-url"}})}renderControl(){return o(n||(n=m` <foxy-payment-card-embed infer="payment-card-embed" url="${0}" @submit="${0}"> </foxy-payment-card-embed> <vaadin-button theme="primary" class="w-full mt-l" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="tokenize"></foxy-i18n> </vaadin-button> `),a(this.embedUrl),this.__tokenize,this.disabled,(()=>this.__tokenize()))}async __tokenize(){var e,t,r;const s=this.renderRoot.querySelector("[infer=payment-card-embed]");try{null===(e=this.nucleon)||void 0===e||e.edit({cc_token:await s.tokenize()}),null===(t=this.nucleon)||void 0===t||t.submit()}catch(e){null===(r=this.nucleon)||void 0===r||r.undo()}}});let p,l,c=e=>e;const h=d(e,"update-payment-method-form");class f extends h{constructor(){super(...arguments),this.embedUrl=null,this.__templateSetGetValue=()=>this.__templateSetOverride,this.__templateSetSetValue=e=>this.__templateSetOverride=e,this.__templateSetOverride=null}static get properties(){return r(r({},super.properties),{},{__templateSetOverride:{attribute:!1},embedUrl:{attribute:"embed-url"}})}get hiddenSelector(){var e;const t=null===(e=this.__formEmbedUrl)||void 0===e?void 0:e.searchParams,r=["header:copy-id","header:copy-json",super.hiddenSelector.toString()],a=null==t?void 0:t.has("demo");return(this.__isPreConfigured||a)&&r.unshift("template-set"),(null==t?void 0:t.has("template_set_id"))||a||r.unshift("cc-token"),new s(r.join(" ").trim())}renderBody(){var e;if(!this.href)return o(p||(p=c` <div class="flex items-center justify-center p-xl"> <foxy-spinner layout="vertical" infer="spinner" state="empty"></foxy-spinner> </div> `));const t=this.__formEmbedUrl,r=this.renderRoot.querySelector("#store-loader");return o(l||(l=c` ${0} <foxy-internal-resource-picker-control first="${0}" infer="template-set" item="foxy-template-set-card" .getValue="${0}" .setValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-update-payment-method-form-cc-token-control embed-url="${0}" infer="cc-token"> </foxy-internal-update-payment-method-form-cc-token-control> <foxy-nucleon infer="" class="hidden" href="${0}" id="store-loader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),a(null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:template_sets"].href),this.__templateSetGetValue,this.__templateSetSetValue,a(null==t?void 0:t.toString()),a(this.__storeLoaderHref),(()=>this.requestUpdate()))}updated(e){super.updated(e),(e.has("embedUrl")||e.has("href"))&&(this.__templateSetOverride=null)}async _fetch(...e){try{const t=await super._fetch(...e);return"PATCH"===new f.API.WHATWGRequest(...e).method&&(this.status={key:"cc_token_success"}),t}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw t.includes("cc_token you provided is invalid")?["error:cc_token_invalid"]:e}}get __storeLoaderHref(){const e=this.data;return e&&"fx:store"in e._links?e._links["fx:store"].href:void 0}get __isPreConfigured(){var e;try{return new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"").searchParams.has("template_set_id")}catch(e){return!1}}get __formEmbedUrl(){var e;try{const t=new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"");if(this.__templateSetOverride){const e=i(this.__templateSetOverride);null!==e&&t.searchParams.set("template_set_id",String(e))}return t}catch(e){}}}customElements.define("foxy-update-payment-method-form",f);export{f as UpdatePaymentMethodForm};
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-730e6ac7.js";import{a as r}from"./shared-bedfd929.js";import{T as s}from"./shared-30e7450c.js";import{h as e}from"./shared-dc73b9a5.js";import"./shared-4b7f8c12.js";import"./shared-8d6749b3.js";import"./shared-1a6877b1.js";import"./shared-0f6e4584.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-248c08ac.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";let a,d,t=r=>r;const o=r(s,"user-card");class i extends o{renderBody(){return super.renderBody({title:r=>{const s=[r.first_name.trim(),r.last_name.trim()];return e(a||(a=t`${0}`),s.filter((r=>!!r)).join(" ")||this.t("no_name"))},subtitle:r=>e(d||(d=t`${0}`),r.email)})}}customElements.define("foxy-user-card",i);export{i as UserCard};
1
+ import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-f1d2b5bb.js";import{a as r}from"./shared-075796e2.js";import{T as s}from"./shared-77051754.js";import{h as e}from"./shared-dc73b9a5.js";import"./shared-fb56178f.js";import"./shared-30221a16.js";import"./shared-5c05ac06.js";import"./shared-0f6e4584.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-a6273e4a.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";let a,t,d=r=>r;const o=r(s,"user-card");class i extends o{renderBody(){return super.renderBody({title:r=>{const s=[r.first_name.trim(),r.last_name.trim()];return e(a||(a=d`${0}`),s.filter((r=>!!r)).join(" ")||this.t("no_name"))},subtitle:r=>e(t||(t=d`${0}`),r.email)})}}customElements.define("foxy-user-card",i);export{i as UserCard};