@foxy.io/elements 1.34.0 → 1.35.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 (246) 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 -1
  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 +1 -1
  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 +2 -2
  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-experimental-add-to-cart-builder.js +1 -0
  46. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  47. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  48. package/dist/cdn/foxy-form-dialog.js +1 -1
  49. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  50. package/dist/cdn/foxy-gift-card-card.js +1 -1
  51. package/dist/cdn/foxy-gift-card-code-card.js +1 -1
  52. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  53. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  54. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  55. package/dist/cdn/foxy-gift-card-form.js +1 -1
  56. package/dist/cdn/foxy-i18n-editor.js +1 -1
  57. package/dist/cdn/foxy-i18n.js +1 -1
  58. package/dist/cdn/foxy-integration-card.js +1 -1
  59. package/dist/cdn/foxy-integration-form.js +1 -1
  60. package/dist/cdn/foxy-item-card.js +1 -1
  61. package/dist/cdn/foxy-item-category-card.js +1 -1
  62. package/dist/cdn/foxy-item-category-form.js +1 -1
  63. package/dist/cdn/foxy-item-form.js +1 -1
  64. package/dist/cdn/foxy-item-option-card.js +1 -1
  65. package/dist/cdn/foxy-item-option-form.js +1 -1
  66. package/dist/cdn/foxy-items-form.js +1 -1
  67. package/dist/cdn/foxy-native-integration-card.js +1 -1
  68. package/dist/cdn/foxy-native-integration-form.js +1 -1
  69. package/dist/cdn/foxy-nucleon-element.js +1 -1
  70. package/dist/cdn/foxy-pagination.js +1 -1
  71. package/dist/cdn/foxy-passkey-card.js +1 -1
  72. package/dist/cdn/foxy-passkey-form.js +1 -1
  73. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  74. package/dist/cdn/foxy-payment-card.js +1 -1
  75. package/dist/cdn/foxy-payment-method-card.js +1 -1
  76. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  77. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  78. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  80. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  81. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  82. package/dist/cdn/foxy-payments-api.js +1 -1
  83. package/dist/cdn/foxy-query-builder.js +1 -1
  84. package/dist/cdn/foxy-report-form.js +1 -1
  85. package/dist/cdn/foxy-reports-table.js +1 -1
  86. package/dist/cdn/foxy-shipment-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  88. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  89. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  90. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  91. package/dist/cdn/foxy-sign-in-form.js +1 -1
  92. package/dist/cdn/foxy-spinner.js +2 -2
  93. package/dist/cdn/foxy-store-card.js +1 -1
  94. package/dist/cdn/foxy-store-form.js +1 -1
  95. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  96. package/dist/cdn/foxy-subscription-card.js +1 -1
  97. package/dist/cdn/foxy-subscription-form.js +1 -1
  98. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  99. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  100. package/dist/cdn/foxy-table.js +1 -1
  101. package/dist/cdn/foxy-tax-card.js +1 -1
  102. package/dist/cdn/foxy-tax-form.js +1 -1
  103. package/dist/cdn/foxy-template-config-form.js +1 -1
  104. package/dist/cdn/foxy-template-form.js +1 -1
  105. package/dist/cdn/foxy-template-set-card.js +1 -1
  106. package/dist/cdn/foxy-template-set-form.js +1 -1
  107. package/dist/cdn/foxy-transaction-card.js +1 -1
  108. package/dist/cdn/foxy-transaction.js +1 -1
  109. package/dist/cdn/foxy-transactions-table.js +7 -7
  110. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  111. package/dist/cdn/foxy-user-card.js +1 -1
  112. package/dist/cdn/foxy-user-form.js +1 -1
  113. package/dist/cdn/foxy-user-invitation-card.js +1 -1
  114. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  115. package/dist/cdn/foxy-users-table.js +1 -1
  116. package/dist/cdn/foxy-webhook-card.js +1 -1
  117. package/dist/cdn/foxy-webhook-form.js +1 -1
  118. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  119. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  120. package/dist/cdn/{shared-126cb82b.js → shared-018166d0.js} +1 -1
  121. package/dist/cdn/{shared-8e73014c.js → shared-01f85a69.js} +1 -1
  122. package/dist/cdn/{shared-e9e2fd3f.js → shared-066fb69f.js} +1 -1
  123. package/dist/cdn/{shared-1b5f155f.js → shared-0ae33cf9.js} +1 -1
  124. package/dist/cdn/{shared-d735fc99.js → shared-0e2a0b21.js} +1 -1
  125. package/dist/cdn/{shared-4f216dc1.js → shared-112e521b.js} +1 -1
  126. package/dist/cdn/{shared-6cf39826.js → shared-1c4ddc9b.js} +1 -1
  127. package/dist/cdn/{shared-f8252d03.js → shared-238d397f.js} +1 -1
  128. package/dist/cdn/{shared-370be17b.js → shared-257389e5.js} +4 -4
  129. package/dist/cdn/{shared-a86480c5.js → shared-27e2e59a.js} +1 -1
  130. package/dist/cdn/{shared-527eb17e.js → shared-28b0e29a.js} +1 -1
  131. package/dist/cdn/{shared-869ed25d.js → shared-297e8531.js} +1 -1
  132. package/dist/cdn/{shared-e8df4368.js → shared-2cb3cb3a.js} +1 -1
  133. package/dist/cdn/{shared-851b96ae.js → shared-2f02918d.js} +1 -1
  134. package/dist/cdn/{shared-fceaef95.js → shared-31d8e958.js} +1 -1
  135. package/dist/cdn/{shared-bbd2a4e6.js → shared-32440b17.js} +1 -1
  136. package/dist/cdn/{shared-5245b330.js → shared-363dce45.js} +1 -1
  137. package/dist/cdn/{shared-b62fb09f.js → shared-3713f047.js} +1 -1
  138. package/dist/cdn/shared-44118acb.js +1 -0
  139. package/dist/cdn/shared-44fd89ce.js +1 -0
  140. package/dist/cdn/{shared-e0b00e0f.js → shared-4c4b87c2.js} +1 -1
  141. package/dist/cdn/{shared-3efc6649.js → shared-504f3c65.js} +1 -1
  142. package/dist/cdn/{shared-a34983ea.js → shared-51fd39fa.js} +1 -1
  143. package/dist/cdn/{shared-f57e1679.js → shared-525c1936.js} +1 -1
  144. package/dist/cdn/{shared-16766722.js → shared-53caa399.js} +1 -1
  145. package/dist/cdn/{shared-e6379bd1.js → shared-573d6e21.js} +1 -1
  146. package/dist/cdn/{shared-ae68261f.js → shared-57a98543.js} +1 -1
  147. package/dist/cdn/{shared-3e25035f.js → shared-5d308dd7.js} +1 -1
  148. package/dist/cdn/{shared-e766f6e0.js → shared-5e0b71a2.js} +1 -1
  149. package/dist/cdn/shared-67898669.js +1 -0
  150. package/dist/cdn/{shared-1838736d.js → shared-68fdcf24.js} +1 -1
  151. package/dist/cdn/{shared-f378fe25.js → shared-6de0e9f3.js} +1 -1
  152. package/dist/cdn/{shared-d806ec21.js → shared-70487b4c.js} +1 -1
  153. package/dist/cdn/{shared-7cfd461d.js → shared-7889f2f2.js} +1 -1
  154. package/dist/cdn/{shared-a83e33cd.js → shared-80688cd4.js} +1 -1
  155. package/dist/cdn/{shared-9e9bec09.js → shared-80a7903f.js} +1 -1
  156. package/dist/cdn/{shared-74d9b3d4.js → shared-84761b5b.js} +1 -1
  157. package/dist/cdn/{shared-0db6454a.js → shared-8af5a4f2.js} +1 -1
  158. package/dist/cdn/{shared-1df36027.js → shared-8b838d83.js} +1 -1
  159. package/dist/cdn/{shared-6c4a5133.js → shared-95a7dab8.js} +1 -1
  160. package/dist/cdn/{shared-c176c4fa.js → shared-96886940.js} +1 -1
  161. package/dist/cdn/{shared-6a63a308.js → shared-9f97643d.js} +1 -1
  162. package/dist/cdn/{shared-9421c0d7.js → shared-9fcd36e5.js} +1 -1
  163. package/dist/cdn/{shared-6cf0c762.js → shared-a585bfd3.js} +1 -1
  164. package/dist/cdn/shared-a7617e76.js +1 -0
  165. package/dist/cdn/{shared-0d0fe9c0.js → shared-ab26c69f.js} +1 -1
  166. package/dist/cdn/{shared-46de2ed2.js → shared-b04e9753.js} +1 -1
  167. package/dist/cdn/{shared-a4953186.js → shared-b0d76785.js} +1 -1
  168. package/dist/cdn/{shared-a24264e6.js → shared-b16829cd.js} +1 -1
  169. package/dist/cdn/{shared-7e1768cf.js → shared-b1fa0b61.js} +1 -1
  170. package/dist/cdn/{shared-85803aca.js → shared-b77e1a8a.js} +1 -1
  171. package/dist/cdn/{shared-e8b8c8d0.js → shared-bb3c9e23.js} +1 -1
  172. package/dist/cdn/{shared-7d234de2.js → shared-c5326ab8.js} +1 -1
  173. package/dist/cdn/{shared-921e3f1e.js → shared-c532d615.js} +1 -1
  174. package/dist/cdn/{shared-c1f4a6ef.js → shared-c5cb7e8a.js} +1 -1
  175. package/dist/cdn/{shared-2b6b735d.js → shared-c7740aa2.js} +1 -1
  176. package/dist/cdn/{shared-e7069b0f.js → shared-ce055dce.js} +1 -1
  177. package/dist/cdn/{shared-dbc9aff0.js → shared-cf0ca582.js} +1 -1
  178. package/dist/cdn/{shared-bec65d6d.js → shared-d3a5cb85.js} +2 -2
  179. package/dist/cdn/{shared-23aa2506.js → shared-d973155b.js} +1 -1
  180. package/dist/cdn/{shared-4e6c65e6.js → shared-da393323.js} +1 -1
  181. package/dist/cdn/{shared-0293eba8.js → shared-e77d8d01.js} +1 -1
  182. package/dist/cdn/{shared-2fd6e530.js → shared-eadddff6.js} +1 -1
  183. package/dist/cdn/{shared-51fd3fc6.js → shared-eb7bf7ba.js} +1 -1
  184. package/dist/cdn/{shared-7040eef3.js → shared-ebc72d69.js} +1 -1
  185. package/dist/cdn/{shared-9c479921.js → shared-ec5b614e.js} +1 -1
  186. package/dist/cdn/{shared-a7524277.js → shared-fc6bcfc5.js} +1 -1
  187. package/dist/cdn/{shared-2ddb119e.js → shared-ffc84c84.js} +1 -1
  188. package/dist/cdn/translations/experimental-add-to-cart-builder/en.json +558 -0
  189. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js +21 -6
  190. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js.map +1 -1
  191. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.d.ts +5 -2
  192. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js +61 -1
  193. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js.map +1 -1
  194. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js +1 -0
  195. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js.map +1 -1
  196. package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.d.ts +52 -0
  197. package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.js +887 -0
  198. package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.js.map +1 -0
  199. package/dist/elements/public/ExperimentalAddToCartBuilder/index.d.ts +16 -0
  200. package/dist/elements/public/ExperimentalAddToCartBuilder/index.js +18 -0
  201. package/dist/elements/public/ExperimentalAddToCartBuilder/index.js.map +1 -0
  202. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/InternalExperimentalAddToCartBuilderCustomOptionCard.d.ts +6 -0
  203. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/InternalExperimentalAddToCartBuilderCustomOptionCard.js +14 -0
  204. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/InternalExperimentalAddToCartBuilderCustomOptionCard.js.map +1 -0
  205. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/index.d.ts +3 -0
  206. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/index.js +5 -0
  207. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/index.js.map +1 -0
  208. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/types.d.ts +11 -0
  209. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/types.js +2 -0
  210. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/types.js.map +1 -0
  211. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/InternalExperimentalAddToCartBuilderCustomOptionForm.d.ts +21 -0
  212. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/InternalExperimentalAddToCartBuilderCustomOptionForm.js +123 -0
  213. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/InternalExperimentalAddToCartBuilderCustomOptionForm.js.map +1 -0
  214. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/index.d.ts +9 -0
  215. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/index.js +11 -0
  216. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/index.js.map +1 -0
  217. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/types.d.ts +11 -0
  218. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/types.js +2 -0
  219. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/types.js.map +1 -0
  220. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/InternalExperimentalAddToCartBuilderItemControl.d.ts +15 -0
  221. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/InternalExperimentalAddToCartBuilderItemControl.js +397 -0
  222. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/InternalExperimentalAddToCartBuilderItemControl.js.map +1 -0
  223. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/index.d.ts +19 -0
  224. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/index.js +21 -0
  225. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/index.js.map +1 -0
  226. package/dist/elements/public/ExperimentalAddToCartBuilder/preview.css.d.ts +2 -0
  227. package/dist/elements/public/ExperimentalAddToCartBuilder/preview.css.js +153 -0
  228. package/dist/elements/public/ExperimentalAddToCartBuilder/preview.css.js.map +1 -0
  229. package/dist/elements/public/ExperimentalAddToCartBuilder/types.d.ts +59 -0
  230. package/dist/elements/public/ExperimentalAddToCartBuilder/types.js +2 -0
  231. package/dist/elements/public/ExperimentalAddToCartBuilder/types.js.map +1 -0
  232. package/dist/elements/public/NucleonElement/API.js +3 -1
  233. package/dist/elements/public/NucleonElement/API.js.map +1 -1
  234. package/dist/elements/public/index.d.ts +1 -0
  235. package/dist/elements/public/index.defined.d.ts +1 -0
  236. package/dist/elements/public/index.defined.js +1 -0
  237. package/dist/elements/public/index.defined.js.map +1 -1
  238. package/dist/elements/public/index.js +1 -0
  239. package/dist/elements/public/index.js.map +1 -1
  240. package/dist/mixins/themeable.js +32 -0
  241. package/dist/mixins/themeable.js.map +1 -1
  242. package/package.json +3 -2
  243. package/dist/cdn/shared-0fe1dd67.js +0 -1
  244. package/dist/cdn/shared-41072bad.js +0 -1
  245. package/dist/cdn/shared-88bfb7f5.js +0 -1
  246. package/dist/cdn/shared-c518ece2.js +0 -1
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-ae68261f.js";import{h as r}from"./shared-dc73b9a5.js";import{a as s}from"./shared-e766f6e0.js";import{T as e}from"./shared-fceaef95.js";import"./shared-f57e1679.js";import"./shared-a24264e6.js";import"./shared-9421c0d7.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-f8252d03.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let t,a,c=r=>r;const i=s(e,"discount-detail-card");class o extends i{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}renderBody(){return super.renderBody({title:s=>r(t||(t=c`${0}`),s.name),subtitle:s=>{let e;try{e=Math.abs(s.amount_per).toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:this.__currencyDisplay,currency:this.__currency,style:"currency"})}catch(r){e="--"}return r(a||(a=c` <span class="${0}">${0}</span> `),s.amount_per>0?"text-success":"text-error",e)}})}async _sendGet(){const r=await super._sendGet(),[s,e]=await Promise.all([super._fetch(r._links["fx:transaction"].href),super._fetch(r._links["fx:store"].href)]);return this.__currency=s.currency_code,this.__currencyDisplay=e.use_international_currency_symbol?"code":"symbol",r}}customElements.define("foxy-discount-detail-card",o);export{o as DiscountDetailCard};
1
+ import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-57a98543.js";import{h as r}from"./shared-dc73b9a5.js";import{a as s}from"./shared-5e0b71a2.js";import{T as e}from"./shared-31d8e958.js";import"./shared-525c1936.js";import"./shared-b16829cd.js";import"./shared-9fcd36e5.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-238d397f.js";import"./shared-bb3c9e23.js";import"./shared-67898669.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let t,a,i=r=>r;const c=s(e,"discount-detail-card");class o extends c{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}renderBody(){return super.renderBody({title:s=>r(t||(t=i`${0}`),s.name),subtitle:s=>{let e;try{e=Math.abs(s.amount_per).toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:this.__currencyDisplay,currency:this.__currency,style:"currency"})}catch(r){e="--"}return r(a||(a=i` <span class="${0}">${0}</span> `),s.amount_per>0?"text-success":"text-error",e)}})}async _sendGet(){const r=await super._sendGet(),[s,e]=await Promise.all([super._fetch(r._links["fx:transaction"].href),super._fetch(r._links["fx:store"].href)]);return this.__currency=s.currency_code,this.__currencyDisplay=e.use_international_currency_symbol?"code":"symbol",r}}customElements.define("foxy-discount-detail-card",o);export{o as DiscountDetailCard};
@@ -1 +1 @@
1
- import{_ as t}from"./shared-d1195c27.js";import"./shared-0db6454a.js";import"./shared-921e3f1e.js";import"./shared-46de2ed2.js";import{h as e}from"./shared-dc73b9a5.js";import{y as s}from"./shared-e766f6e0.js";import{p as i}from"./shared-ae68261f.js";import{C as n}from"./shared-2b6b735d.js";import{b as r,C as a,I as o}from"./shared-869ed25d.js";import"./shared-2ddb119e.js";import{E as m}from"./shared-d735fc99.js";import{G as h}from"./shared-5245b330.js";import"./shared-527eb17e.js";import"./shared-0293eba8.js";import"./shared-f378fe25.js";import"./shared-16766722.js";import"./shared-d806ec21.js";import"./shared-126cb82b.js";import"./shared-6cf0c762.js";import"./shared-f57e1679.js";import"./shared-e0b00e0f.js";import"./shared-a24264e6.js";import"./shared-dbc9aff0.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-4e709717.js";import"./shared-7d234de2.js";import"./shared-1838736d.js";import"./shared-4f216dc1.js";import"./shared-c1f4a6ef.js";import"./shared-51fd3fc6.js";import"./shared-1df36027.js";import"./shared-651c44fa.js";import"./shared-bec65d6d.js";import"./shared-7e1768cf.js";import"./shared-99940888.js";import"./shared-fcdb896f.js";import"./shared-23aa2506.js";import"./shared-bbd2a4e6.js";import"./shared-c518ece2.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";class c extends CustomEvent{constructor(t){super("change",{detail:t})}}class d extends CustomEvent{constructor(){super("submit",{cancelable:!0})}}let u,l,p,y,g,f,$,b,j=t=>t;class x extends s{constructor(){super("donation"),this.currency=null,this.amount=null,this.store=null,this.name=null,this.custom=null,this.amounts=null,this.frequency=null,this.frequencies=null,this.designation=null,this.designations=null,this.comment=null,this.anonymity=!1,this.anonymous=!1,this.image=null,this.code=null,this.url=null,this.cart="checkout",this.target="_top"}static get scopedElements(){return{"vaadin-text-area":customElements.get("vaadin-text-area"),"x-error-screen":m,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":r,"x-checkbox":n,"x-choice":a,"x-group":h,"x-i18n":o}}static get properties(){return t(t({},super.properties),{},{currency:{type:String},custom:{type:Array},amount:{type:Number},amounts:{type:Array},frequency:{type:String},frequencies:{type:Array},designation:{type:Array},designations:{type:Array},comment:{type:String},anonymity:{reflect:!0,type:Boolean},anonymous:{reflect:!0,type:Boolean},image:{type:String},store:{type:String},name:{type:String},code:{type:String},url:{type:String},cart:{type:String},target:{type:String},empty:{type:String}})}static get events(){return{change:c,submit:d}}submit(){this.dispatchEvent(new d)&&this.__form.submit()}render(){var t,s;if(!(this.currency&&this.amount&&this.store&&this.name))return e(u||(u=j` <x-error-screen data-testid="error" type="setup_needed" class="relative"></x-error-screen> `));const i=this.store.includes(".")?this.store:`${this.store}.foxycart.com`;return e(l||(l=j` <form target="${0}" class="sr-only" method="POST" action="https://${0}/cart" data-testid="form"> ${0} </form> <section> ${0} </section> <section> ${0} </section> <section> ${0} </section> <section> ${0} <div class="flex flex-wrap -m-s"> ${0} <div class="flex-1 p-s"> <vaadin-button class="w-full" theme="primary" data-testid="submit" @click="${0}"> <x-i18n .opts="${0}" lang="${0}" key="${0}" ns="${0}"> </x-i18n> </vaadin-button> </div> </div> </section> `),this.target,i,[...this.__data.entries()].map((([t,s])=>e(p||(p=j`<input type="hidden" name="${0}" value="${0}">`),t,s))),this.amounts&&this.amounts.length>0?e(y||(y=j` <x-group frame> <x-i18n ns="${0}" lang="${0}" key="amount" slot="header"></x-i18n> <x-choice ?custom="${0}" .getText="${0}" .items="${0}" .value="${0}" type="number" lang="${0}" min="1" ns="${0}" data-testid="amount" @change="${0}"> </x-choice> </x-group> <slot name="amount" class="block my-m"></slot> `),this.ns,this.lang,!!(null===(t=this.custom)||void 0===t?void 0:t.includes("amount")),(t=>this.__translateAmount(parseFloat(t))),this.amounts.map(String),this.amount.toString(),this.lang,this.ns,(t=>{const e=parseFloat(t.detail);this.amount=isNaN(e)?1:e})):"",this.designations&&this.designations.length>0?e(g||(g=j` <x-dropdown .label="${0}" .items="${0}" .value="${0}" data-testid="designation" @change="${0}"> </x-dropdown> <slot name="designation" class="block my-m"></slot> `),this._t("designation").toString(),this.designations,Array.isArray(this.designation)?"${this.designation[0]}: ${this.designation[1]}":this.designation,(t=>{this.designation=t.detail})):"","string"==typeof this.comment?e(f||(f=j` <vaadin-text-area placeholder="${0}" value="${0}" label="${0}" class="w-full" data-testid="comment" @input="${0}"> </vaadin-text-area> <slot name="comment" class="block my-m"></slot> `),this._t("comment_placeholder").toString(),this.comment,this._t("comment_label").toString(),(t=>{t.stopPropagation(),this.comment=t.target.value})):"",this.anonymity?e($||($=j` <x-checkbox class="my-m" data-testid="anonymity" ?checked="${0}" @change="${0}"> ${0} </x-checkbox> `),this.anonymous,(t=>this.anonymous=t.detail),this._t("anonymous")):"",this.frequencies&&this.frequencies.length>0?e(b||(b=j` <div class="flex-1 p-s"> <x-dropdown .value="${0}" .items="${0}" .getText="${0}" data-testid="frequency" @change="${0}"> </x-dropdown> </div> `),this.frequency,this.frequencies,this.__translateFrequency.bind(this),(t=>{this.frequency=t.detail})):"",(()=>this.submit()),{amount:this.__translateAmount(this.amount),frequency:this.frequency?this.__translateFrequency(this.frequency):""},this.lang,this.frequency&&!(null===(s=this.frequencies)||void 0===s?void 0:s.length)?"donate_recurrently":"donate",this.ns)}updated(){this.dispatchEvent(new c(this.__data))}get __data(){const t=new FormData;return"string"==typeof this.designation&&t.set("Designation",this.designation.trim()),"number"==typeof this.amount&&"string"==typeof this.currency&&t.set("price",`${this.amount.toFixed(2)}${this.currency}`),this.frequency&&t.set("sub_frequency",this.frequency),"string"==typeof this.comment&&t.set("Comment",this.comment.trim()),"string"==typeof this.image&&t.set("image",this.image),"string"==typeof this.code&&t.set("code",this.code),"string"==typeof this.name&&t.set("name",this.name.trim()),"string"==typeof this.url&&t.set("url",this.url),"string"==typeof this.cart&&t.set("cart",this.cart),this.empty&&t.set("empty",this.empty),this.anonymous&&t.set("Anonymous","true"),t.set("quantity","1"),t}get __form(){return this.shadowRoot.querySelector("form")}__translateFrequency(t){if(!t||t.match(/^\s*$/))return this._t("frequency_once");if(".5m"===t)return this._t("frequency_0_5m");const{count:e,units:s}=i(t);return this._t("frequency",{units:this._t(s,{count:e}),count:e})}__translateAmount(t){return t.toLocaleString(this.lang,{minimumFractionDigits:0,currency:this.currency,style:"currency"})}}customElements.define("foxy-donation",x);export{x as Donation};
1
+ import{_ as t}from"./shared-d1195c27.js";import"./shared-8af5a4f2.js";import"./shared-c532d615.js";import"./shared-b04e9753.js";import{h as e}from"./shared-dc73b9a5.js";import{y as s}from"./shared-5e0b71a2.js";import{p as i}from"./shared-57a98543.js";import{C as n}from"./shared-c7740aa2.js";import{b as r,C as a,I as o}from"./shared-297e8531.js";import"./shared-ffc84c84.js";import{E as c}from"./shared-0e2a0b21.js";import{G as m}from"./shared-363dce45.js";import"./shared-28b0e29a.js";import"./shared-e77d8d01.js";import"./shared-6de0e9f3.js";import"./shared-53caa399.js";import"./shared-70487b4c.js";import"./shared-018166d0.js";import"./shared-a585bfd3.js";import"./shared-525c1936.js";import"./shared-4c4b87c2.js";import"./shared-b16829cd.js";import"./shared-cf0ca582.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-4e709717.js";import"./shared-c5326ab8.js";import"./shared-68fdcf24.js";import"./shared-112e521b.js";import"./shared-c5cb7e8a.js";import"./shared-eb7bf7ba.js";import"./shared-8b838d83.js";import"./shared-651c44fa.js";import"./shared-d3a5cb85.js";import"./shared-b1fa0b61.js";import"./shared-99940888.js";import"./shared-fcdb896f.js";import"./shared-d973155b.js";import"./shared-32440b17.js";import"./shared-67898669.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";class h extends CustomEvent{constructor(t){super("change",{detail:t})}}class d extends CustomEvent{constructor(){super("submit",{cancelable:!0})}}let u,l,p,y,g,f,b,$,j=t=>t;class x extends s{constructor(){super("donation"),this.currency=null,this.amount=null,this.store=null,this.name=null,this.custom=null,this.amounts=null,this.frequency=null,this.frequencies=null,this.designation=null,this.designations=null,this.comment=null,this.anonymity=!1,this.anonymous=!1,this.image=null,this.code=null,this.url=null,this.cart="checkout",this.target="_top"}static get scopedElements(){return{"vaadin-text-area":customElements.get("vaadin-text-area"),"x-error-screen":c,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":r,"x-checkbox":n,"x-choice":a,"x-group":m,"x-i18n":o}}static get properties(){return t(t({},super.properties),{},{currency:{type:String},custom:{type:Array},amount:{type:Number},amounts:{type:Array},frequency:{type:String},frequencies:{type:Array},designation:{type:Array},designations:{type:Array},comment:{type:String},anonymity:{reflect:!0,type:Boolean},anonymous:{reflect:!0,type:Boolean},image:{type:String},store:{type:String},name:{type:String},code:{type:String},url:{type:String},cart:{type:String},target:{type:String},empty:{type:String}})}static get events(){return{change:h,submit:d}}submit(){this.dispatchEvent(new d)&&this.__form.submit()}render(){var t,s;if(!(this.currency&&this.amount&&this.store&&this.name))return e(u||(u=j` <x-error-screen data-testid="error" type="setup_needed" class="relative"></x-error-screen> `));const i=this.store.includes(".")?this.store:`${this.store}.foxycart.com`;return e(l||(l=j` <form target="${0}" class="sr-only" method="POST" action="https://${0}/cart" data-testid="form"> ${0} </form> <section> ${0} </section> <section> ${0} </section> <section> ${0} </section> <section> ${0} <div class="flex flex-wrap -m-s"> ${0} <div class="flex-1 p-s"> <vaadin-button class="w-full" theme="primary" data-testid="submit" @click="${0}"> <x-i18n .opts="${0}" lang="${0}" key="${0}" ns="${0}"> </x-i18n> </vaadin-button> </div> </div> </section> `),this.target,i,[...this.__data.entries()].map((([t,s])=>e(p||(p=j`<input type="hidden" name="${0}" value="${0}">`),t,s))),this.amounts&&this.amounts.length>0?e(y||(y=j` <x-group frame> <x-i18n ns="${0}" lang="${0}" key="amount" slot="header"></x-i18n> <x-choice ?custom="${0}" .getText="${0}" .items="${0}" .value="${0}" type="number" lang="${0}" min="1" ns="${0}" data-testid="amount" @change="${0}"> </x-choice> </x-group> <slot name="amount" class="block my-m"></slot> `),this.ns,this.lang,!!(null===(t=this.custom)||void 0===t?void 0:t.includes("amount")),(t=>this.__translateAmount(parseFloat(t))),this.amounts.map(String),this.amount.toString(),this.lang,this.ns,(t=>{const e=parseFloat(t.detail);this.amount=isNaN(e)?1:e})):"",this.designations&&this.designations.length>0?e(g||(g=j` <x-dropdown .label="${0}" .items="${0}" .value="${0}" data-testid="designation" @change="${0}"> </x-dropdown> <slot name="designation" class="block my-m"></slot> `),this._t("designation").toString(),this.designations,Array.isArray(this.designation)?"${this.designation[0]}: ${this.designation[1]}":this.designation,(t=>{this.designation=t.detail})):"","string"==typeof this.comment?e(f||(f=j` <vaadin-text-area placeholder="${0}" value="${0}" label="${0}" class="w-full" data-testid="comment" @input="${0}"> </vaadin-text-area> <slot name="comment" class="block my-m"></slot> `),this._t("comment_placeholder").toString(),this.comment,this._t("comment_label").toString(),(t=>{t.stopPropagation(),this.comment=t.target.value})):"",this.anonymity?e(b||(b=j` <x-checkbox class="my-m" data-testid="anonymity" ?checked="${0}" @change="${0}"> ${0} </x-checkbox> `),this.anonymous,(t=>this.anonymous=t.detail),this._t("anonymous")):"",this.frequencies&&this.frequencies.length>0?e($||($=j` <div class="flex-1 p-s"> <x-dropdown .value="${0}" .items="${0}" .getText="${0}" data-testid="frequency" @change="${0}"> </x-dropdown> </div> `),this.frequency,this.frequencies,this.__translateFrequency.bind(this),(t=>{this.frequency=t.detail})):"",(()=>this.submit()),{amount:this.__translateAmount(this.amount),frequency:this.frequency?this.__translateFrequency(this.frequency):""},this.lang,this.frequency&&!(null===(s=this.frequencies)||void 0===s?void 0:s.length)?"donate_recurrently":"donate",this.ns)}updated(){this.dispatchEvent(new h(this.__data))}get __data(){const t=new FormData;return"string"==typeof this.designation&&t.set("Designation",this.designation.trim()),"number"==typeof this.amount&&"string"==typeof this.currency&&t.set("price",`${this.amount.toFixed(2)}${this.currency}`),this.frequency&&t.set("sub_frequency",this.frequency),"string"==typeof this.comment&&t.set("Comment",this.comment.trim()),"string"==typeof this.image&&t.set("image",this.image),"string"==typeof this.code&&t.set("code",this.code),"string"==typeof this.name&&t.set("name",this.name.trim()),"string"==typeof this.url&&t.set("url",this.url),"string"==typeof this.cart&&t.set("cart",this.cart),this.empty&&t.set("empty",this.empty),this.anonymous&&t.set("Anonymous","true"),t.set("quantity","1"),t}get __form(){return this.shadowRoot.querySelector("form")}__translateFrequency(t){if(!t||t.match(/^\s*$/))return this._t("frequency_once");if(".5m"===t)return this._t("frequency_0_5m");const{count:e,units:s}=i(t);return this._t("frequency",{units:this._t(s,{count:e}),count:e})}__translateAmount(t){return t.toLocaleString(this.lang,{minimumFractionDigits:0,currency:this.currency,style:"currency"})}}customElements.define("foxy-donation",x);export{x as Donation};
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./shared-41072bad.js";import"./foxy-spinner.js";import"./shared-ae68261f.js";import{a as e}from"./shared-e766f6e0.js";import{T as s}from"./shared-fceaef95.js";import{h as t,s as r}from"./shared-dc73b9a5.js";import"./shared-f8252d03.js";import"./shared-e8b8c8d0.js";import"./shared-d1195c27.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-17a61265.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-f57e1679.js";import"./shared-a24264e6.js";import"./shared-9421c0d7.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";let a,i,o,n,d,l,c=e=>e;const m=e(s,"downloadable-card");class h extends m{renderBody(){const e=this.__extension;return t(a||(a=c` <div class="flex gap-s"> <div class="w-s h-s flex-shrink-0 rounded-s bg-contrast-5 flex" aria-hidden="true"> ${0} </div> <div class="flex-1 min-w-0"> ${0} </div> </div> `),e.length<5?this.__renderExtension(e):r(i||(i=c`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="m-auto" style="width: 64%; height: 64%"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" /></svg>`)),super.renderBody({title:e=>t(o||(o=c` <span class="inline-flex w-full items-center"> <span class="mr-auto truncate min-w-0">${0} &bull; ${0}</span> <span class="text-s text-tertiary font-normal flex-shrink-0"> ${0} ${0} </span> </span> `),e.name,e.code,r(n||(n=c`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="inline" style="width: 1.15em; height: 1.15em"><path d="M10.75 10.818v2.614A3.13 3.13 0 0011.888 13c.482-.315.612-.648.612-.875 0-.227-.13-.56-.612-.875a3.13 3.13 0 00-1.138-.432zM8.33 8.62c.053.055.115.11.184.164.208.16.46.284.736.363V6.603a2.45 2.45 0 00-.35.13c-.14.065-.27.143-.386.233-.377.292-.514.627-.514.909 0 .184.058.39.202.592.037.051.08.102.128.152z" /><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-6a.75.75 0 01.75.75v.316a3.78 3.78 0 011.653.713c.426.33.744.74.925 1.2a.75.75 0 01-1.395.55 1.35 1.35 0 00-.447-.563 2.187 2.187 0 00-.736-.363V9.3c.698.093 1.383.32 1.959.696.787.514 1.29 1.27 1.29 2.13 0 .86-.504 1.616-1.29 2.13-.576.377-1.261.603-1.96.696v.299a.75.75 0 11-1.5 0v-.3c-.697-.092-1.382-.318-1.958-.695-.482-.315-.857-.717-1.078-1.188a.75.75 0 111.359-.636c.08.173.245.376.54.569.313.205.706.353 1.138.432v-2.748a3.782 3.782 0 01-1.653-.713C6.9 9.433 6.5 8.681 6.5 7.875c0-.805.4-1.558 1.097-2.096a3.78 3.78 0 011.653-.713V4.75A.75.75 0 0110 4z" clip-rule="evenodd" /></svg>`)),this.__formattedPrice),subtitle:e=>t(d||(d=c`${0} (${0})`),e.file_name,this.__formattedFileSize)}))}get __formattedFileSize(){var e,s;const t=null!==(s=null===(e=this.data)||void 0===e?void 0:e.file_size)&&void 0!==s?s:0,r=1024,a=1048576,i=1024*a,o={maximumFractionDigits:2},n=this.lang||"en";try{return t/i>1?`${(t/i).toLocaleString(n,o)} GB`:t/a>1?`${(t/a).toLocaleString(n,o)} MB`:t/r>1?`${(t/r).toLocaleString(n,o)} KB`:`${t.toLocaleString(n,o)} B`}catch(e){return`${t} B`}}get __formattedPrice(){var e,s;const t=null!==(s=null===(e=this.data)||void 0===e?void 0:e.price)&&void 0!==s?s:0;try{return t.toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2})}catch(e){return String(t)}}get __extension(){var e,s;const t=null!==(s=null===(e=this.data)||void 0===e?void 0:e.file_name.split(".").filter((e=>!!e)))&&void 0!==s?s:[];return t.length<2?"?????":t.pop()}__renderExtension(e){const s=`font: 700 calc(var(--lumo-size-s) / ${Math.max(2,e.length)}) sans-serif`;return t(l||(l=c`<span style="${0}" class="m-auto font-medium uppercase">${0}</span>`),s,e)}}customElements.define("foxy-downloadable-card",h);export{h as DownloadableCard};
1
+ import"./shared-51c4a6dd.js";import"./shared-a7617e76.js";import"./foxy-spinner.js";import"./shared-57a98543.js";import{a as e}from"./shared-5e0b71a2.js";import{T as s}from"./shared-31d8e958.js";import{h as t,s as r}from"./shared-dc73b9a5.js";import"./shared-238d397f.js";import"./shared-bb3c9e23.js";import"./shared-d1195c27.js";import"./shared-67898669.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-17a61265.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-525c1936.js";import"./shared-b16829cd.js";import"./shared-9fcd36e5.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";let a,i,o,n,d,l,c=e=>e;const m=e(s,"downloadable-card");class h extends m{renderBody(){const e=this.__extension;return t(a||(a=c` <div class="flex gap-s"> <div class="w-s h-s flex-shrink-0 rounded-s bg-contrast-5 flex" aria-hidden="true"> ${0} </div> <div class="flex-1 min-w-0"> ${0} </div> </div> `),e.length<5?this.__renderExtension(e):r(i||(i=c`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="m-auto" style="width: 64%; height: 64%"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" /></svg>`)),super.renderBody({title:e=>t(o||(o=c` <span class="inline-flex w-full items-center"> <span class="mr-auto truncate min-w-0">${0} &bull; ${0}</span> <span class="text-s text-tertiary font-normal flex-shrink-0"> ${0} ${0} </span> </span> `),e.name,e.code,r(n||(n=c`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="inline" style="width: 1.15em; height: 1.15em"><path d="M10.75 10.818v2.614A3.13 3.13 0 0011.888 13c.482-.315.612-.648.612-.875 0-.227-.13-.56-.612-.875a3.13 3.13 0 00-1.138-.432zM8.33 8.62c.053.055.115.11.184.164.208.16.46.284.736.363V6.603a2.45 2.45 0 00-.35.13c-.14.065-.27.143-.386.233-.377.292-.514.627-.514.909 0 .184.058.39.202.592.037.051.08.102.128.152z" /><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-6a.75.75 0 01.75.75v.316a3.78 3.78 0 011.653.713c.426.33.744.74.925 1.2a.75.75 0 01-1.395.55 1.35 1.35 0 00-.447-.563 2.187 2.187 0 00-.736-.363V9.3c.698.093 1.383.32 1.959.696.787.514 1.29 1.27 1.29 2.13 0 .86-.504 1.616-1.29 2.13-.576.377-1.261.603-1.96.696v.299a.75.75 0 11-1.5 0v-.3c-.697-.092-1.382-.318-1.958-.695-.482-.315-.857-.717-1.078-1.188a.75.75 0 111.359-.636c.08.173.245.376.54.569.313.205.706.353 1.138.432v-2.748a3.782 3.782 0 01-1.653-.713C6.9 9.433 6.5 8.681 6.5 7.875c0-.805.4-1.558 1.097-2.096a3.78 3.78 0 011.653-.713V4.75A.75.75 0 0110 4z" clip-rule="evenodd" /></svg>`)),this.__formattedPrice),subtitle:e=>t(d||(d=c`${0} (${0})`),e.file_name,this.__formattedFileSize)}))}get __formattedFileSize(){var e,s;const t=null!==(s=null===(e=this.data)||void 0===e?void 0:e.file_size)&&void 0!==s?s:0,r=1024,a=1048576,i=1024*a,o={maximumFractionDigits:2},n=this.lang||"en";try{return t/i>1?`${(t/i).toLocaleString(n,o)} GB`:t/a>1?`${(t/a).toLocaleString(n,o)} MB`:t/r>1?`${(t/r).toLocaleString(n,o)} KB`:`${t.toLocaleString(n,o)} B`}catch(e){return`${t} B`}}get __formattedPrice(){var e,s;const t=null!==(s=null===(e=this.data)||void 0===e?void 0:e.price)&&void 0!==s?s:0;try{return t.toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2})}catch(e){return String(t)}}get __extension(){var e,s;const t=null!==(s=null===(e=this.data)||void 0===e?void 0:e.file_name.split(".").filter((e=>!!e)))&&void 0!==s?s:[];return t.length<2?"?????":t.pop()}__renderExtension(e){const s=`font: 700 calc(var(--lumo-size-s) / ${Math.max(2,e.length)}) sans-serif`;return t(l||(l=c`<span style="${0}" class="m-auto font-medium uppercase">${0}</span>`),s,e)}}customElements.define("foxy-downloadable-card",h);export{h as DownloadableCard};
@@ -1,4 +1,4 @@
1
- import{b as e,a as t,I as r}from"./shared-0fe1dd67.js";import"./shared-6cf0c762.js";import"./shared-126cb82b.js";import"./shared-527eb17e.js";import"./shared-0db6454a.js";import{h as a,P as o,B as i}from"./shared-a24264e6.js";import{E as s,T as l}from"./shared-dbc9aff0.js";import"./shared-f57e1679.js";import"./shared-ae68261f.js";import{x as n,a as d}from"./shared-e766f6e0.js";import{c as A,h as u}from"./shared-dc73b9a5.js";import{i as p}from"./shared-9803aa7c.js";import{c}from"./shared-4e709717.js";import"./shared-c1f4a6ef.js";import{_ as m,B as h}from"./shared-d1195c27.js";import{A as g}from"./shared-c518ece2.js";import"./shared-7cfd461d.js";import"./shared-a4953186.js";import"./foxy-nucleon-element.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-e8b8c8d0.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";import"./shared-a86480c5.js";import"./shared-2ddb119e.js";import"./foxy-copy-to-clipboard.js";import"./shared-e6379bd1.js";import"./shared-e0b00e0f.js";import"./shared-9421c0d7.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-51fd3fc6.js";import"./shared-f378fe25.js";import"./shared-1df36027.js";import"./shared-0293eba8.js";import"./shared-651c44fa.js";import"./shared-46de2ed2.js";import"./shared-16766722.js";import"./shared-bec65d6d.js";import"./shared-7e1768cf.js";import"./shared-7d234de2.js";import"./shared-22ba9566.js";const f=a`<dom-module id="lumo-progress-bar" theme-for="vaadin-progress-bar">
1
+ import{b as e,a as t,I as r}from"./shared-44fd89ce.js";import"./shared-a585bfd3.js";import"./shared-018166d0.js";import"./shared-28b0e29a.js";import"./shared-8af5a4f2.js";import{h as a,P as o,B as i}from"./shared-b16829cd.js";import{E as s,T as l}from"./shared-cf0ca582.js";import"./shared-525c1936.js";import"./shared-57a98543.js";import{x as n,a as d}from"./shared-5e0b71a2.js";import{c as A,h as u}from"./shared-dc73b9a5.js";import{i as p}from"./shared-9803aa7c.js";import{c}from"./shared-4e709717.js";import"./shared-c5cb7e8a.js";import{_ as m,B as h}from"./shared-d1195c27.js";import{A as g}from"./shared-67898669.js";import"./shared-7889f2f2.js";import"./shared-b0d76785.js";import"./foxy-nucleon-element.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-bb3c9e23.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";import"./shared-27e2e59a.js";import"./shared-ffc84c84.js";import"./foxy-copy-to-clipboard.js";import"./shared-573d6e21.js";import"./shared-4c4b87c2.js";import"./shared-9fcd36e5.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-eb7bf7ba.js";import"./shared-6de0e9f3.js";import"./shared-8b838d83.js";import"./shared-e77d8d01.js";import"./shared-651c44fa.js";import"./shared-b04e9753.js";import"./shared-53caa399.js";import"./shared-d3a5cb85.js";import"./shared-b1fa0b61.js";import"./shared-c5326ab8.js";import"./shared-22ba9566.js";const f=a`<dom-module id="lumo-progress-bar" theme-for="vaadin-progress-bar">
2
2
  <template>
3
3
  <style>
4
4
  :host {
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-ae68261f.js";import{a as e}from"./shared-e766f6e0.js";import{T as t}from"./shared-fceaef95.js";import{h as r}from"./shared-dc73b9a5.js";import"./shared-f57e1679.js";import"./shared-a24264e6.js";import"./shared-9421c0d7.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-f8252d03.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let s,d,o=e=>e;const a=e(t,"email-template-card");class m extends a{renderBody(){return super.renderBody({title:e=>r(s||(s=o`${0}`),e.description),subtitle:e=>r(d||(d=o`<foxy-i18n infer="" key="${0}"></foxy-i18n>`),this.__getType(e))})}__getType(e){const{content_html_url:t,content_text_url:r}=e,{content_html:s,content_text:d}=e;return!d||r||s||t?!s||t||d||r?!t||r||s||d?!r||t||d||s?s||t||d||r?"type_mixed":"type_default":"type_custom_text_url":"type_custom_html_url":"type_custom_html":"type_custom_text"}}customElements.define("foxy-email-template-card",m);export{m as EmailTemplateCard};
1
+ import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-57a98543.js";import{a as t}from"./shared-5e0b71a2.js";import{T as e}from"./shared-31d8e958.js";import{h as r}from"./shared-dc73b9a5.js";import"./shared-525c1936.js";import"./shared-b16829cd.js";import"./shared-9fcd36e5.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-238d397f.js";import"./shared-bb3c9e23.js";import"./shared-67898669.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let s,d,o=t=>t;const a=t(e,"email-template-card");class m extends a{renderBody(){return super.renderBody({title:t=>r(s||(s=o`${0}`),t.description),subtitle:t=>r(d||(d=o`<foxy-i18n infer="" key="${0}"></foxy-i18n>`),this.__getType(t))})}__getType(t){const{content_html_url:e,content_text_url:r}=t,{content_html:s,content_text:d}=t;return!d||r||s||e?!s||e||d||r?!e||r||s||d?!r||e||d||s?s||e||d||r?"type_mixed":"type_default":"type_custom_text_url":"type_custom_html_url":"type_custom_html":"type_custom_text"}}customElements.define("foxy-email-template-card",m);export{m as EmailTemplateCard};
@@ -1 +1 @@
1
- import"./shared-88bfb7f5.js";import"./shared-85803aca.js";import"./shared-9e9bec09.js";import"./shared-a83e33cd.js";import"./shared-a4953186.js";import{b as t,I as e}from"./shared-0fe1dd67.js";import"./shared-0db6454a.js";import"./shared-ae68261f.js";import{_ as r,B as s}from"./shared-d1195c27.js";import{N as a}from"./shared-e8b8c8d0.js";import{h as o}from"./shared-dc73b9a5.js";import{a as n}from"./shared-e766f6e0.js";import{i}from"./shared-9803aa7c.js";import"./shared-a0c6a159.js";import"./shared-c1f4a6ef.js";import"./shared-126cb82b.js";import"./shared-a24264e6.js";import"./shared-51fd3fc6.js";import"./shared-f378fe25.js";import"./shared-f57e1679.js";import"./shared-1df36027.js";import"./shared-dbc9aff0.js";import"./shared-0293eba8.js";import"./shared-6cf0c762.js";import"./shared-651c44fa.js";import"./shared-527eb17e.js";import"./shared-46de2ed2.js";import"./shared-16766722.js";import"./shared-bec65d6d.js";import"./shared-7e1768cf.js";import"./shared-4e709717.js";import"./shared-e6379bd1.js";import"./shared-e0b00e0f.js";import"./shared-22ba9566.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-a86480c5.js";import"./shared-2ddb119e.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./foxy-copy-to-clipboard.js";import"./shared-9421c0d7.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";let l,c=t=>t;customElements.define("foxy-internal-email-template-form-async-action",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return r(r({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"";return o(l||(l=c` <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),`${this.theme} ${null!=e?e:""}`.trim(),"busy"===t||this.disabled,this.__submit,t)}async __submit(){var t,e;if("busy"!==this.__state)try{this.__state="busy";const r=new a.API(this),s=await r.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=s.ok?"idle":"fail",s.ok&&(null===(e=this.nucleon)||void 0===e||e.refresh())}catch(t){this.__state="fail"}}});let h,m=t=>t;const d=n(e,"email-template-form");class f extends d{constructor(){super(...arguments),this.__templateLanguageOptions=[{rawLabel:"Nunjucks",value:"nunjucks"},{rawLabel:"Handlebars",value:"handlebars"},{rawLabel:"Pug",value:"pug"},{rawLabel:"Twig",value:"twig"},{rawLabel:"EJS",value:"ejs"}],this.__toggleGetValue=()=>!!this.form.subject,this.__toggleSetValue=t=>{this.edit({subject:t?this.t("general.subject.default_value"):""})}}get readonlySelector(){const t=[super.readonlySelector.toString()],e=this.form.subject;return this.form.content_html_url&&e&&t.unshift("content-html"),this.form.content_text_url&&e&&t.unshift("content-text"),new s(t.join(" ").trim())}get disabledSelector(){const t=[super.disabledSelector.toString()];return this.in({idle:{snapshot:"clean"}})&&this.data.content_html_url&&this.data.content_text_url||t.unshift("html-source:cache","text-source:cache"),this.form.subject||t.unshift("general:template-language","html-source","text-source","content-html","content-text"),new s(t.join(" ").trim())}get hiddenSelector(){var t,e,r;const a=[super.hiddenSelector.toString()];return(null===(t=this.data)||void 0===t?void 0:t.content_html_url)||a.unshift("html-source:cache"),(null===(e=this.data)||void 0===e?void 0:e.content_text_url)||a.unshift("text-source:cache"),(null===(r=this.data)||void 0===r?void 0:r.subject)||this.form.subject||a.unshift("general:template-language","general:subject","html-source","text-source","content-html","content-text"),new s(a.join(" ").trim())}renderBody(){var t,e;return o(h||(h=m` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> <foxy-internal-switch-control infer="toggle" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="subject"> </foxy-internal-text-control> <foxy-internal-select-control layout="summary-item" infer="template-language" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> ${0} <foxy-internal-source-control infer="content-html"></foxy-internal-source-control> <foxy-internal-summary-control infer="html-source"> <foxy-internal-text-control layout="summary-item" infer="content-html-url"> </foxy-internal-text-control> <foxy-internal-email-template-form-async-action theme="tertiary-inline" infer="cache" href="${0}"> </foxy-internal-email-template-form-async-action> </foxy-internal-summary-control> <foxy-internal-source-control infer="content-text"></foxy-internal-source-control> <foxy-internal-summary-control infer="text-source"> <foxy-internal-text-control layout="summary-item" infer="content-text-url"> </foxy-internal-text-control> <foxy-internal-email-template-form-async-action theme="tertiary-inline" infer="cache" href="${0}"> </foxy-internal-email-template-form-async-action> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.__toggleGetValue,this.__toggleSetValue,this.__templateLanguageOptions,this.renderTemplateOrSlot(),i(null===(t=this.data)||void 0===t?void 0:t._links["fx:cache"].href),i(null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href),super.renderBody())}async _sendPost(t){const e=await super._sendPost(t);if(t.content_html_url&&t.content_text_url){const t=e._links["fx:cache"].href;if(!(await new f.API(this).fetch(t,{method:"POST"})).ok)throw["error:failed_to_cache"]}return await this._fetch(e._links.self.href)}async _sendPatch(t){const e=await super._sendPatch(t);if(!t.content_html_url&&!t.content_text_url)return e;const r=e._links["fx:cache"].href;if(!(await new f.API(this).fetch(r,{method:"POST"})).ok)throw["error:failed_to_cache"];return await this._fetch(e._links.self.href)}}customElements.define("foxy-email-template-form",f);export{f as EmailTemplateForm};
1
+ import"./shared-44118acb.js";import"./shared-b77e1a8a.js";import"./shared-80a7903f.js";import"./shared-80688cd4.js";import"./shared-b0d76785.js";import{b as t,I as e}from"./shared-44fd89ce.js";import"./shared-8af5a4f2.js";import"./shared-57a98543.js";import{_ as r,B as a}from"./shared-d1195c27.js";import{N as s}from"./shared-bb3c9e23.js";import{h as o}from"./shared-dc73b9a5.js";import{a as n}from"./shared-5e0b71a2.js";import{i}from"./shared-9803aa7c.js";import"./shared-a0c6a159.js";import"./shared-c5cb7e8a.js";import"./shared-018166d0.js";import"./shared-b16829cd.js";import"./shared-eb7bf7ba.js";import"./shared-6de0e9f3.js";import"./shared-525c1936.js";import"./shared-8b838d83.js";import"./shared-cf0ca582.js";import"./shared-e77d8d01.js";import"./shared-a585bfd3.js";import"./shared-651c44fa.js";import"./shared-28b0e29a.js";import"./shared-b04e9753.js";import"./shared-53caa399.js";import"./shared-d3a5cb85.js";import"./shared-b1fa0b61.js";import"./shared-4e709717.js";import"./shared-573d6e21.js";import"./shared-4c4b87c2.js";import"./shared-22ba9566.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-27e2e59a.js";import"./shared-ffc84c84.js";import"./shared-67898669.js";import"./shared-343d1fd7.js";import"./foxy-copy-to-clipboard.js";import"./shared-9fcd36e5.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";let l,c=t=>t;customElements.define("foxy-internal-email-template-form-async-action",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return r(r({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"";return o(l||(l=c` <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),`${this.theme} ${null!=e?e:""}`.trim(),"busy"===t||this.disabled,this.__submit,t)}async __submit(){var t,e;if("busy"!==this.__state)try{this.__state="busy";const r=new s.API(this),a=await r.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=a.ok?"idle":"fail",a.ok&&(null===(e=this.nucleon)||void 0===e||e.refresh())}catch(t){this.__state="fail"}}});let h,m=t=>t;const d=n(e,"email-template-form");class f extends d{constructor(){super(...arguments),this.__templateLanguageOptions=[{rawLabel:"Nunjucks",value:"nunjucks"},{rawLabel:"Handlebars",value:"handlebars"},{rawLabel:"Pug",value:"pug"},{rawLabel:"Twig",value:"twig"},{rawLabel:"EJS",value:"ejs"}],this.__toggleGetValue=()=>!!this.form.subject,this.__toggleSetValue=t=>{this.edit({subject:t?this.t("general.subject.default_value"):""})}}get readonlySelector(){const t=[super.readonlySelector.toString()],e=this.form.subject;return this.form.content_html_url&&e&&t.unshift("content-html"),this.form.content_text_url&&e&&t.unshift("content-text"),new a(t.join(" ").trim())}get disabledSelector(){const t=[super.disabledSelector.toString()];return this.in({idle:{snapshot:"clean"}})&&this.data.content_html_url&&this.data.content_text_url||t.unshift("html-source:cache","text-source:cache"),this.form.subject||t.unshift("general:template-language","html-source","text-source","content-html","content-text"),new a(t.join(" ").trim())}get hiddenSelector(){var t,e,r;const s=[super.hiddenSelector.toString()];return(null===(t=this.data)||void 0===t?void 0:t.content_html_url)||s.unshift("html-source:cache"),(null===(e=this.data)||void 0===e?void 0:e.content_text_url)||s.unshift("text-source:cache"),(null===(r=this.data)||void 0===r?void 0:r.subject)||this.form.subject||s.unshift("general:template-language","general:subject","html-source","text-source","content-html","content-text"),new a(s.join(" ").trim())}renderBody(){var t,e;return o(h||(h=m` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> <foxy-internal-switch-control infer="toggle" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="subject"> </foxy-internal-text-control> <foxy-internal-select-control layout="summary-item" infer="template-language" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> ${0} <foxy-internal-source-control infer="content-html"></foxy-internal-source-control> <foxy-internal-summary-control infer="html-source"> <foxy-internal-text-control layout="summary-item" infer="content-html-url"> </foxy-internal-text-control> <foxy-internal-email-template-form-async-action theme="tertiary-inline" infer="cache" href="${0}"> </foxy-internal-email-template-form-async-action> </foxy-internal-summary-control> <foxy-internal-source-control infer="content-text"></foxy-internal-source-control> <foxy-internal-summary-control infer="text-source"> <foxy-internal-text-control layout="summary-item" infer="content-text-url"> </foxy-internal-text-control> <foxy-internal-email-template-form-async-action theme="tertiary-inline" infer="cache" href="${0}"> </foxy-internal-email-template-form-async-action> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.__toggleGetValue,this.__toggleSetValue,this.__templateLanguageOptions,this.renderTemplateOrSlot(),i(null===(t=this.data)||void 0===t?void 0:t._links["fx:cache"].href),i(null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href),super.renderBody())}async _sendPost(t){const e=await super._sendPost(t);if(t.content_html_url&&t.content_text_url){const t=e._links["fx:cache"].href;if(!(await new f.API(this).fetch(t,{method:"POST"})).ok)throw["error:failed_to_cache"]}return await this._fetch(e._links.self.href)}async _sendPatch(t){const e=await super._sendPatch(t);if(!t.content_html_url&&!t.content_text_url)return e;const r=e._links["fx:cache"].href;if(!(await new f.API(this).fetch(r,{method:"POST"})).ok)throw["error:failed_to_cache"];return await this._fetch(e._links.self.href)}}customElements.define("foxy-email-template-form",f);export{f as EmailTemplateForm};
@@ -1 +1 @@
1
- import{aH as e,_ as s}from"./shared-d1195c27.js";import{L as r,c as t,h as a}from"./shared-dc73b9a5.js";import{T as i,a as n,S as o}from"./shared-e766f6e0.js";import{c as d}from"./shared-4e709717.js";import{G as l}from"./shared-5245b330.js";import"./foxy-nucleon-element.js";import{g as c}from"./shared-bab2ea2c.js";import{N as p}from"./shared-e8b8c8d0.js";import{d as u}from"./shared-641786b2.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-17a61265.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let m,f,h,y=e=>e;class x extends(i(r)){constructor(){super(...arguments),this.data=[]}static get properties(){return{data:{type:Array}}}static get styles(){return[super.styles,t(m||(m=y`dd,dt{display:inline-block;overflow:hidden;vertical-align:top;overflow-wrap:anywhere}dt{min-width:calc(5 * var(--lumo-size-l));padding-right:.5em}dd{max-width:calc(15 * var(--lumo-size-l));min-width:calc(10 * var(--lumo-size-l))}`))]}render(){return a(f||(f=y` <dl class="space-y-s"> ${0} </dl> `),this.data.map((e=>{const s=String(e[1]).trim();return a(h||(h=y` <div> <dt class="text-secondary truncate">${0}</dt> <dd class="${0}">${0}</dd> </div> `),e[0],d({"text-tertiary":!s}),s||"–")})))}}let g,v,$=e=>e;const _=["_links","_embedded"],b=n(i(o(p)));class j extends b{static get scopedElements(){return{"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":x}}render(){if(this.in({idle:"snapshot"})){const s=this.data,{_links:r,_embedded:t}=s,i=e(s,_);try{const e=c(r.self.href);null!==e&&(i.id=e)}catch(e){}return a(g||(g=$` <x-data-list aria-live="polite" aria-busy="false" class="leading-s text-s" data="${0}"> </x-data-list> `),JSON.stringify(Array.from(Object.entries(i))))}const s=this.in("busy");return a(v||(v=$` <div aria-live="polite" aria-busy="${0}" data-testid="wrapper" class="flex justify-center"> <foxy-spinner data-testid="spinner" layout="horizontal" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> `),s,this.in("fail")?"error":s?"busy":"empty",this.lang,this.ns)}}let w,k,S,E,O,N,z,T,G,J,P,A=e=>e;const R=n(i(o(p)),"error-entry-card");class D extends R{constructor(){super(...arguments),this.open=!1}static get scopedElements(){return{"x-resource-viewer":j,"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":x,"iron-icon":customElements.get("iron-icon"),"foxy-i18n":customElements.get("foxy-i18n"),"x-group":l}}static get properties(){return s(s({},super.properties),{},{open:{type:Boolean,reflect:!0}})}render(){var e,s;const r=this.data,t=this.in("busy");if(r){const{hide_error:e}=r,{open:s}=this;return a(w||(w=A` <details aria-busy="${0}" aria-live="polite" class="text-body w-full" ?open="${0}" @toggle="${0}"> <summary class="rounded-s ring-offset-4 ring-offset-base ring-primary-50 focus-outline-none focus-ring-2"> <div style="padding-left:calc(var(--lumo-space-xs) + var(--lumo-space-s) - 1px)" class="${0}"> ${0} </div> </summary> ${0} </details> `),t,s,this.__handleToggle,d({"border-l-2 leading-s relative cursor-pointer":!0,"border-contrast":e&&!s,"border-primary":!e,"border-error":e&&s,"h-l":!s}),this.__renderSummary(r),s?this.__renderDetails(r):"")}return a(k||(k=A` <div aria-busy="${0}" aria-live="polite" style="padding-left:calc(var(--lumo-space-xs) + var(--lumo-space-s) - 1px)" class="flex items-center justify-center border-l-2 leading-s relative border-contrast-10 h-l"> <foxy-spinner data-testid="spinner" layout="horizontal" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> `),t,t?"busy":this.in("fail")?"error":"empty",this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}__renderGetOrPostValues(e,s){const r=new URLSearchParams(u(e||s));return a(S||(S=A` <div class="relative leading-xs pt-s"> <div class="absolute font-medium right-0 text-tertiary text-xs top-0 mt-s">${0}</div> <x-data-list data="${0}"></x-data-list> </div> `),e?"GET":"POST",JSON.stringify(Array.from(r.entries())))}__renderReferrer(e){return a(E||(E=A` <span class="text-secondary">Navigated from</span> <a target="_blank" class="font-medium text-primary hover-underline" href="${0}" rel="nofollow noopener noreferrer"> ${0} </a> `),e,e)}__renderSummary(e){return a(O||(O=A` <div class="text-s absolute right-0 top-0 text-tertiary"> <iron-icon icon="icons:expand-${0}"></iron-icon> </div> <div class="text-s mb-xs ${0}"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </div> <p class="${0} overflow-hidden font-medium"> ${0} </p> `),this.open?"less":"more",e.hide_error?"text-error":"text-primary",JSON.stringify({value:e.date_created}),this.lang,this.ns,JSON.stringify({value:e.date_created}),this.lang,this.ns,this.open?"":"truncate",e.error_message)}__renderDetails(e){return a(N||(N=A` <div class="space-y-m pt-m"> ${0} ${0} ${0} </div> `),e.referrer||e.get_values||e.post_values?a(z||(z=A` <x-group frame> <foxy-i18n slot="header" lang="${0}" key="request" ns="${0}"></foxy-i18n> <div class="mx-xs p-s text-s divide-y divide-contrast-10 space-y-s"> <p> <span class="block font-medium">${0}</span> ${0} </p> ${0} </div> </x-group> `),this.lang,this.ns,e.url,e.referrer?this.__renderReferrer(e.referrer):"",e.get_values||e.post_values?this.__renderGetOrPostValues(e.get_values,e.post_values):""):"",e.ip_address||e.ip_country||e.user_agent?a(T||(T=A` <x-group frame> <foxy-i18n slot="header" lang="${0}" key="client" ns="${0}"></foxy-i18n> <div class="text-s flex flex-col mx-xs p-s"> <span class="font-medium"> ${0} ${0} </span> ${0} </div> </x-group> `),this.lang,this.ns,e.ip_address,e.ip_country?a(G||(G=A`<span class="text-tertiary"> • </span>${0}`),e.ip_country):"",e.user_agent?a(J||(J=A`<span class="text-secondary">${0}</span>`),e.user_agent):""):"",Object.entries(e._links).map((([e,s])=>["self","fx:store","curies"].includes(e)?"":a(P||(P=A` <x-group frame> <foxy-i18n slot="header" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <x-resource-viewer class="p-s mx-xs" href="${0}" lang="${0}" ns="${0}"> </x-resource-viewer> </x-group> `),this.lang,e.substr(3),this.ns,s.href,this.lang,this.ns))))}__handleToggle(e){var s;const r=e.target;r.open&&!1===(null===(s=this.data)||void 0===s?void 0:s.hide_error)&&(this.edit({hide_error:!0}),this.submit()),this.open=r.open}}customElements.define("foxy-error-entry-card",D);export{D as ErrorEntryCard};
1
+ import{aH as e,_ as s}from"./shared-d1195c27.js";import{L as r,c as t,h as a}from"./shared-dc73b9a5.js";import{T as i,a as n,S as o}from"./shared-5e0b71a2.js";import{c as d}from"./shared-4e709717.js";import{G as l}from"./shared-363dce45.js";import"./foxy-nucleon-element.js";import{g as c}from"./shared-bab2ea2c.js";import{N as p}from"./shared-bb3c9e23.js";import{d as u}from"./shared-641786b2.js";import"./shared-67898669.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-17a61265.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let m,f,h,y=e=>e;class x extends(i(r)){constructor(){super(...arguments),this.data=[]}static get properties(){return{data:{type:Array}}}static get styles(){return[super.styles,t(m||(m=y`dd,dt{display:inline-block;overflow:hidden;vertical-align:top;overflow-wrap:anywhere}dt{min-width:calc(5 * var(--lumo-size-l));padding-right:.5em}dd{max-width:calc(15 * var(--lumo-size-l));min-width:calc(10 * var(--lumo-size-l))}`))]}render(){return a(f||(f=y` <dl class="space-y-s"> ${0} </dl> `),this.data.map((e=>{const s=String(e[1]).trim();return a(h||(h=y` <div> <dt class="text-secondary truncate">${0}</dt> <dd class="${0}">${0}</dd> </div> `),e[0],d({"text-tertiary":!s}),s||"–")})))}}let g,v,$=e=>e;const _=["_links","_embedded"],b=n(i(o(p)));class j extends b{static get scopedElements(){return{"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":x}}render(){if(this.in({idle:"snapshot"})){const s=this.data,{_links:r,_embedded:t}=s,i=e(s,_);try{const e=c(r.self.href);null!==e&&(i.id=e)}catch(e){}return a(g||(g=$` <x-data-list aria-live="polite" aria-busy="false" class="leading-s text-s" data="${0}"> </x-data-list> `),JSON.stringify(Array.from(Object.entries(i))))}const s=this.in("busy");return a(v||(v=$` <div aria-live="polite" aria-busy="${0}" data-testid="wrapper" class="flex justify-center"> <foxy-spinner data-testid="spinner" layout="horizontal" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> `),s,this.in("fail")?"error":s?"busy":"empty",this.lang,this.ns)}}let w,k,S,E,O,N,z,T,G,J,P,A=e=>e;const R=n(i(o(p)),"error-entry-card");class D extends R{constructor(){super(...arguments),this.open=!1}static get scopedElements(){return{"x-resource-viewer":j,"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":x,"iron-icon":customElements.get("iron-icon"),"foxy-i18n":customElements.get("foxy-i18n"),"x-group":l}}static get properties(){return s(s({},super.properties),{},{open:{type:Boolean,reflect:!0}})}render(){var e,s;const r=this.data,t=this.in("busy");if(r){const{hide_error:e}=r,{open:s}=this;return a(w||(w=A` <details aria-busy="${0}" aria-live="polite" class="text-body w-full" ?open="${0}" @toggle="${0}"> <summary class="rounded-s ring-offset-4 ring-offset-base ring-primary-50 focus-outline-none focus-ring-2"> <div style="padding-left:calc(var(--lumo-space-xs) + var(--lumo-space-s) - 1px)" class="${0}"> ${0} </div> </summary> ${0} </details> `),t,s,this.__handleToggle,d({"border-l-2 leading-s relative cursor-pointer":!0,"border-contrast":e&&!s,"border-primary":!e,"border-error":e&&s,"h-l":!s}),this.__renderSummary(r),s?this.__renderDetails(r):"")}return a(k||(k=A` <div aria-busy="${0}" aria-live="polite" style="padding-left:calc(var(--lumo-space-xs) + var(--lumo-space-s) - 1px)" class="flex items-center justify-center border-l-2 leading-s relative border-contrast-10 h-l"> <foxy-spinner data-testid="spinner" layout="horizontal" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> `),t,t?"busy":this.in("fail")?"error":"empty",this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}__renderGetOrPostValues(e,s){const r=new URLSearchParams(u(e||s));return a(S||(S=A` <div class="relative leading-xs pt-s"> <div class="absolute font-medium right-0 text-tertiary text-xs top-0 mt-s">${0}</div> <x-data-list data="${0}"></x-data-list> </div> `),e?"GET":"POST",JSON.stringify(Array.from(r.entries())))}__renderReferrer(e){return a(E||(E=A` <span class="text-secondary">Navigated from</span> <a target="_blank" class="font-medium text-primary hover-underline" href="${0}" rel="nofollow noopener noreferrer"> ${0} </a> `),e,e)}__renderSummary(e){return a(O||(O=A` <div class="text-s absolute right-0 top-0 text-tertiary"> <iron-icon icon="icons:expand-${0}"></iron-icon> </div> <div class="text-s mb-xs ${0}"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </div> <p class="${0} overflow-hidden font-medium"> ${0} </p> `),this.open?"less":"more",e.hide_error?"text-error":"text-primary",JSON.stringify({value:e.date_created}),this.lang,this.ns,JSON.stringify({value:e.date_created}),this.lang,this.ns,this.open?"":"truncate",e.error_message)}__renderDetails(e){return a(N||(N=A` <div class="space-y-m pt-m"> ${0} ${0} ${0} </div> `),e.referrer||e.get_values||e.post_values?a(z||(z=A` <x-group frame> <foxy-i18n slot="header" lang="${0}" key="request" ns="${0}"></foxy-i18n> <div class="mx-xs p-s text-s divide-y divide-contrast-10 space-y-s"> <p> <span class="block font-medium">${0}</span> ${0} </p> ${0} </div> </x-group> `),this.lang,this.ns,e.url,e.referrer?this.__renderReferrer(e.referrer):"",e.get_values||e.post_values?this.__renderGetOrPostValues(e.get_values,e.post_values):""):"",e.ip_address||e.ip_country||e.user_agent?a(T||(T=A` <x-group frame> <foxy-i18n slot="header" lang="${0}" key="client" ns="${0}"></foxy-i18n> <div class="text-s flex flex-col mx-xs p-s"> <span class="font-medium"> ${0} ${0} </span> ${0} </div> </x-group> `),this.lang,this.ns,e.ip_address,e.ip_country?a(G||(G=A`<span class="text-tertiary"> • </span>${0}`),e.ip_country):"",e.user_agent?a(J||(J=A`<span class="text-secondary">${0}</span>`),e.user_agent):""):"",Object.entries(e._links).map((([e,s])=>["self","fx:store","curies"].includes(e)?"":a(P||(P=A` <x-group frame> <foxy-i18n slot="header" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <x-resource-viewer class="p-s mx-xs" href="${0}" lang="${0}" ns="${0}"> </x-resource-viewer> </x-group> `),this.lang,e.substr(3),this.ns,s.href,this.lang,this.ns))))}__handleToggle(e){var s;const r=e.target;r.open&&!1===(null===(s=this.data)||void 0===s?void 0:s.hide_error)&&(this.edit({hide_error:!0}),this.submit()),this.open=r.open}}customElements.define("foxy-error-entry-card",D);export{D as ErrorEntryCard};
@@ -0,0 +1 @@
1
+ import"./shared-8af5a4f2.js";import"./shared-ebc72d69.js";import"./shared-504f3c65.js";import"./shared-44118acb.js";import"./shared-80688cd4.js";import"./shared-80a7903f.js";import"./shared-b0d76785.js";import{I as e,b as t}from"./shared-44fd89ce.js";import"./foxy-template-set-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./shared-57a98543.js";import"./shared-84761b5b.js";import"./shared-51fd39fa.js";import"./shared-7889f2f2.js";import"./shared-2cb3cb3a.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-a7617e76.js";import{I as r}from"./shared-238d397f.js";import{h as o,s as n}from"./shared-dc73b9a5.js";import{_ as i,B as a}from"./shared-d1195c27.js";import{a as s,R as l,w as d}from"./shared-5e0b71a2.js";import{i as u}from"./shared-9803aa7c.js";import{e as m,d as c}from"./shared-641786b2.js";import{c as p}from"./shared-4e709717.js";import"./shared-018166d0.js";import"./shared-b16829cd.js";import"./shared-cf0ca582.js";import"./foxy-form-dialog.js";import"./shared-27e2e59a.js";import"./shared-ffc84c84.js";import"./shared-67898669.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-cd96ff03.js";import"./shared-99940888.js";import"./shared-bab2ea2c.js";import"./shared-bb3c9e23.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-573d6e21.js";import"./shared-525c1936.js";import"./shared-4c4b87c2.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-c5cb7e8a.js";import"./shared-eb7bf7ba.js";import"./shared-6de0e9f3.js";import"./shared-8b838d83.js";import"./shared-e77d8d01.js";import"./shared-a585bfd3.js";import"./shared-651c44fa.js";import"./shared-28b0e29a.js";import"./shared-b04e9753.js";import"./shared-53caa399.js";import"./shared-d3a5cb85.js";import"./shared-b1fa0b61.js";import"./shared-51c4a6dd.js";import"./shared-31d8e958.js";import"./shared-9fcd36e5.js";import"./shared-c5326ab8.js";import"./shared-68fdcf24.js";import"./shared-112e521b.js";import"./shared-ec5b614e.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-1c4ddc9b.js";import"./shared-32440b17.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-8438d4ca.js";let f,y=e=>e;customElements.define("foxy-internal-experimental-add-to-cart-builder-custom-option-card",class extends r{renderBody(){var e,t;return o(f||(f=y` <div class="flex justify-between items-center h-xs"> <span class="font-medium">${0}&ZeroWidthSpace;</span> <span class="text-secondary">${0}&ZeroWidthSpace;</span> </div> `),null===(e=this.data)||void 0===e?void 0:e.name,null===(t=this.data)||void 0===t?void 0:t.value)}});let h,_=e=>e;const g=s(e,"internal-experimental-add-to-cart-builder-custom-option-form");customElements.define("foxy-internal-experimental-add-to-cart-builder-custom-option-form",class extends g{constructor(){super(...arguments),this.defaultWeightUnit=null,this.existingOptions=[],this.itemCategories=null,this.currencyCode=null}static get properties(){return i(i({},super.properties),{},{defaultWeightUnit:{attribute:"default-weight-unit"},existingOptions:{type:Array,attribute:"existing-options"},itemCategories:{attribute:"item-categories"},currencyCode:{attribute:"currency-code"}})}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.unshift("basics-group"),new a(e.join(" ").trim())}get disabledSelector(){const e=[super.disabledSelector.toString()];return!this.href&&this.existingOptions.some((e=>e.name===this.form.name))&&e.unshift("basics-group:value-configurable"),new a(e.join(" ").trim())}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.form.value_configurable&&e.unshift("price-group","weight-group","code-group","category-group"),new a(e.join(" ").trim())}renderBody(){var e,t,r,n;return o(h||(h=_` <foxy-internal-summary-control infer="basics-group"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> <foxy-internal-text-control property="value" layout="summary-item" infer="${0}"> </foxy-internal-text-control> <foxy-internal-switch-control infer="value-configurable"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="price-group"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="price"> </foxy-internal-number-control> <foxy-internal-switch-control infer="replace-price"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="weight-group"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="weight"> </foxy-internal-number-control> <foxy-internal-switch-control infer="replace-weight"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="code-group"> <foxy-internal-text-control layout="summary-item" infer="code"> </foxy-internal-text-control> <foxy-internal-switch-control infer="replace-code"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="category-group"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="item-category-uri" item="foxy-item-category-card"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> <foxy-nucleon infer="" class="hidden" href="${0}" id="itemCategoryLoader" @update="${0}"> </foxy-nucleon> `),this.form.value_configurable?"default-value":"value",u(null!==(e=this.currencyCode)&&void 0!==e?e:void 0),u(null!==(t=this.__resolvedDefaultWeightUnit)&&void 0!==t?t:void 0),u(null!==(r=this.itemCategories)&&void 0!==r?r:void 0),u(null!==(n=this.form.item_category_uri)&&void 0!==n?n:void 0),(()=>this.requestUpdate()))}async _sendPost(e){const t=this.existingOptions.filter((t=>t.name===e.name));if(t.some((e=>e.value_configurable)))throw["error:option_exists_configurable"];if(t.some((t=>t.value===e.value)))throw["error:option_exists"];return super._sendPost(e)}get __resolvedDefaultWeightUnit(){var e,t;const r=this.renderRoot.querySelector("#itemCategoryLoader");return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.default_weight_unit)&&void 0!==t?t:this.defaultWeightUnit}});let x,v,b,$,w,S,j,C,q,k,L,P,U,T,F,H,D=e=>e;customElements.define("foxy-internal-experimental-add-to-cart-builder-item-control",class extends t{constructor(){super(...arguments),this.defaultItemCategory=null,this.itemCategories=null,this.currencyCode=null,this.index=0}static get properties(){return i(i({},super.properties),{},{defaultItemCategory:{type:Object,attribute:"default-item-category"},itemCategories:{attribute:"item-categories"},currencyCode:{attribute:"currency-code"},index:{type:Number}})}renderControl(){var e,t,r,n,i,a,s,l,d;const m=this.__resolvedItemCategory,c=null==m?void 0:m.item_delivery_type,p=this.nucleon,f=this.index,y=null===(e=null==p?void 0:p.form.items)||void 0===e?void 0:e[f];return o(x||(x=D` <div class="space-y-m"> <foxy-internal-summary-control infer="basics-group"> <foxy-internal-text-control property="items.${0}.name" layout="summary-item" infer="name"> </foxy-internal-text-control> <foxy-internal-resource-picker-control property="items.${0}.item_category_uri" layout="summary-item" first="${0}" infer="item-category-uri" item="foxy-item-category-card"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="price-group"> <foxy-internal-number-control property="items.${0}.price" layout="summary-item" suffix="${0}" infer="${0}"> </foxy-internal-number-control> <foxy-internal-switch-control property="items.${0}.price_configurable" layout="summary-item" infer="price-configurable"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="code-group"> <foxy-internal-text-control property="items.${0}.code" layout="summary-item" infer="code"> </foxy-internal-text-control> <foxy-internal-text-control property="items.${0}.parent_code" layout="summary-item" infer="parent-code"> </foxy-internal-text-control> </foxy-internal-summary-control> ${0} <foxy-internal-summary-control infer="subscriptions-group"> <foxy-internal-switch-control property="items.${0}.sub_enabled" layout="summary-item" infer="sub-enabled"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="quantity-group" layout="details"> <foxy-internal-number-control property="items.${0}.quantity" layout="summary-item" infer="quantity" step="1" min="1"> </foxy-internal-number-control> ${0} <foxy-internal-switch-control property="items.${0}.hide_quantity" infer="hide-quantity"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="advanced-group" layout="details"> <foxy-internal-text-control property="items.${0}.discount_name" layout="summary-item" infer="discount-name"> </foxy-internal-text-control> ${0} <foxy-internal-text-control property="items.${0}.image" layout="summary-item" infer="image"> </foxy-internal-text-control> ${0} <foxy-internal-select-control property="items.${0}.expires_format" layout="summary-item" infer="expires-format" .options="${0}"> </foxy-internal-select-control> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-async-list-control first="foxy://${0}/form/items/${0}/custom_options" infer="custom-options" form="foxy-internal-experimental-add-to-cart-builder-custom-option-form" item="foxy-internal-experimental-add-to-cart-builder-custom-option-card" alert .formProps="${0}"> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="itemCategoryLoader" @update="${0}"> </foxy-nucleon> </div> `),f,f,u(null!==(t=this.itemCategories)&&void 0!==t?t:void 0),f,u(null!==(r=this.currencyCode)&&void 0!==r?r:void 0),(null==y?void 0:y.price_configurable)?"price-default":"price",f,f,f,"notshipped"===c||"downloaded"===c?"":o(v||(v=D` <foxy-internal-summary-control infer="appearance-group"> <foxy-internal-number-control placeholder="${0}" property="items.${0}.weight" layout="summary-item" suffix="${0}" infer="weight" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> `),u(null==m?void 0:m.default_weight),f,u(null==m?void 0:m.default_weight_unit)),f,(null==y?void 0:y.sub_enabled)?o(b||(b=D` <foxy-internal-frequency-control property="items.${0}.sub_frequency" layout="summary-item" infer="sub-frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-select-control property="items.${0}.sub_startdate_format" layout="summary-item" infer="sub-startdate-format" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-select-control property="items.${0}.sub_enddate_format" layout="summary-item" infer="sub-enddate-format" .options="${0}"> </foxy-internal-select-control> ${0} `),f,f,[{label:"option_none",value:"none"},{label:"option_yyyymmdd",value:"yyyymmdd"},{label:"option_dd",value:"dd"},{label:"option_duration",value:"duration"}],"yyyymmdd"===y.sub_startdate_format?o($||($=D` <foxy-internal-date-control property="items.${0}.sub_startdate" layout="summary-item" infer="sub-startdate-yyyymmdd"> </foxy-internal-date-control> `),f):"duration"===y.sub_startdate_format?o(w||(w=D` <foxy-internal-frequency-control property="items.${0}.sub_startdate" layout="summary-item" infer="sub-startdate-duration"> </foxy-internal-frequency-control> `),f):"dd"===y.sub_startdate_format?o(S||(S=D` <foxy-internal-number-control property="items.${0}.sub_startdate" layout="summary-item" infer="sub-startdate-dd" step="1" min="1" max="31"> </foxy-internal-number-control> `),f):"",f,[{label:"option_none",value:"none"},{label:"option_yyyymmdd",value:"yyyymmdd"},{label:"option_duration",value:"duration"}],"yyyymmdd"===y.sub_enddate_format?o(j||(j=D` <foxy-internal-date-control property="items.${0}.sub_enddate" layout="summary-item" infer="sub-enddate-yyyymmdd"> </foxy-internal-date-control> `),f):"duration"===y.sub_enddate_format?o(C||(C=D` <foxy-internal-frequency-control property="items.${0}.sub_enddate" layout="summary-item" infer="sub-enddate-duration"> </foxy-internal-frequency-control> `),f):""):"",f,"minutes"===(null==y?void 0:y.expires_format)?"":o(q||(q=D` <foxy-internal-number-control property="items.${0}.quantity_min" layout="summary-item" infer="quantity-min" step="1" min="1"> </foxy-internal-number-control> <foxy-internal-number-control property="items.${0}.quantity_max" layout="summary-item" infer="quantity-max" step="1" min="1"> </foxy-internal-number-control> `),f,f),f,f,(null==y?void 0:y.discount_name)?o(k||(k=D` <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> `),{details:null!==(n=null==y?void 0:y.discount_details)&&void 0!==n?n:"",type:null!==(i=null==y?void 0:y.discount_type)&&void 0!==i?i:"amount_percentage",name:null!==(a=null==y?void 0:y.discount_name)&&void 0!==a?a:""},(e=>{this.__handleDiscountBuilderChange(e,y,f)})):"",f,(null==y?void 0:y.image)?o(L||(L=D` <foxy-internal-text-control property="items.${0}.url" layout="summary-item" infer="url"> </foxy-internal-text-control> `),f):"",f,[{label:"option_none",value:"none"},{label:"option_minutes",value:"minutes"},{label:"option_timestamp",value:"timestamp"}],"minutes"===(null==y?void 0:y.expires_format)?o(P||(P=D` <foxy-internal-number-control property="items.${0}.expires_value" layout="summary-item" suffix="min" infer="expires-value-minutes"> </foxy-internal-number-control> `),f):"timestamp"===(null==y?void 0:y.expires_format)?o(U||(U=D` <foxy-internal-date-control property="items.${0}.expires_value" layout="summary-item" format="unix" infer="expires-value-timestamp"> </foxy-internal-date-control> `),f):"","notshipped"===c||"downloaded"===c?"":o(T||(T=D` <foxy-internal-number-control property="items.${0}.length" layout="summary-item" suffix="${0}" infer="length" min="0"> </foxy-internal-number-control> <foxy-internal-number-control property="items.${0}.width" layout="summary-item" suffix="${0}" infer="width" min="0"> </foxy-internal-number-control> <foxy-internal-number-control property="items.${0}.height" layout="summary-item" suffix="${0}" infer="height" min="0"> </foxy-internal-number-control> `),f,u(null==m?void 0:m.default_length_unit),f,u(null==m?void 0:m.default_length_unit),f,u(null==m?void 0:m.default_length_unit)),null==p?void 0:p.virtualHost,f,{".defaultWeightUnit":null==m?void 0:m.default_weight_unit,".existingOptions":null!==(s=null==y?void 0:y.custom_options)&&void 0!==s?s:[],".itemCategories":this.itemCategories,".currencyCode":this.currencyCode},(null!==(d=null===(l=null==p?void 0:p.form.items)||void 0===l?void 0:l.length)&&void 0!==d?d:0)<=1?o(F||(F=D``)):o(H||(H=D` <vaadin-button theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="delete" key="caption"></foxy-i18n> </vaadin-button> `),this.disabled,(()=>this.dispatchEvent(new CustomEvent("remove")))),u(null==y?void 0:y.item_category_uri),(()=>this.requestUpdate()))}get __resolvedItemCategory(){var e,t;return null!==(t=null===(e=this.__itemCategoryLoader)||void 0===e?void 0:e.data)&&void 0!==t?t:this.defaultItemCategory}get __itemCategoryLoader(){return this.renderRoot.querySelector("#itemCategoryLoader")}__handleDiscountBuilderChange(e,t,r){var o;const n=e.currentTarget,i=this.nucleon;t.discount_details=n.parsedValue.details,t.discount_type=n.parsedValue.type,t.discount_name=n.parsedValue.name;const a=null!==(o=null==i?void 0:i.form.items)&&void 0!==o?o:[];a.splice(r,1,t),null==i||i.edit({items:[...a]})}});let M,I,O,A,E,z,R,W,B,N,Z=e=>e;const V=l(s(e,"experimental-add-to-cart-builder"));class Y extends V{constructor(){var e;super(...arguments),e=this,this.defaultDomain=null,this.encodeHelper=null,this.localeCodes=null,this.store=null,this.__signingSeparator=`--${Date.now()}${(1e5*Math.random()).toFixed(0)}--`,this.__emptyOptions=[{label:"option_false",value:"false"},{label:"option_true",value:"true"},{label:"option_reset",value:"reset"}],this.__cartOptions=[{label:"option_add",value:"add"},{label:"option_checkout",value:"checkout"},{label:"option_redirect",value:"redirect"}],this.__signAsync=d((async function(t,r){if(t===e.__previousUnsignedCode&&e.__previousSignedCode)return;const o=()=>t!==e.__previousUnsignedCode;e.__signingState="busy";try{const n=await new Y.API(e).fetch(r,{headers:{"Content-Type":"text/plain"},method:"POST",body:t});if(!o())if(n.ok){const t=(await n.json()).result;o()||(e.__signingState="idle",e.__previousSignedCode=t.replace(/value="--OPEN--" data-replace/gi,"value"))}else e.__signingState="fail"}catch(t){o()||(e.__signingState="fail")}}),500),this.__previousUnsignedCode="",this.__previousSignedCode="",this.__signingState="idle",this.__openState=[]}static get properties(){return i(i({},super.properties),{},{defaultDomain:{attribute:"default-domain"},encodeHelper:{attribute:"encode-helper"},localeCodes:{attribute:"locale-codes"},store:{},__previousUnsignedCode:{attribute:!1},__previousSignedCode:{attribute:!1},__signingState:{attribute:!1},__openState:{attribute:!1}})}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return e.unshift("header:copy-id","header:copy-json","undo"),new a(e.join(" ").trim())}renderBody(){var e,t,r,i,a,s,l,d,m,c,f,y,h;const _=this.__getAddToCartCode(),g=null!==(r=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"].href)&&void 0!==t?t:this.store)&&void 0!==r?r:void 0,x=null===(i=this.__storeLoader)||void 0===i?void 0:i.data;return o(M||(M=Z` <div class="grid gap-m items-start sm-grid-cols-2 md-grid-cols-3 h-full overflow-auto"> <foxy-internal-summary-control layout="section" class="space-y-s" infer="items"> ${0} <vaadin-button class="w-full" theme="success" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="add-product" key="caption"></foxy-i18n> </vaadin-button> </foxy-internal-summary-control> <div class="space-y-m md-col-span-2 sticky top-0"> ${0} <foxy-internal-summary-control infer="cart-settings"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="template-set-uri" item="foxy-template-set-card"> </foxy-internal-resource-picker-control> <foxy-internal-select-control layout="summary-item" infer="empty" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control layout="summary-item" infer="cart" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control layout="summary-item" infer="coupon"> </foxy-internal-text-control> </foxy-internal-summary-control> </div> </div> <foxy-nucleon class="hidden" infer="" href="${0}" id="defaultTemplateSetLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="defaultItemCategoryLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="localeCodesHelperLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="templateSetLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoaderId" @update="${0}"> </foxy-nucleon> ${0} `),null===(a=this.form.items)||void 0===a?void 0:a.map(((e,t)=>{var r;return o(I||(I=Z` <foxy-internal-summary-control layout="details" label="${0}" infer="item-group" ?open="${0}" @toggle="${0}"> <foxy-internal-experimental-add-to-cart-builder-item-control item-categories="${0}" currency-code="${0}" store="${0}" index="${0}" infer="item" .defaultItemCategory="${0}" @remove="${0}"> </foxy-internal-experimental-add-to-cart-builder-item-control> </foxy-internal-summary-control> `),u(e.name.trim()||void 0),u(this.__openState[t]),(e=>{const r=e.currentTarget;this.__openState[t]=r.open,this.__openState=[...this.__openState]}),u(null==x?void 0:x._links["fx:item_categories"].href),u(null!==(r=this.__resolvedCurrencyCode)&&void 0!==r?r:void 0),u(g),t,this.__defaultItemCategory,(()=>{var e;const r=null===(e=this.form.items)||void 0===e?void 0:e.filter(((e,r)=>r!==t));this.edit({items:r}),this.__openState=this.__openState.filter(((e,r)=>r!==t))}))})),this.disabled,(()=>{var e;const t=null!==(e=this.form.items)&&void 0!==e?e:[];this.edit({items:[...t,{name:"",price:0,custom_options:[],sub_frequency:"1m"}]}),this.__openState=[...new Array(t.length).fill(!1),!0]}),_?o(O||(O=Z` <foxy-internal-summary-control infer="preview"> <div class="flex"> <iframe srcdoc="${0}${0}" style="margin:calc(-1 * (.625em + (var(--lumo-border-radius)/ 4) - 1px))" class="${0}" @load="${0}"> </iframe> </div> <div class="flex leading-s text-s min-w-0 relative" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <div style="font-family:monospace;max-height:calc(8 * (1em * var(--lumo-line-height-s)))" class="${0}"> <code class="whitespace-pre">${0}</code> </div> <div style="top:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);right:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" class="${0}"> <div class="bg-contrast-10 rounded-s"> <foxy-spinner infer="spinner" class="-mx-xs" style="transform:scale(.8)"> </foxy-spinner> </div> </div> <foxy-copy-to-clipboard infer="copy-to-clipboard" text="${0}" class="${0}"> </foxy-copy-to-clipboard> </div> <div class="flex items-start text-xs leading-xs text-secondary" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="edits_tip"></foxy-i18n> <a target="_blank" class="rounded font-medium underline transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://wiki.foxycart.com/v/2.0/products"> <foxy-i18n infer="" key="edits_docs"></foxy-i18n> </a> </p> </div> </foxy-internal-summary-control> <foxy-internal-summary-control infer="link"> ${0} </foxy-internal-summary-control> `),'\n <style>\n html {\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n }\n\n body {\n margin: 0;\n }\n\n button,\n input,\n optgroup,\n select,\n textarea {\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n margin: 0;\n }\n\n button,\n input {\n overflow: visible;\n }\n\n button,\n select {\n text-transform: none;\n }\n\n button,\n [type="button"],\n [type="reset"],\n [type="submit"] {\n -webkit-appearance: button;\n }\n\n button::-moz-focus-inner,\n [type="button"]::-moz-focus-inner,\n [type="reset"]::-moz-focus-inner,\n [type="submit"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n }\n\n button:-moz-focusring,\n [type="button"]:-moz-focusring,\n [type="reset"]:-moz-focusring,\n [type="submit"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n }\n\n fieldset {\n padding: 0.35em 0.75em 0.625em;\n }\n\n legend {\n box-sizing: border-box;\n color: inherit;\n display: table;\n max-width: 100%;\n padding: 0;\n white-space: normal;\n }\n\n textarea {\n overflow: auto;\n }\n\n [type="checkbox"],\n [type="radio"] {\n box-sizing: border-box;\n padding: 0;\n }\n\n [type="number"]::-webkit-inner-spin-button,\n [type="number"]::-webkit-outer-spin-button {\n height: auto;\n }\n\n [type="search"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n }\n\n [type="search"]::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n }\n\n [hidden] {\n display: none;\n }\n\n html {\n color-scheme: light dark !important;\n }\n\n body {\n display: flex;\n padding: 2rem;\n }\n\n form {\n flex: 1;\n max-width: 20rem;\n font: normal 0.875rem system-ui;\n display: grid;\n grid-template-columns: auto 1fr;\n grid-gap: 0.5rem;\n align-items: center;\n margin: auto;\n }\n\n form:has(fieldset) {\n grid-gap: 1rem;\n }\n\n fieldset {\n display: grid;\n grid-template-columns: auto 1fr;\n grid-gap: 0.5rem;\n grid-column: 1 / span 2;\n align-items: center;\n margin: 0;\n }\n\n legend {\n white-space: nowrap;\n }\n\n button {\n grid-column: 1 / span 2;\n margin-top: 0.5rem;\n }\n\n form:has(fieldset) button {\n margin-top: 0;\n }\n\n label {\n display: contents;\n }\n </style>\n',_.formHTML,p({"flex-1 transition-all filter":!0,"blur-sm":"idle"!==this.__signingState}),(e=>{var t;const r=e.currentTarget,o=null===(t=r.contentWindow)||void 0===t?void 0:t.document.documentElement;o&&(r.style.height=o.scrollHeight+"px")}),p({"break-all overflow-auto flex-1 min-w-0 transition-all filter":!0,"blur-sm":"idle"!==this.__signingState}),_.formHTML,p({"absolute right-0 bg-base rounded-s transition-opacity":!0,"opacity-0 pointer-events-none":"busy"!==this.__signingState}),_.formHTML,p({"flex-shrink-0 text-m transition-opacity":!0,"opacity-0 pointer-events-none":"busy"===this.__signingState}),n(A||(A=Z`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-contrast-70" style="width: 1.25em"><path fill-rule="evenodd" d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z" clip-rule="evenodd" /></svg>`)),_.linkHref?o(E||(E=Z` <div class="flex items-center leading-s min-w-0 relative" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="" key="direct_link"></foxy-i18n> <a target="_blank" style="max-width:30rem" href="${0}" class="${0}"> ${0} </a> <div style="top:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);right:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" class="${0}"> <div class="bg-contrast-10 rounded-s"> <foxy-spinner infer="spinner" state="${0}" class="-mx-xs" style="transform:scale(.8)"> </foxy-spinner> </div> </div> <foxy-copy-to-clipboard infer="copy-to-clipboard" text="${0}" class="${0}"> </foxy-copy-to-clipboard> </div> `),_.linkHref,p({"font-medium truncate ml-auto min-w-0 rounded-s":!0,"transition-all filter":!0,"hover-underline":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"blur-sm":"idle"!==this.__signingState}),_.linkHref,p({"absolute right-0 bg-base rounded-s transition-opacity":!0,"opacity-0 pointer-events-none":"busy"!==this.__signingState}),"fail"===this.__signingState?"error":"busy",_.linkHref,p({"flex-shrink-0 text-m transition-opacity":!0,"opacity-0 pointer-events-none":"busy"===this.__signingState})):o(z||(z=Z` <p class="text-disabled"> <foxy-i18n infer="" key="unavailable"></foxy-i18n> </p> `))):o(R||(R=Z` <foxy-internal-summary-control infer="preview"> <div class="flex items-center justify-center p-xl"> <foxy-spinner infer="unavailable"></foxy-spinner> </div> </foxy-internal-summary-control> `)),u(null===(l=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===l?void 0:l._links["fx:template_sets"].href),this.__emptyOptions,this.__cartOptions,"redirect"===this.form.cart?o(W||(W=Z` <foxy-internal-text-control layout="summary-item" infer="redirect"> </foxy-internal-text-control> `)):"",u(this.__defaultTemplateSetHref),(()=>this.requestUpdate()),u(this.__defaultItemCategoryHref),(()=>this.requestUpdate()),u(null!==(d=this.localeCodes)&&void 0!==d?d:void 0),(()=>this.requestUpdate()),u(null!==(m=this.form.template_set_uri)&&void 0!==m?m:void 0),(()=>this.requestUpdate()),u(null!==(y=null!==(f=null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href)&&void 0!==f?f:this.store)&&void 0!==y?y:void 0),(()=>this.requestUpdate()),null===(h=this.form.items)||void 0===h?void 0:h.map(((e,t)=>{var r;return o(B||(B=Z` <foxy-nucleon class="hidden" infer="" href="${0}" id="itemCategoryLoaderProduct${0}" @update="${0}"> </foxy-nucleon> ${0} `),u(null!==(r=e.item_category_uri)&&void 0!==r?r:void 0),t,(()=>this.requestUpdate()),e.custom_options.map(((e,r)=>{var n;return o(N||(N=Z` <foxy-nucleon class="hidden" infer="" href="${0}" id="itemCategoryLoaderProduct${0}Option${0}" @update="${0}"> </foxy-nucleon> `),u(null!==(n=e.item_category_uri)&&void 0!==n?n:void 0),t,r,(()=>this.requestUpdate()))})))})))}updated(e){var t,r;super.updated(e),this.in("idle")&&!(null===(t=this.form.items)||void 0===t?void 0:t.length)&&(this.edit({items:[{name:"",price:0,sub_frequency:"1m",custom_options:[]}]}),this.__openState=[!0]),(null===(r=this.form.items)||void 0===r?void 0:r.length)&&!this.__openState.length&&(this.__openState=[!0,...new Array(this.form.items.length-1).fill(!1)])}submit(){}get __defaultTemplateSetHref(){var e,t,r;try{const o=new URL(null!==(r=null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==r?r:"");return o.searchParams.set("code","DEFAULT"),o.toString()}catch(e){return}}get __defaultItemCategoryHref(){var e,t,r;try{const o=new URL(null!==(r=null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:item_categories"].href)&&void 0!==r?r:"");return o.searchParams.set("code","DEFAULT"),o.toString()}catch(e){return}}get __resolvedCurrencyCode(){var e,t,r,o;const n=this.renderRoot.querySelector("#localeCodesHelperLoader"),i=null===(e=this.__resolvedTemplateSet)||void 0===e?void 0:e.locale_code,a=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.values,s=i?null==a?void 0:a[i]:void 0;return s?null===(o=null===(r=/Currency: ([A-Z]{3})/g.exec(s))||void 0===r?void 0:r[1])||void 0===o?void 0:o.toUpperCase():void 0}get __resolvedTemplateSet(){var e,t,r,o;const n=e=>this.renderRoot.querySelector(e);return null!==(t=null===(e=n("#templateSetLoader"))||void 0===e?void 0:e.data)&&void 0!==t?t:null===(o=null===(r=n("#defaultTemplateSetLoader"))||void 0===r?void 0:r.data)||void 0===o?void 0:o._embedded["fx:template_sets"][0]}get __defaultItemCategory(){var e,t;return null===(t=null===(e=this.renderRoot.querySelector("#defaultItemCategoryLoader"))||void 0===e?void 0:e.data)||void 0===t?void 0:t._embedded["fx:item_categories"][0]}get __resolvedCartUrl(){var e;const t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data;if(t){if(t.use_remote_domain)return`https://${t.store_domain}/cart`;if(null!==this.defaultDomain)return`https://${t.store_domain}.${this.defaultDomain}/cart`}return null}get __storeLoader(){return this.renderRoot.querySelector("#storeLoaderId")}__getItemCategoryLoader(e,t){const r=`#itemCategoryLoaderProduct${e}`,o="number"==typeof t?`${r}Option${t}`:r;return this.renderRoot.querySelector(o)}__getAddToCartFormHTML(){var e,t,r,o,n,i,a,s,l;const d=this.__resolvedCurrencyCode,u=this.__resolvedTemplateSet,c=this.__resolvedCartUrl,p=null===(e=this.__storeLoader)||void 0===e?void 0:e.data;if(!(this.defaultDomain&&u&&p&&d&&c))return"";let f=!1,y=`<form action="${m(c)}" method="post" target="_blank">`,h=1;const _=()=>`\n${" ".repeat(2*h)}`,g=(e,t)=>{const r=m(t),o=m(e);y+=`${_()}<input type="hidden" name="${o}" value="${r}">`};"DEFAULT"!==u.code&&g("template_set",u.code),this.form.empty&&"false"!==this.form.empty&&g("empty",this.form.empty),"checkout"===this.form.cart&&g("cart","checkout"),this.form.redirect&&g("redirect",this.form.redirect),this.form.coupon&&g("coupon",this.form.coupon);const x=null!==(t=this.form.items)&&void 0!==t?t:[],v=x.length>1;for(let e=0;e<x.length;++e){const t=this.__getItemCategoryLoader(e),u=null==t?void 0:t.data,c=x[e];if(c.item_category_uri&&!u)return"";const b=Math.max(1,null!==(r=c.quantity_min)&&void 0!==r?r:1),$=Math.max(b,null!==(o=c.quantity_max)&&void 0!==o?o:1/0),w=b!==$&&"minutes"!==c.expires_format&&!c.hide_quantity,S=c.price_configurable,j=c.custom_options.some(((e,t,r)=>e.value_configurable||r.findIndex((t=>t.name===e.name))!==t)),C=c.name.trim()||this.t("items.item-group.item.basics-group.name.placeholder"),q=f||v&&(S||w||j);q&&(f=!0,y+=`${_()}<fieldset>`,h++,y+=`${_()}<legend>${m(C)}</legend>`);const k=0===e?"":`${e+1}:`;g(`${k}name`,C);const L=`${c.price}${d}`;if(c.price_configurable){const e=m(c.price.toFixed(2));y+=`${_()}<label>`,h++,y+=`${_()}<span>${m(this.t("preview.price_label"))}</span>`,p.use_cart_validation?y+=`${_()}<input required name="${k}price" value="--OPEN--" data-replace="${e}">`:y+=`${_()}<input required name="${k}price" value="${e}">`,h--,y+=`${_()}</label>`}else g(`${k}price`,L);if(u&&"DEFAULT"!==u.code&&g(`${k}category`,u.code),c.code&&g(`${k}code`,c.code),c.parent_code&&g(`${k}parent_code`,c.parent_code),c.image&&(g(`${k}image`,c.image),c.url&&g(`${k}url`,c.url)),c.sub_enabled&&c.sub_frequency){if(g(`${k}sub_frequency`,c.sub_frequency),c.sub_startdate)if("yyyymmdd"===c.sub_startdate_format){const e=new Date(c.sub_startdate);g(`${k}sub_startdate`,`${e.getFullYear()}${(e.getMonth()+1).toString().padStart(2,"0")}${e.getDate().toString().padStart(2,"0")}`)}else g(`${k}sub_startdate`,String(c.sub_startdate));if(c.sub_enddate)if("yyyymmdd"===c.sub_enddate_format){const e=new Date(c.sub_enddate);g(`${k}sub_enddate`,`${e.getFullYear()}${(e.getMonth()+1).toString().padStart(2,"0")}${e.getDate().toString().padStart(2,"0")}`)}else g(`${k}sub_enddate`,String(c.sub_enddate))}c.discount_name&&c.discount_type&&c.discount_details&&g(`${k}discount_${c.discount_type}`,`${c.discount_name}{${c.discount_details}}`),c.expires_value&&(c.expires_format,g(`${k}expires`,c.expires_value.toFixed(0))),w?(y+=`${_()}<label>`,h++,y+=`${_()}<span>${m(this.t("preview.quantity_label"))}</span>`,y+=`${_()}<input type="number" name="${m(`${k}quantity`)}"`,y+=` min="${m(String(b))}"`,$!==1/0&&(y+=` max="${m(String($))}"`),p.use_cart_validation?y+=` value="--OPEN--" data-replace="${m(String(null!==(n=c.quantity)&&void 0!==n?n:1))}">`:y+=` value="${m(String(null!==(i=c.quantity)&&void 0!==i?i:1))}">`,h--,y+=`${_()}</label>`):(null!==(a=c.quantity)&&void 0!==a?a:1)>1&&g(`${k}quantity`,(null!==(s=c.quantity)&&void 0!==s?s:1).toString()),"minutes"!==c.expires_format&&(1!==b&&g(`${k}quantity_min`,b.toFixed(0)),$!==1/0&&g(`${k}quantity_max`,$.toFixed(0))),c.length&&g(`${k}length`,c.length.toFixed(3)),c.width&&g(`${k}width`,c.width.toFixed(3)),c.height&&g(`${k}height`,c.height.toFixed(3)),c.weight&&g(`${k}weight`,c.weight.toFixed(3)),p.features_multiship&&(y+=`${_()}<label>`,h++,y+=`${_()}<span>${m(this.t("preview.shipto_label"))}</span>`,p.use_cart_validation?y+=`${_()}<input name="${k}shipto" value="--OPEN--" data-replace="">`:y+=`${_()}<input name="${k}shipto" value="">`,h--,y+=`${_()}</label>`);const P=c.custom_options.reduce(((e,t)=>(e[t.name]||(e[t.name]=[]),e[t.name].push(t),e)),{});for(const t in P){const r=P[t];if(1===r.length){const o=c.custom_options.indexOf(r[0]),n=null===(l=this.__getItemCategoryLoader(e,o))||void 0===l?void 0:l.data,i=this.__getOptionModifiers(r[0],null!=n?n:null,d),a=`${r[0].value}${i}`,s=`${k}${t}`;r[0].value_configurable?(y+=`${_()}<label>`,h++,y+=`${_()}<span>${m(t)}:</span>`,y+=`${_()}<input name="${m(s)}" `,p.use_cart_validation?y+=`value="--OPEN--" data-replace="${m(a)}">`:y+=`value="${m(a)}">`,h--,y+=`${_()}</label>`):g(s,a)}else y+=`${_()}<label>`,h++,y+=`${_()}<span>${m(t)}:</span>`,y+=`${_()}<select name="${k}${t}">`,h++,r.forEach((t=>{var r;const o=c.custom_options.indexOf(t),n=null===(r=this.__getItemCategoryLoader(e,o))||void 0===r?void 0:r.data,i=this.__getOptionModifiers(t,null!=n?n:null,d),a=m(`${t.value}${i}`),s=m(t.value);y+=`${_()}<option value="${a}">${s}</option>`})),h--,y+=`${_()}</select>`,h--,y+=`${_()}</label>`}q&&(h--,y+=`${_()}</fieldset>`)}const b=m(this.t("preview.submit_caption"));return y+=`${_()}<button type="submit">${b}</button>`,h--,y+=`${_()}</form>`,y}__getAddToCartLinkHref(){var e,t,r,o,n,i,a,s;const l=this.__resolvedCurrencyCode,d=this.__resolvedTemplateSet,u=this.__resolvedCartUrl,m=null===(e=this.__storeLoader)||void 0===e?void 0:e.data;if(!(this.defaultDomain&&d&&m&&l&&u))return"";const c=new URL(u);"DEFAULT"!==d.code&&c.searchParams.set("template_set",d.code),"checkout"===this.form.cart&&c.searchParams.set("cart","checkout"),this.form.redirect&&c.searchParams.set("redirect",this.form.redirect),this.form.coupon&&c.searchParams.set("coupon",this.form.coupon),this.form.empty&&"false"!==this.form.empty&&c.searchParams.set("empty",this.form.empty);for(let e=0;e<(null!==(r=null===(t=this.form.items)||void 0===t?void 0:t.length)&&void 0!==r?r:0);++e){const t=this.form.items[e],r=0===e?"":`${e+1}:`,d=null===(o=this.__getItemCategoryLoader(e))||void 0===o?void 0:o.data;if(t.item_category_uri&&!d)return"";if(t.price_configurable)return"";if(new Set(t.custom_options.map((e=>e.name))).size<t.custom_options.length)return"";if(d&&"DEFAULT"!==d.code&&c.searchParams.set(`${r}category`,d.code),c.searchParams.set(`${r}name`,t.name),c.searchParams.set(`${r}price`,`${t.price}${l}`),t.code&&c.searchParams.set(`${r}code`,t.code),t.parent_code&&c.searchParams.set(`${r}parent_code`,t.parent_code),t.image&&(c.searchParams.set(`${r}image`,t.image),t.url&&c.searchParams.set(`${r}url`,t.url)),t.sub_enabled&&t.sub_frequency){if(c.searchParams.set(`${r}sub_frequency`,t.sub_frequency),t.sub_startdate)if("yyyymmdd"===t.sub_startdate_format){const e=new Date(t.sub_startdate),o=e.getFullYear(),n=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0");c.searchParams.set(`${r}sub_startdate`,`${o}${n}${i}`)}else c.searchParams.set(`${r}sub_startdate`,String(t.sub_startdate));if(t.sub_enddate)if("yyyymmdd"===t.sub_enddate_format){const e=new Date(t.sub_enddate),o=e.getFullYear(),n=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0");c.searchParams.set(`${r}sub_enddate`,`${o}${n}${i}`)}else c.searchParams.set(`${r}sub_enddate`,String(t.sub_enddate))}t.discount_name&&t.discount_type&&t.discount_details&&c.searchParams.set(`${r}discount_${t.discount_type}`,`${t.discount_name}{${t.discount_details}}`),t.expires_value&&(t.expires_format,c.searchParams.set(`${r}expires`,t.expires_value.toFixed(0))),(null!==(n=t.quantity)&&void 0!==n?n:1)>1&&c.searchParams.set(`${r}quantity`,(null!==(i=t.quantity)&&void 0!==i?i:1).toFixed(0)),"minutes"!==t.expires_format&&(t.quantity_min&&c.searchParams.set(`${r}quantity_min`,t.quantity_min.toString()),t.quantity_max&&c.searchParams.set(`${r}quantity_max`,t.quantity_max.toString())),t.weight&&c.searchParams.set(`${r}weight`,t.weight.toFixed(3)),t.length&&c.searchParams.set(`${r}length`,t.length.toFixed(3)),t.width&&c.searchParams.set(`${r}width`,t.width.toFixed(3)),t.height&&c.searchParams.set(`${r}height`,t.height.toFixed(3));for(let o=0;o<t.custom_options.length;++o){const n=t.custom_options[o];if(n.value_configurable)return"";const i=null===(a=this.__getItemCategoryLoader(e,o))||void 0===a?void 0:a.data,d=this.__getOptionModifiers(n,null!=i?i:null,l);c.searchParams.set(`${r}${n.name}`,`${null!==(s=n.value)&&void 0!==s?s:""}${d}`)}}return c.toString()}__getAddToCartCode(){var e;const t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data;if(!this.encodeHelper||!t)return null;const r=this.__getAddToCartFormHTML(),o=this.__getAddToCartLinkHref();if(!r&&!o)return null;let n;if(o){const e=`<a href="${m(o)}">Add to cart</a>`;n=`${r}${this.__signingSeparator}${e}`}else n=r;if(n===this.__previousUnsignedCode&&this.__previousSignedCode){const[e,t]=this.__previousSignedCode.split(this.__signingSeparator);return{linkHref:t?c(t.substring(9,t.length-17)):"",formHTML:e}}return this.__previousUnsignedCode=n,this.__previousSignedCode="",t.use_cart_validation&&this.__signAsync(n,this.encodeHelper),{formHTML:r,linkHref:o}}__getOptionModifiers(e,t,r){if(e.value_configurable)return"";const o=[];if(e.price){const t=e.replace_price?":":-1===Math.sign(e.price)?"-":"+";(e.replace_price||0!==e.price)&&o.push(`p${t}${Math.abs(e.price)}${r}`)}if(e.weight){const t=e.replace_weight?":":-1===Math.sign(e.weight)?"-":"+";(e.replace_weight||0!==e.weight)&&o.push(`w${t}${Math.abs(e.weight)}`)}if(e.item_category_uri&&!t)return"";if(t&&o.push(`y:${t.code}`),e.code){const t=e.replace_code?":":"+";(e.replace_code||""!==e.code)&&o.push(`c${t}${e.code}`)}return o.length?`{${o.join("|")}}`:""}}customElements.define("foxy-experimental-add-to-cart-builder",Y);export{Y as ExperimentalAddToCartBuilder};
@@ -1 +1 @@
1
- import"./shared-41072bad.js";import"./foxy-nucleon-element.js";import{_ as e}from"./shared-d1195c27.js";import{a as t}from"./shared-e766f6e0.js";import{I as r}from"./shared-f8252d03.js";import{i as s}from"./shared-9803aa7c.js";import{c as a}from"./shared-4e709717.js";import{d as o}from"./shared-641786b2.js";import{h as i}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-f57e1679.js";import"./shared-a24264e6.js";import"./shared-9421c0d7.js";import"./shared-ae68261f.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let n,d,u=e=>e;const h=t(r,"filter-attribute-card");class c extends h{constructor(){super(...arguments),this.getCountLoaderHref=null,this.__countLoaderId="countLoader",this.__refreshTimeout=null}static get properties(){return e(e({},super.properties),{},{countRefreshInterval:{attribute:"count-refresh-interval",type:Number},getCountLoaderHref:{attribute:!1}})}disconnectedCallback(){super.disconnectedCallback(),"number"==typeof this.__refreshTimeout&&clearTimeout(this.__refreshTimeout)}updated(e){if(super.updated(e),"number"!=typeof this.__refreshTimeout){const e=this.constructor.countRefreshInterval;this.__refreshTimeout=setTimeout((()=>{var e;return null===(e=this.__getCountLoader())||void 0===e?void 0:e.refresh()}),e)}}render(){var e,t;const r=this.constructor,h=null===(t=null===(e=this.__getCountLoader())||void 0===e?void 0:e.data)||void 0===t?void 0:t.total_items;let c;try{this.data&&this.getCountLoaderHref&&(c=new URL(this.getCountLoaderHref(o(this.data.value))),c.searchParams.set("limit","1"))}catch(e){c=void 0}return i(n||(n=u` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="${0}"> <span class="${0}"> ${0} </span> <span class="${0}"> ${0} </span> </div> `),s(null==c?void 0:c.toString()),this.__countLoaderId,(()=>this.requestUpdate()),a({"transition-colors flex gap-s font-medium text-m leading-xs rounded-s":!0,"bg-contrast-5":!this.in("fail")&&!this.data,"bg-error-10":this.in("fail")}),a({"transition-opacity truncate min-w-0":!0,"opacity-0":!this.data}),this.__getValueParam(r.filterNameKey)||i(d||(d=u`<foxy-i18n infer="" key="no_name"></foxy-i18n>`)),a({"transition-opacity bg-contrast-5 px-xs rounded-s":!0,"opacity-0":!this.data||"number"!=typeof h}),null!=h?h:0)}__getCountLoader(){return this.renderRoot.querySelector(`#${this.__countLoaderId}`)}__getValueParam(e){var t,r,s;try{return null!==(s=new URL(o(null!==(r=null===(t=this.data)||void 0===t?void 0:t.value)&&void 0!==r?r:""),"https://example.com").searchParams.get(e))&&void 0!==s?s:""}catch(e){return""}}}c.countRefreshInterval=6e5,c.filterQueryKey="filter_query",c.filterNameKey="filter_name",customElements.define("foxy-filter-attribute-card",c);export{c as FilterAttributeCard};
1
+ import"./shared-a7617e76.js";import"./foxy-nucleon-element.js";import{_ as e}from"./shared-d1195c27.js";import{a as t}from"./shared-5e0b71a2.js";import{I as r}from"./shared-238d397f.js";import{i as s}from"./shared-9803aa7c.js";import{c as a}from"./shared-4e709717.js";import{d as o}from"./shared-641786b2.js";import{h as i}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-525c1936.js";import"./shared-b16829cd.js";import"./shared-9fcd36e5.js";import"./shared-57a98543.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-bb3c9e23.js";import"./shared-67898669.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let n,d,u=e=>e;const h=t(r,"filter-attribute-card");class c extends h{constructor(){super(...arguments),this.getCountLoaderHref=null,this.__countLoaderId="countLoader",this.__refreshTimeout=null}static get properties(){return e(e({},super.properties),{},{countRefreshInterval:{attribute:"count-refresh-interval",type:Number},getCountLoaderHref:{attribute:!1}})}disconnectedCallback(){super.disconnectedCallback(),"number"==typeof this.__refreshTimeout&&clearTimeout(this.__refreshTimeout)}updated(e){if(super.updated(e),"number"!=typeof this.__refreshTimeout){const e=this.constructor.countRefreshInterval;this.__refreshTimeout=setTimeout((()=>{var e;return null===(e=this.__getCountLoader())||void 0===e?void 0:e.refresh()}),e)}}render(){var e,t;const r=this.constructor,h=null===(t=null===(e=this.__getCountLoader())||void 0===e?void 0:e.data)||void 0===t?void 0:t.total_items;let c;try{this.data&&this.getCountLoaderHref&&(c=new URL(this.getCountLoaderHref(o(this.data.value))),c.searchParams.set("limit","1"))}catch(e){c=void 0}return i(n||(n=u` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="${0}"> <span class="${0}"> ${0} </span> <span class="${0}"> ${0} </span> </div> `),s(null==c?void 0:c.toString()),this.__countLoaderId,(()=>this.requestUpdate()),a({"transition-colors flex gap-s font-medium text-m leading-xs rounded-s":!0,"bg-contrast-5":!this.in("fail")&&!this.data,"bg-error-10":this.in("fail")}),a({"transition-opacity truncate min-w-0":!0,"opacity-0":!this.data}),this.__getValueParam(r.filterNameKey)||i(d||(d=u`<foxy-i18n infer="" key="no_name"></foxy-i18n>`)),a({"transition-opacity bg-contrast-5 px-xs rounded-s":!0,"opacity-0":!this.data||"number"!=typeof h}),null!=h?h:0)}__getCountLoader(){return this.renderRoot.querySelector(`#${this.__countLoaderId}`)}__getValueParam(e){var t,r,s;try{return null!==(s=new URL(o(null!==(r=null===(t=this.data)||void 0===t?void 0:t.value)&&void 0!==r?r:""),"https://example.com").searchParams.get(e))&&void 0!==s?s:""}catch(e){return""}}}c.countRefreshInterval=6e5,c.filterQueryKey="filter_query",c.filterNameKey="filter_name",customElements.define("foxy-filter-attribute-card",c);export{c as FilterAttributeCard};
@@ -1 +1 @@
1
- import{b as e,I as t}from"./shared-0fe1dd67.js";import"./shared-0db6454a.js";import"./shared-ae68261f.js";import{h as r}from"./shared-dc73b9a5.js";import"./shared-a4953186.js";import"./shared-b62fb09f.js";import{_ as s,B as i}from"./shared-d1195c27.js";import{a}from"./shared-e766f6e0.js";import{d as o,e as n}from"./shared-641786b2.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-17a61265.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";import"./shared-a86480c5.js";import"./shared-2ddb119e.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-e6379bd1.js";import"./shared-a24264e6.js";import"./shared-dbc9aff0.js";import"./shared-126cb82b.js";import"./shared-f57e1679.js";import"./shared-e0b00e0f.js";import"./shared-9421c0d7.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-46de2ed2.js";import"./shared-16766722.js";import"./shared-6cf0c762.js";import"./shared-527eb17e.js";import"./shared-22ba9566.js";import"./shared-8874ec69.js";import"./shared-8438d4ca.js";import"./shared-79d0699c.js";import"./shared-a0c6a159.js";let d,l,m=e=>e;customElements.define("foxy-internal-filter-attribute-form-action-control",class extends e{renderControl(){const e=this.nucleon,t=null==e?void 0:e.in({idle:{snapshot:"dirty"}}),s=!!(null==e?void 0:e.data);return r(d||(d=m` <div class="grid grid-cols-2 gap-m"> ${0} <vaadin-button theme="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </vaadin-button> </div> `),s&&t?r(l||(l=m` <vaadin-button theme="contrast" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="reset"></foxy-i18n> </vaadin-button> `),this.disabled,(()=>null==e?void 0:e.undo())):"",s?t?"secondary":"error":"success",s&&t?"":"col-span-2",this.disabled,(()=>!s||t?null==e?void 0:e.submit():null==e?void 0:e.delete()),s?t?"update":"delete":"create")}});let h,c=e=>e;const u=a(t,"filter-attribute-form");class p extends u{constructor(){super(...arguments),this.pathname=null,this.options=[],this.__filterNameGetValue=()=>{const e=this.constructor;return this.__getValueParam(e.filterNameKey)},this.__filterNameSetValue=e=>{const t=this.constructor;this.__setValueParam(t.filterNameKey,e)}}static get properties(){return s(s({},super.properties),{},{pathname:{},options:{type:Array}})}get hiddenSelector(){const e=[],t=this.constructor,r=this.__getValueParam(t.filterQueryKey),s=!!this.data;return s||e.push("filter-name"),r||s||e.push("action"),new i(`${e.join(" ")} ${super.hiddenSelector}`.trim())}renderBody(){const e=this.constructor;return r(h||(h=c` <foxy-query-builder infer="filter-query" .options="${0}" .value="${0}" @change="${0}"> </foxy-query-builder> <foxy-internal-text-control infer="filter-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-filter-attribute-form-action-control infer="action"> </foxy-internal-filter-attribute-form-action-control> `),this.options,this.__getValueParam(e.filterQueryKey),this.__handleFilterQueryChange,this.__filterNameGetValue,this.__filterNameSetValue)}updated(e){var t;if(super.updated(e),"string"==typeof this.form.value){const e=new URL(o(this.form.value),"https://example.com");e.pathname=null!==(t=this.pathname)&&void 0!==t?t:"";const r=n(e.toString().substring(e.origin.length));r!==this.form.value&&this.edit({value:r})}}submit(){const e=this.constructor;this.edit({visibility:e.attributeVisibility,name:e.attributeName}),super.submit()}__getValueParam(e){var t,r;try{return null!==(r=new URL(o(null!==(t=this.form.value)&&void 0!==t?t:""),"https://example.com").searchParams.get(e))&&void 0!==r?r:""}catch(e){return""}}__setValueParam(e,t){var r;try{const s=new URL(o(null!==(r=this.form.value)&&void 0!==r?r:""),"https://example.com");s.searchParams.set(e,t),this.edit({value:n(s.toString().substring(s.origin.length))})}catch(e){}}__handleFilterQueryChange(e){var t;const r=this.constructor,s=e.currentTarget;this.__setValueParam(r.filterQueryKey,null!==(t=s.value)&&void 0!==t?t:"")}}p.attributeVisibility="restricted",p.filterQueryKey="filter_query",p.attributeName="foxy-admin-bookmark",p.filterNameKey="filter_name",customElements.define("foxy-filter-attribute-form",p);export{p as FilterAttributeForm};
1
+ import{b as t,I as e}from"./shared-44fd89ce.js";import"./shared-8af5a4f2.js";import"./shared-57a98543.js";import{h as r}from"./shared-dc73b9a5.js";import"./shared-b0d76785.js";import"./shared-3713f047.js";import{_ as s,B as a}from"./shared-d1195c27.js";import{a as i}from"./shared-5e0b71a2.js";import{d as o,e as n}from"./shared-641786b2.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-17a61265.js";import"./shared-bb3c9e23.js";import"./shared-67898669.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";import"./shared-27e2e59a.js";import"./shared-ffc84c84.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-573d6e21.js";import"./shared-b16829cd.js";import"./shared-cf0ca582.js";import"./shared-018166d0.js";import"./shared-525c1936.js";import"./shared-4c4b87c2.js";import"./shared-9fcd36e5.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-b04e9753.js";import"./shared-53caa399.js";import"./shared-a585bfd3.js";import"./shared-28b0e29a.js";import"./shared-22ba9566.js";import"./shared-8874ec69.js";import"./shared-8438d4ca.js";import"./shared-79d0699c.js";import"./shared-a0c6a159.js";let d,l,m=t=>t;customElements.define("foxy-internal-filter-attribute-form-action-control",class extends t{renderControl(){const t=this.nucleon,e=null==t?void 0:t.in({idle:{snapshot:"dirty"}}),s=!!(null==t?void 0:t.data);return r(d||(d=m` <div class="grid grid-cols-2 gap-m"> ${0} <vaadin-button theme="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </vaadin-button> </div> `),s&&e?r(l||(l=m` <vaadin-button theme="contrast" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="reset"></foxy-i18n> </vaadin-button> `),this.disabled,(()=>null==t?void 0:t.undo())):"",s?e?"secondary":"error":"success",s&&e?"":"col-span-2",this.disabled,(()=>!s||e?null==t?void 0:t.submit():null==t?void 0:t.delete()),s?e?"update":"delete":"create")}});let h,c=t=>t;const u=i(e,"filter-attribute-form");class p extends u{constructor(){super(...arguments),this.pathname=null,this.options=[],this.__filterNameGetValue=()=>{const t=this.constructor;return this.__getValueParam(t.filterNameKey)},this.__filterNameSetValue=t=>{const e=this.constructor;this.__setValueParam(e.filterNameKey,t)}}static get properties(){return s(s({},super.properties),{},{pathname:{},options:{type:Array}})}get hiddenSelector(){const t=[],e=this.constructor,r=this.__getValueParam(e.filterQueryKey),s=!!this.data;return s||t.push("filter-name"),r||s||t.push("action"),new a(`${t.join(" ")} ${super.hiddenSelector}`.trim())}renderBody(){const t=this.constructor;return r(h||(h=c` <foxy-query-builder infer="filter-query" .options="${0}" .value="${0}" @change="${0}"> </foxy-query-builder> <foxy-internal-text-control infer="filter-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-filter-attribute-form-action-control infer="action"> </foxy-internal-filter-attribute-form-action-control> `),this.options,this.__getValueParam(t.filterQueryKey),this.__handleFilterQueryChange,this.__filterNameGetValue,this.__filterNameSetValue)}updated(t){var e;if(super.updated(t),"string"==typeof this.form.value){const t=new URL(o(this.form.value),"https://example.com");t.pathname=null!==(e=this.pathname)&&void 0!==e?e:"";const r=n(t.toString().substring(t.origin.length));r!==this.form.value&&this.edit({value:r})}}submit(){const t=this.constructor;this.edit({visibility:t.attributeVisibility,name:t.attributeName}),super.submit()}__getValueParam(t){var e,r;try{return null!==(r=new URL(o(null!==(e=this.form.value)&&void 0!==e?e:""),"https://example.com").searchParams.get(t))&&void 0!==r?r:""}catch(t){return""}}__setValueParam(t,e){var r;try{const s=new URL(o(null!==(r=this.form.value)&&void 0!==r?r:""),"https://example.com");s.searchParams.set(t,e),this.edit({value:n(s.toString().substring(s.origin.length))})}catch(t){}}__handleFilterQueryChange(t){var e;const r=this.constructor,s=t.currentTarget;this.__setValueParam(r.filterQueryKey,null!==(e=s.value)&&void 0!==e?e:"")}}p.attributeVisibility="restricted",p.filterQueryKey="filter_query",p.attributeName="foxy-admin-bookmark",p.filterNameKey="filter_name",customElements.define("foxy-filter-attribute-form",p);export{p as FilterAttributeForm};
@@ -1 +1 @@
1
- import"./shared-ae68261f.js";import"./shared-a86480c5.js";import{_ as e,B as t}from"./shared-d1195c27.js";import{h as r}from"./shared-dc73b9a5.js";import{A as o}from"./shared-c518ece2.js";import{D as s}from"./shared-2ddb119e.js";import{F as n}from"./shared-343d1fd7.js";import{U as i}from"./shared-cd96ff03.js";import{s as a}from"./shared-99940888.js";import"./shared-e766f6e0.js";import"./shared-17a61265.js";import"./shared-0db6454a.js";import"./shared-126cb82b.js";import"./shared-a24264e6.js";import"./shared-dbc9aff0.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-4e709717.js";let d,p,l=e=>e;class h extends s{constructor(){super(...arguments),this.closeOnPatch=!1,this.keepOpenOnDelete=!1,this.keepOpenOnPost=!1,this.related=[],this.parent="",this.props={},this.group="",this.href="",this.__form=null,this.__renderForm=null,this.__handleFetch=e=>{e instanceof n&&(e.stopImmediatePropagation(),e.preventDefault(),e.respondWith(new o(this).fetch(e.request)))},this.__handleUpdate=e=>{var t;if(!(e instanceof i))return;const r=null===(t=e.detail)||void 0===t?void 0:t.result,o=i.UpdateResult,s=e.currentTarget;(!this.keepOpenOnDelete&&r===o.ResourceDeleted||!this.keepOpenOnPost&&r===o.ResourceCreated||this.closeOnPatch&&r===o.ResourceUpdated&&0===s.errors.length)&&(this.open=!1),this.parent!==s.parent&&(this.parent=s.parent),this.href!==s.href&&(this.href=s.href),this.closable=!s.in("busy"),this.editable=s.in({idle:{template:{dirty:"valid"}}})||s.in({idle:{snapshot:{dirty:"valid"}}})}}static get properties(){return e(e({},super.properties),{},{href:{type:String},form:{type:String,noAccessor:!0},group:{type:String},props:{type:Object},parent:{type:String},related:{type:Array},closeOnPatch:{type:Boolean,attribute:"close-on-patch"},keepOpenOnPost:{type:Boolean,attribute:"keep-open-on-post"},keepOpenOnDelete:{type:Boolean,attribute:"keep-open-on-delete"}})}get hiddenSelector(){return new t(`submit undo ${super.hiddenSelector}`.trim())}get form(){return this.__form}set form(e){this.__form=e,this.__renderForm="string"==typeof e?new Function("options",`return options.html\`\n <${e}\n id="form"\n ns="\${options.dialog.ns} \${customElements.get('${e}')?.defaultNS ?? ''}"\n href=\${options.dialog.href}\n lang=\${options.dialog.lang}\n group=\${options.dialog.group}\n parent=\${options.dialog.parent}\n disabledcontrols=\${options.dialog.disabledSelector.toString()}\n readonlycontrols=\${options.dialog.readonlySelector.toString()}\n hiddencontrols=\${options.dialog.hiddenSelector.toString()}\n ?disabled=\${options.dialog.disabled}\n ?readonly=\${options.dialog.readonly}\n ?hidden=\${options.dialog.hidden}\n .templates=\${options.dialog.templates}\n .related=\${options.dialog.related}\n ...=\${options.spread(options.dialog.props)}\n @fetch=\${options.handleFetch}\n @update=\${options.handleUpdate}\n >\n </${e}>\``):e,this.requestUpdate()}render(){return r(d||(d=l` <foxy-internal-confirm-dialog message="undo_message" confirm="undo_confirm" cancel="undo_cancel" header="undo_header" theme="error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} `),this.lang,this.ns,(e=>!e.detail.cancelled&&super.hide(!0)),super.render((()=>{var e;return r(p||(p=l`${0}`),null===(e=this.__renderForm)||void 0===e?void 0:e.call(this,{handleUpdate:this.__handleUpdate,handleFetch:this.__handleFetch,spread:a,dialog:this,html:r}))})))}async hide(e=!1){if(!e||!this.editable)return super.hide(e);this.renderRoot.querySelector("#confirm").show()}async save(){this.renderRoot.querySelector("#form").submit()}}customElements.define("foxy-form-dialog",h);export{h as FormDialog};
1
+ import"./shared-57a98543.js";import"./shared-27e2e59a.js";import{_ as e,B as t}from"./shared-d1195c27.js";import{h as r}from"./shared-dc73b9a5.js";import{A as o}from"./shared-67898669.js";import{D as s}from"./shared-ffc84c84.js";import{F as n}from"./shared-343d1fd7.js";import{U as i}from"./shared-cd96ff03.js";import{s as a}from"./shared-99940888.js";import"./shared-5e0b71a2.js";import"./shared-17a61265.js";import"./shared-8af5a4f2.js";import"./shared-018166d0.js";import"./shared-b16829cd.js";import"./shared-cf0ca582.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-4e709717.js";let d,p,l=e=>e;class h extends s{constructor(){super(...arguments),this.closeOnPatch=!1,this.keepOpenOnDelete=!1,this.keepOpenOnPost=!1,this.related=[],this.parent="",this.props={},this.group="",this.href="",this.__form=null,this.__renderForm=null,this.__handleFetch=e=>{e instanceof n&&(e.stopImmediatePropagation(),e.preventDefault(),e.respondWith(new o(this).fetch(e.request)))},this.__handleUpdate=e=>{var t;if(!(e instanceof i))return;const r=null===(t=e.detail)||void 0===t?void 0:t.result,o=i.UpdateResult,s=e.currentTarget;(!this.keepOpenOnDelete&&r===o.ResourceDeleted||!this.keepOpenOnPost&&r===o.ResourceCreated||this.closeOnPatch&&r===o.ResourceUpdated&&0===s.errors.length)&&(this.open=!1),this.parent!==s.parent&&(this.parent=s.parent),this.href!==s.href&&(this.href=s.href),this.closable=!s.in("busy"),this.editable=s.in({idle:{template:{dirty:"valid"}}})||s.in({idle:{snapshot:{dirty:"valid"}}})}}static get properties(){return e(e({},super.properties),{},{href:{type:String},form:{type:String,noAccessor:!0},group:{type:String},props:{type:Object},parent:{type:String},related:{type:Array},closeOnPatch:{type:Boolean,attribute:"close-on-patch"},keepOpenOnPost:{type:Boolean,attribute:"keep-open-on-post"},keepOpenOnDelete:{type:Boolean,attribute:"keep-open-on-delete"}})}get hiddenSelector(){return new t(`submit undo ${super.hiddenSelector}`.trim())}get form(){return this.__form}set form(e){this.__form=e,this.__renderForm="string"==typeof e?new Function("options",`return options.html\`\n <${e}\n id="form"\n ns="\${options.dialog.ns} \${customElements.get('${e}')?.defaultNS ?? ''}"\n href=\${options.dialog.href}\n lang=\${options.dialog.lang}\n group=\${options.dialog.group}\n parent=\${options.dialog.parent}\n disabledcontrols=\${options.dialog.disabledSelector.toString()}\n readonlycontrols=\${options.dialog.readonlySelector.toString()}\n hiddencontrols=\${options.dialog.hiddenSelector.toString()}\n ?disabled=\${options.dialog.disabled}\n ?readonly=\${options.dialog.readonly}\n ?hidden=\${options.dialog.hidden}\n .templates=\${options.dialog.templates}\n .related=\${options.dialog.related}\n ...=\${options.spread(options.dialog.props)}\n @fetch=\${options.handleFetch}\n @update=\${options.handleUpdate}\n >\n </${e}>\``):e,this.requestUpdate()}render(){return r(d||(d=l` <foxy-internal-confirm-dialog message="undo_message" confirm="undo_confirm" cancel="undo_cancel" header="undo_header" theme="error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} `),this.lang,this.ns,(e=>!e.detail.cancelled&&super.hide(!0)),super.render((()=>{var e;return r(p||(p=l`${0}`),null===(e=this.__renderForm)||void 0===e?void 0:e.call(this,{handleUpdate:this.__handleUpdate,handleFetch:this.__handleFetch,spread:a,dialog:this,html:r}))})))}async hide(e=!1){if(!e||!this.editable)return super.hide(e);this.renderRoot.querySelector("#confirm").show()}async save(){this.renderRoot.querySelector("#form").submit()}}customElements.define("foxy-form-dialog",h);export{h as FormDialog};
@@ -1 +1 @@
1
- import"./shared-7d234de2.js";import"./shared-46de2ed2.js";import"./shared-1838736d.js";import{a as e,I as r}from"./shared-0fe1dd67.js";import{_ as s,B as t}from"./shared-d1195c27.js";import{i}from"./shared-9803aa7c.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-7cfd461d.js";import"./shared-85803aca.js";import"./shared-a4953186.js";import{a}from"./shared-e766f6e0.js";import"./shared-6cf0c762.js";import"./shared-a24264e6.js";import"./shared-126cb82b.js";import"./shared-527eb17e.js";import"./shared-16766722.js";import"./shared-0db6454a.js";import"./shared-dbc9aff0.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-ae68261f.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";import"./shared-a86480c5.js";import"./shared-2ddb119e.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-e6379bd1.js";import"./shared-f57e1679.js";import"./shared-e0b00e0f.js";import"./shared-9421c0d7.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";let n,d,l,h=e=>e;customElements.define("foxy-internal-integer-control",class extends e{constructor(){super(...arguments),this.showControls=!1,this.prefix=null,this.suffix=null,this.min=null,this.max=null}static get properties(){return s(s({},super.properties),{},{showControls:{type:Boolean,attribute:"show-controls"},prefix:{},suffix:{},min:{type:Number},max:{type:Number}})}renderControl(){var e,r;return o(n||(n=h` <vaadin-integer-field error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" min="${0}" max="${0}" ?has-controls="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" clear-button-visible @keydown="${0}" @change="${0}"> ${0} ${0} </vaadin-integer-field> `),i(this._errorMessage),this.placeholder,this.helperText,this.label,i(null!==(e=this.min)&&void 0!==e?e:void 0),i(null!==(r=this.max)&&void 0!==r?r:void 0),this.showControls,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var r;return"Enter"===e.key&&(null===(r=this.nucleon)||void 0===r?void 0:r.submit())}),(e=>{const r=e.currentTarget;this._value=parseInt(r.value)}),this.prefix?o(d||(d=h`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?o(l||(l=h`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}});let m,c=e=>e;const p=a(r,"generate-codes-form");class f extends p{constructor(){super(...arguments),this.__exampleGetValue=()=>{var e,r;const s=null!==(e=this.form.prefix)&&void 0!==e?e:"",t=(null!==(r=this.form.length)&&void 0!==r?r:6)-s.length;if(t>0)return["1V3BJ3USJKSS1BYANMNBT7AJ06R6QQ8RB0VPPL03ATQVY186X2","P4YNSW7NSSAY43PL4H7BKHDUVNAE9UR13FC0XAAJHDLZWW8AJC","7DGT4Q91FV4KK095WLX1ML1HFNU6ZCGVBVPMGR7D3P52A9UFTB"].map((e=>`${s}${e.slice(0,t)}`)).join("\n")}}static get v8n(){return[({prefix:e="",length:r=6})=>r-e.length>0&&r<=50&&!(null==e?void 0:e.includes(" "))||"error:invalid_form"]}get readonlySelector(){const e=["example",super.readonlySelector.toString()];return this.href&&e.push("length number-of-codes current-balance prefix"),new t(e.join(" ").trim())}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return e.unshift("delete timestamps"),this.href&&e.push("example"),this.errors.includes("error:invalid_form")&&e.push("example"),new t(e.join(" ").trim())}renderBody(){return o(m||(m=c` <foxy-internal-text-control infer="prefix"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-m"> <foxy-internal-integer-control infer="length" min="1"></foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-codes" min="1"> </foxy-internal-integer-control> </div> <foxy-internal-number-control infer="current-balance" min="0"></foxy-internal-number-control> <foxy-internal-source-control infer="example" .getValue="${0}"> </foxy-internal-source-control> ${0} `),this.__exampleGetValue,super.renderBody())}async _sendPost(e){const r=JSON.stringify(e),s=await this._fetch(this.parent,{body:r,method:"POST"});return this.status={key:"success"},s}}customElements.define("foxy-generate-codes-form",f);export{f as GenerateCodesForm};
1
+ import"./shared-c5326ab8.js";import"./shared-b04e9753.js";import"./shared-68fdcf24.js";import{a as e,I as r}from"./shared-44fd89ce.js";import{_ as s,B as t}from"./shared-d1195c27.js";import{i}from"./shared-9803aa7c.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-7889f2f2.js";import"./shared-b77e1a8a.js";import"./shared-b0d76785.js";import{a}from"./shared-5e0b71a2.js";import"./shared-a585bfd3.js";import"./shared-b16829cd.js";import"./shared-018166d0.js";import"./shared-28b0e29a.js";import"./shared-53caa399.js";import"./shared-8af5a4f2.js";import"./shared-cf0ca582.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-57a98543.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-bb3c9e23.js";import"./shared-67898669.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";import"./shared-27e2e59a.js";import"./shared-ffc84c84.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-573d6e21.js";import"./shared-525c1936.js";import"./shared-4c4b87c2.js";import"./shared-9fcd36e5.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";let n,d,l,h=e=>e;customElements.define("foxy-internal-integer-control",class extends e{constructor(){super(...arguments),this.showControls=!1,this.prefix=null,this.suffix=null,this.min=null,this.max=null}static get properties(){return s(s({},super.properties),{},{showControls:{type:Boolean,attribute:"show-controls"},prefix:{},suffix:{},min:{type:Number},max:{type:Number}})}renderControl(){var e,r;return o(n||(n=h` <vaadin-integer-field error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" min="${0}" max="${0}" ?has-controls="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" clear-button-visible @keydown="${0}" @change="${0}"> ${0} ${0} </vaadin-integer-field> `),i(this._errorMessage),this.placeholder,this.helperText,this.label,i(null!==(e=this.min)&&void 0!==e?e:void 0),i(null!==(r=this.max)&&void 0!==r?r:void 0),this.showControls,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var r;return"Enter"===e.key&&(null===(r=this.nucleon)||void 0===r?void 0:r.submit())}),(e=>{const r=e.currentTarget;this._value=parseInt(r.value)}),this.prefix?o(d||(d=h`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?o(l||(l=h`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}});let c,m=e=>e;const p=a(r,"generate-codes-form");class f extends p{constructor(){super(...arguments),this.__exampleGetValue=()=>{var e,r;const s=null!==(e=this.form.prefix)&&void 0!==e?e:"",t=(null!==(r=this.form.length)&&void 0!==r?r:6)-s.length;if(t>0)return["1V3BJ3USJKSS1BYANMNBT7AJ06R6QQ8RB0VPPL03ATQVY186X2","P4YNSW7NSSAY43PL4H7BKHDUVNAE9UR13FC0XAAJHDLZWW8AJC","7DGT4Q91FV4KK095WLX1ML1HFNU6ZCGVBVPMGR7D3P52A9UFTB"].map((e=>`${s}${e.slice(0,t)}`)).join("\n")}}static get v8n(){return[({prefix:e="",length:r=6})=>r-e.length>0&&r<=50&&!(null==e?void 0:e.includes(" "))||"error:invalid_form"]}get readonlySelector(){const e=["example",super.readonlySelector.toString()];return this.href&&e.push("length number-of-codes current-balance prefix"),new t(e.join(" ").trim())}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return e.unshift("delete timestamps"),this.href&&e.push("example"),this.errors.includes("error:invalid_form")&&e.push("example"),new t(e.join(" ").trim())}renderBody(){return o(c||(c=m` <foxy-internal-text-control infer="prefix"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-m"> <foxy-internal-integer-control infer="length" min="1"></foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-codes" min="1"> </foxy-internal-integer-control> </div> <foxy-internal-number-control infer="current-balance" min="0"></foxy-internal-number-control> <foxy-internal-source-control infer="example" .getValue="${0}"> </foxy-internal-source-control> ${0} `),this.__exampleGetValue,super.renderBody())}async _sendPost(e){const r=JSON.stringify(e),s=await this._fetch(this.parent,{body:r,method:"POST"});return this.status={key:"success"},s}}customElements.define("foxy-generate-codes-form",f);export{f as GenerateCodesForm};
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-ae68261f.js";import{h as t}from"./shared-dc73b9a5.js";import{C as e}from"./shared-d1cb97c6.js";import{N as s}from"./shared-e8b8c8d0.js";import{T as i,a as r}from"./shared-e766f6e0.js";import{c as a}from"./shared-4e709717.js";import"./shared-f57e1679.js";import"./shared-a24264e6.js";import"./shared-9421c0d7.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let d,o,n,l,c,p=t=>t;const h=i(e(r(s,"gift-card-card")));class m extends h{render(){var e,s;const i=this.hiddenSelector;return t(d||(d=p` <div aria-busy="${0}" aria-live="polite" class="relative leading-s font-lumo text-m"> <div class="${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"),a({"transition-opacity":!0,"opacity-0":!this.data}),i.matches("title",!0)?"":this.__renderTitle(),i.matches("status",!0)?"":this.__renderStatus(),a({"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!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}__renderTitle(){var e,s,i,r;const a=null!==(s=null===(e=this.data)||void 0===e?void 0:e.name)&&void 0!==s?s:t(o||(o=p`&ZeroWidthSpace;`)),d=null!==(r=null===(i=this.data)||void 0===i?void 0:i.currency_code)&&void 0!==r?r:t(n||(n=p`&ZeroWidthSpace;`));return t(l||(l=p` <div data-testid="title"> ${0} <div class="flex items-center justify-between"> <div class="font-medium truncate">${0}</div> <div class="text-tertiary uppercase text-s flex-shrink-0">${0}</div> </div> ${0} </div> `),this.renderTemplateOrSlot("title:before"),a,d,this.renderTemplateOrSlot("title:after"))}__renderStatus(){var e;const s=null===(e=this.data)||void 0===e?void 0:e.expires_after;return t(c||(c=p` <div data-testid="status"> ${0} <foxy-i18n options="${0}" class="block truncate text-s text-secondary" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({value:s}),this.lang,s?"expires_after_value":"never_expires",this.ns,this.renderTemplateOrSlot("status:after"))}}customElements.define("foxy-gift-card-card",m);export{m as GiftCardCard};
1
+ import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-57a98543.js";import{h as t}from"./shared-dc73b9a5.js";import{C as e}from"./shared-d1cb97c6.js";import{N as s}from"./shared-bb3c9e23.js";import{T as i,a as r}from"./shared-5e0b71a2.js";import{c as a}from"./shared-4e709717.js";import"./shared-525c1936.js";import"./shared-b16829cd.js";import"./shared-9fcd36e5.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-67898669.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let d,o,n,l,c,p=t=>t;const h=i(e(r(s,"gift-card-card")));class m extends h{render(){var e,s;const i=this.hiddenSelector;return t(d||(d=p` <div aria-busy="${0}" aria-live="polite" class="relative leading-s font-lumo text-m"> <div class="${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"),a({"transition-opacity":!0,"opacity-0":!this.data}),i.matches("title",!0)?"":this.__renderTitle(),i.matches("status",!0)?"":this.__renderStatus(),a({"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!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}__renderTitle(){var e,s,i,r;const a=null!==(s=null===(e=this.data)||void 0===e?void 0:e.name)&&void 0!==s?s:t(o||(o=p`&ZeroWidthSpace;`)),d=null!==(r=null===(i=this.data)||void 0===i?void 0:i.currency_code)&&void 0!==r?r:t(n||(n=p`&ZeroWidthSpace;`));return t(l||(l=p` <div data-testid="title"> ${0} <div class="flex items-center justify-between"> <div class="font-medium truncate">${0}</div> <div class="text-tertiary uppercase text-s flex-shrink-0">${0}</div> </div> ${0} </div> `),this.renderTemplateOrSlot("title:before"),a,d,this.renderTemplateOrSlot("title:after"))}__renderStatus(){var e;const s=null===(e=this.data)||void 0===e?void 0:e.expires_after;return t(c||(c=p` <div data-testid="status"> ${0} <foxy-i18n options="${0}" class="block truncate text-s text-secondary" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({value:s}),this.lang,s?"expires_after_value":"never_expires",this.ns,this.renderTemplateOrSlot("status:after"))}}customElements.define("foxy-gift-card-card",m);export{m as GiftCardCard};
@@ -1 +1 @@
1
- import"./shared-41072bad.js";import"./foxy-nucleon-element.js";import"./shared-ae68261f.js";import{a as e}from"./shared-e766f6e0.js";import{I as r}from"./shared-f8252d03.js";import{i as t}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-f57e1679.js";import"./shared-a24264e6.js";import"./shared-9421c0d7.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let o,d=e=>e;const a=e(r,"gift-card-code-card");class i extends a{constructor(){super(...arguments),this.__giftCardLoaderId="giftCardLoader",this.__storeLoaderId="storeLoader"}get isBodyReady(){var e,r;return super.isBodyReady&&!!(null===(e=this.__giftCardLoader)||void 0===e?void 0:e.data)&&!!(null===(r=this.__storeLoader)||void 0===r?void 0:r.data)}renderBody(){var e,r,a,i,n;const c=null===(e=this.__giftCardLoader)||void 0===e?void 0:e.data,f=null===(r=this.__storeLoader)||void 0===r?void 0:r.data;return s(o||(o=d` <section class="h-s flex flex-col justify-center leading-xs"> <p class="flex items-center justify-between min-w-0"> <foxy-i18n infer="" class="block truncate text-m font-medium" key="line_1" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="text-s text-tertiary" key="current_balance" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> </p> </section> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.data,{currencyDisplay:(null==f?void 0:f.use_international_currency_symbol)?"code":"symbol",value:`${null===(a=this.data)||void 0===a?void 0:a.current_balance} ${null==c?void 0:c.currency_code}`},this.data,t(null===(i=this.data)||void 0===i?void 0:i._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()),t(null===(n=this.data)||void 0===n?void 0:n._links["fx:gift_card"].href),this.__giftCardLoaderId,(()=>this.requestUpdate()))}get __giftCardLoader(){return this.renderRoot.querySelector(`#${this.__giftCardLoaderId}`)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-code-card",i);export{i as GiftCardCodeCard};
1
+ import"./shared-a7617e76.js";import"./foxy-nucleon-element.js";import"./shared-57a98543.js";import{a as e}from"./shared-5e0b71a2.js";import{I as r}from"./shared-238d397f.js";import{i as t}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-525c1936.js";import"./shared-b16829cd.js";import"./shared-9fcd36e5.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-bb3c9e23.js";import"./shared-67898669.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let o,d=e=>e;const a=e(r,"gift-card-code-card");class i extends a{constructor(){super(...arguments),this.__giftCardLoaderId="giftCardLoader",this.__storeLoaderId="storeLoader"}get isBodyReady(){var e,r;return super.isBodyReady&&!!(null===(e=this.__giftCardLoader)||void 0===e?void 0:e.data)&&!!(null===(r=this.__storeLoader)||void 0===r?void 0:r.data)}renderBody(){var e,r,a,i,n;const c=null===(e=this.__giftCardLoader)||void 0===e?void 0:e.data,f=null===(r=this.__storeLoader)||void 0===r?void 0:r.data;return s(o||(o=d` <section class="h-s flex flex-col justify-center leading-xs"> <p class="flex items-center justify-between min-w-0"> <foxy-i18n infer="" class="block truncate text-m font-medium" key="line_1" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="text-s text-tertiary" key="current_balance" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> </p> </section> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.data,{currencyDisplay:(null==f?void 0:f.use_international_currency_symbol)?"code":"symbol",value:`${null===(a=this.data)||void 0===a?void 0:a.current_balance} ${null==c?void 0:c.currency_code}`},this.data,t(null===(i=this.data)||void 0===i?void 0:i._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()),t(null===(n=this.data)||void 0===n?void 0:n._links["fx:gift_card"].href),this.__giftCardLoaderId,(()=>this.requestUpdate()))}get __giftCardLoader(){return this.renderRoot.querySelector(`#${this.__giftCardLoaderId}`)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-code-card",i);export{i as GiftCardCodeCard};
@@ -1 +1 @@
1
- import"./shared-7040eef3.js";import"./shared-a34983ea.js";import"./shared-88bfb7f5.js";import"./shared-7cfd461d.js";import"./shared-e8df4368.js";import"./shared-a4953186.js";import{I as e}from"./shared-0fe1dd67.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import{_ as r,B as t}from"./shared-d1195c27.js";import{g as o}from"./shared-bab2ea2c.js";import{a as s}from"./shared-e766f6e0.js";import{T as i}from"./shared-8874ec69.js";import{i as a}from"./shared-9803aa7c.js";import{h as d}from"./shared-dc73b9a5.js";import"./shared-0db6454a.js";import"./shared-126cb82b.js";import"./shared-a24264e6.js";import"./shared-dbc9aff0.js";import"./foxy-copy-to-clipboard.js";import"./shared-e6379bd1.js";import"./shared-f57e1679.js";import"./shared-e0b00e0f.js";import"./shared-9421c0d7.js";import"./shared-ae68261f.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./foxy-nucleon-element.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./foxy-form-dialog.js";import"./shared-a86480c5.js";import"./shared-2ddb119e.js";import"./shared-4e709717.js";import"./shared-99940888.js";import"./shared-9c479921.js";import"./shared-51fd3fc6.js";import"./shared-f378fe25.js";import"./shared-1df36027.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-a0c6a159.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-7d234de2.js";import"./shared-6cf0c762.js";import"./shared-527eb17e.js";import"./shared-46de2ed2.js";import"./shared-16766722.js";import"./shared-6cf39826.js";import"./shared-0293eba8.js";import"./shared-bbd2a4e6.js";import"./shared-bec65d6d.js";import"./shared-7e1768cf.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-22ba9566.js";import"./shared-51c4a6dd.js";import"./shared-41072bad.js";import"./shared-f8252d03.js";let n,l=e=>e;const m=s(e,"gift-card-code-form");class c extends m{constructor(){super(...arguments),this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__customerGetValue=()=>{var e,r,t;const o=null===(t=null===(r=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===r?void 0:r["fx:customer"])||void 0===t?void 0:t.href,s=this.form.customer_id;return void 0===s?o:this.getCustomerHref(s)},this.__customerSetValue=e=>{const r=o(e);this.edit({customer_id:"number"==typeof r?r:""})},this.__customerFilters=[{type:i.String,path:"id",label:"filters.id"},{type:i.String,path:"tax_id",label:"filters.tax_id"},{type:i.String,path:"email",label:"filters.email"},{type:i.String,path:"first_name",label:"filters.first_name"},{type:i.String,path:"last_name",label:"filters.last_name"},{type:i.Boolean,path:"is_anonymous",label:"filters.is_anonymous",list:[{label:"filters.is_anonymous_true",value:"true"},{label:"filters.is_anonymous_false",value:"false"}]},{type:i.Date,path:"last_login_date",label:"filters.last_login_date"},{type:i.Date,path:"date_created",label:"filters.date_created"},{type:i.Date,path:"date_modified",label:"filters.date_modified"}],this.__storeLoaderId="storeLoader"}static get properties(){return r(r({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>!e||e.length<=50||"code:v8n_too_long",({code:e})=>!(null==e?void 0:e.includes(" "))||"code:v8n_has_spaces",({current_balance:e})=>"number"==typeof e||"current-balance:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString(),"cart-item"];return new t(e.join(" ").trim())}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.href||e.push("customer","cart-item","logs"),new t(e.join(" ").trim())}renderBody(){var e,r,t,o,s,i,m,c;let f;try{const o=new URL(null!==(t=null===(r=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===r?void 0:r["fx:provisioned_by_transaction_detail_id"].href)&&void 0!==t?t:"");o.searchParams.set("zoom","item_options"),f=o.toString()}catch(e){f=void 0}return d(n||(n=l` ${0} <foxy-internal-summary-control infer="settings"> <foxy-internal-text-control layout="summary-item" infer="code"></foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" infer="current-balance"> </foxy-internal-number-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-resource-picker-control infer="customer" first="${0}" item="foxy-customer-card" .getValue="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-resource-picker-control infer="cart-item" item="foxy-item-card" .getValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-async-list-control infer="logs" first="${0}" limit="5" item="foxy-gift-card-code-log-card"> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),a(null===(s=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===s?void 0:s._links["fx:customers"].href),this.__customerGetValue,this.__customerSetValue,this.__customerFilters,(()=>f),a(null===(m=null===(i=this.data)||void 0===i?void 0:i._links)||void 0===m?void 0:m["fx:gift_card_code_logs"].href),super.renderBody(),a(null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-code-form",c);export{c as GiftCardCodeForm};
1
+ import"./shared-ebc72d69.js";import"./shared-51fd39fa.js";import"./shared-44118acb.js";import"./shared-7889f2f2.js";import"./shared-2cb3cb3a.js";import"./shared-b0d76785.js";import{I as e}from"./shared-44fd89ce.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import{_ as r,B as t}from"./shared-d1195c27.js";import{g as o}from"./shared-bab2ea2c.js";import{a as s}from"./shared-5e0b71a2.js";import{T as a}from"./shared-8874ec69.js";import{i}from"./shared-9803aa7c.js";import{h as d}from"./shared-dc73b9a5.js";import"./shared-8af5a4f2.js";import"./shared-018166d0.js";import"./shared-b16829cd.js";import"./shared-cf0ca582.js";import"./foxy-copy-to-clipboard.js";import"./shared-573d6e21.js";import"./shared-525c1936.js";import"./shared-4c4b87c2.js";import"./shared-9fcd36e5.js";import"./shared-57a98543.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./foxy-nucleon-element.js";import"./shared-bb3c9e23.js";import"./shared-67898669.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./foxy-form-dialog.js";import"./shared-27e2e59a.js";import"./shared-ffc84c84.js";import"./shared-4e709717.js";import"./shared-99940888.js";import"./shared-ec5b614e.js";import"./shared-eb7bf7ba.js";import"./shared-6de0e9f3.js";import"./shared-8b838d83.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-a0c6a159.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-c5326ab8.js";import"./shared-a585bfd3.js";import"./shared-28b0e29a.js";import"./shared-b04e9753.js";import"./shared-53caa399.js";import"./shared-1c4ddc9b.js";import"./shared-e77d8d01.js";import"./shared-32440b17.js";import"./shared-d3a5cb85.js";import"./shared-b1fa0b61.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-22ba9566.js";import"./shared-51c4a6dd.js";import"./shared-a7617e76.js";import"./shared-238d397f.js";let n,l=e=>e;const m=s(e,"gift-card-code-form");class c extends m{constructor(){super(...arguments),this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__customerGetValue=()=>{var e,r,t;const o=null===(t=null===(r=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===r?void 0:r["fx:customer"])||void 0===t?void 0:t.href,s=this.form.customer_id;return void 0===s?o:this.getCustomerHref(s)},this.__customerSetValue=e=>{const r=o(e);this.edit({customer_id:"number"==typeof r?r:""})},this.__customerFilters=[{type:a.String,path:"id",label:"filters.id"},{type:a.String,path:"tax_id",label:"filters.tax_id"},{type:a.String,path:"email",label:"filters.email"},{type:a.String,path:"first_name",label:"filters.first_name"},{type:a.String,path:"last_name",label:"filters.last_name"},{type:a.Boolean,path:"is_anonymous",label:"filters.is_anonymous",list:[{label:"filters.is_anonymous_true",value:"true"},{label:"filters.is_anonymous_false",value:"false"}]},{type:a.Date,path:"last_login_date",label:"filters.last_login_date"},{type:a.Date,path:"date_created",label:"filters.date_created"},{type:a.Date,path:"date_modified",label:"filters.date_modified"}],this.__storeLoaderId="storeLoader"}static get properties(){return r(r({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>!e||e.length<=50||"code:v8n_too_long",({code:e})=>!(null==e?void 0:e.includes(" "))||"code:v8n_has_spaces",({current_balance:e})=>"number"==typeof e||"current-balance:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString(),"cart-item"];return new t(e.join(" ").trim())}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.href||e.push("customer","cart-item","logs"),new t(e.join(" ").trim())}renderBody(){var e,r,t,o,s,a,m,c;let f;try{const o=new URL(null!==(t=null===(r=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===r?void 0:r["fx:provisioned_by_transaction_detail_id"].href)&&void 0!==t?t:"");o.searchParams.set("zoom","item_options"),f=o.toString()}catch(e){f=void 0}return d(n||(n=l` ${0} <foxy-internal-summary-control infer="settings"> <foxy-internal-text-control layout="summary-item" infer="code"></foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" infer="current-balance"> </foxy-internal-number-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-resource-picker-control infer="customer" first="${0}" item="foxy-customer-card" .getValue="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-resource-picker-control infer="cart-item" item="foxy-item-card" .getValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-async-list-control infer="logs" first="${0}" limit="5" item="foxy-gift-card-code-log-card"> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),i(null===(s=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===s?void 0:s._links["fx:customers"].href),this.__customerGetValue,this.__customerSetValue,this.__customerFilters,(()=>f),i(null===(m=null===(a=this.data)||void 0===a?void 0:a._links)||void 0===m?void 0:m["fx:gift_card_code_logs"].href),super.renderBody(),i(null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-code-form",c);export{c as GiftCardCodeForm};
@@ -1 +1 @@
1
- import"./shared-41072bad.js";import"./foxy-nucleon-element.js";import"./shared-ae68261f.js";import{a as e}from"./shared-e766f6e0.js";import{I as t}from"./shared-f8252d03.js";import{i as r}from"./shared-9803aa7c.js";import{c as s}from"./shared-4e709717.js";import{h as o}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-f57e1679.js";import"./shared-a24264e6.js";import"./shared-9421c0d7.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let i,d=e=>e;const a=e(t,"gift-card-code-log-card");class n extends a{constructor(){super(...arguments),this.__giftCardLoaderId="giftCardLoader",this.__storeLoaderId="storeLoader"}renderBody(){var e,t,a,n;const f=this.data,c=null!==(e=null==f?void 0:f.balance_adjustment)&&void 0!==e?e:0,l="number"==typeof(null==f?void 0:f.transaction_id),_=l?"title_used":"title_updated_via_api",u=l?"subtitle_transaction":"subtitle_no_transaction",p={transaction_id:null==f?void 0:f.transaction_id},h={date_created:null==f?void 0:f.date_created,month:"short"},m={currencyDisplay:(null===(t=this.__store)||void 0===t?void 0:t.use_international_currency_symbol)?"code":"symbol",signDisplay:"exceptZero",amount:`${c} ${null===(a=this.__giftCard)||void 0===a?void 0:a.currency_code}`};return o(i||(i=d` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="leading-s"> <div class="flex justify-between items-center"> <span class="text-body font-medium truncate"> <foxy-i18n infer="" key="${0}"></foxy-i18n> </span> <span class="text-s text-tertiary flex-shrink-0"> <foxy-i18n infer="" key="date" .options="${0}"></foxy-i18n> </span> </div> <div class="text-s text-secondary truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> <span class="text-tertiary">&bull;</span> <span class="${0}"> <foxy-i18n infer="" key="adjustment" .options="${0}"></foxy-i18n> </span> </div> </div> `),r(null===(n=null==f?void 0:f._links)||void 0===n?void 0:n["fx:gift_card"].href),this.__giftCardLoaderId,(()=>this.requestUpdate()),r(null==f?void 0:f._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()),_,h,u,p,s({"text-tertiary":0===c,"text-success":c>0,"text-error":c<0}),m)}get isBodyReady(){return super.isBodyReady&&!!this.__giftCard&&!!this.__store}get __giftCardLoader(){return this.renderRoot.querySelector(`#${this.__giftCardLoaderId}`)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}get __giftCard(){var e;return null===(e=this.__giftCardLoader)||void 0===e?void 0:e.data}get __store(){var e;return null===(e=this.__storeLoader)||void 0===e?void 0:e.data}}customElements.define("foxy-gift-card-code-log-card",n);export{n as GiftCardCodeLogCard};
1
+ import"./shared-a7617e76.js";import"./foxy-nucleon-element.js";import"./shared-57a98543.js";import{a as e}from"./shared-5e0b71a2.js";import{I as t}from"./shared-238d397f.js";import{i as r}from"./shared-9803aa7c.js";import{c as s}from"./shared-4e709717.js";import{h as o}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-525c1936.js";import"./shared-b16829cd.js";import"./shared-9fcd36e5.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-bb3c9e23.js";import"./shared-67898669.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let i,a=e=>e;const d=e(t,"gift-card-code-log-card");class n extends d{constructor(){super(...arguments),this.__giftCardLoaderId="giftCardLoader",this.__storeLoaderId="storeLoader"}renderBody(){var e,t,d,n;const c=this.data,l=null!==(e=null==c?void 0:c.balance_adjustment)&&void 0!==e?e:0,f="number"==typeof(null==c?void 0:c.transaction_id),_=f?"title_used":"title_updated_via_api",u=f?"subtitle_transaction":"subtitle_no_transaction",p={transaction_id:null==c?void 0:c.transaction_id},h={date_created:null==c?void 0:c.date_created,month:"short"},m={currencyDisplay:(null===(t=this.__store)||void 0===t?void 0:t.use_international_currency_symbol)?"code":"symbol",signDisplay:"exceptZero",amount:`${l} ${null===(d=this.__giftCard)||void 0===d?void 0:d.currency_code}`};return o(i||(i=a` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="leading-s"> <div class="flex justify-between items-center"> <span class="text-body font-medium truncate"> <foxy-i18n infer="" key="${0}"></foxy-i18n> </span> <span class="text-s text-tertiary flex-shrink-0"> <foxy-i18n infer="" key="date" .options="${0}"></foxy-i18n> </span> </div> <div class="text-s text-secondary truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> <span class="text-tertiary">&bull;</span> <span class="${0}"> <foxy-i18n infer="" key="adjustment" .options="${0}"></foxy-i18n> </span> </div> </div> `),r(null===(n=null==c?void 0:c._links)||void 0===n?void 0:n["fx:gift_card"].href),this.__giftCardLoaderId,(()=>this.requestUpdate()),r(null==c?void 0:c._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()),_,h,u,p,s({"text-tertiary":0===l,"text-success":l>0,"text-error":l<0}),m)}get isBodyReady(){return super.isBodyReady&&!!this.__giftCard&&!!this.__store}get __giftCardLoader(){return this.renderRoot.querySelector(`#${this.__giftCardLoaderId}`)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}get __giftCard(){var e;return null===(e=this.__giftCardLoader)||void 0===e?void 0:e.data}get __store(){var e;return null===(e=this.__storeLoader)||void 0===e?void 0:e.data}}customElements.define("foxy-gift-card-code-log-card",n);export{n as GiftCardCodeLogCard};
@@ -1 +1 @@
1
- import"./shared-3efc6649.js";import"./shared-7cfd461d.js";import{I as e}from"./shared-0fe1dd67.js";import{a as r}from"./shared-e766f6e0.js";import{B as s}from"./shared-d1195c27.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-e6379bd1.js";import"./shared-a24264e6.js";import"./shared-dbc9aff0.js";import"./shared-126cb82b.js";import"./shared-f57e1679.js";import"./shared-e0b00e0f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-7d234de2.js";import"./shared-6cf0c762.js";import"./shared-527eb17e.js";import"./shared-46de2ed2.js";import"./shared-16766722.js";import"./shared-0db6454a.js";import"./shared-9803aa7c.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-ae68261f.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";import"./shared-a86480c5.js";import"./shared-2ddb119e.js";import"./foxy-copy-to-clipboard.js";import"./shared-9421c0d7.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let d,a=e=>e;const o=r(e,"gift-card-codes-form");class i extends o{constructor(){super(...arguments),this.__giftCardCodesGetValue=()=>{var e,r;return null!==(r=null===(e=this.form.gift_card_codes)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==r?r:[]},this.__giftCardCodesSetValue=e=>{this.edit({gift_card_codes:e.map((({value:e})=>e.split(" ").map((e=>e.trim())))).flat().filter(((e,r,s)=>s.indexOf(e)===r))})}}static get v8n(){return[({gift_card_codes:e})=>e&&e.length>0||"gift-card-codes:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("gift-card-codes"),new s(e.join(" ").trim())}get hiddenSelector(){const e=["delete timestamps",super.hiddenSelector.toString()];return new s(e.join(" ").trim())}renderBody(){return t(d||(d=a` <foxy-internal-editable-list-control infer="gift-card-codes" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-number-control infer="current-balance" min="0"></foxy-internal-number-control> ${0} `),this.__giftCardCodesGetValue,this.__giftCardCodesSetValue,super.renderBody())}async _sendPost(e){const r=JSON.stringify(e),s=await this._fetch(this.parent,{body:r,method:"POST"});return this.status={key:"success"},s}}customElements.define("foxy-gift-card-codes-form",i);export{i as GiftCardCodesForm};
1
+ import"./shared-504f3c65.js";import"./shared-7889f2f2.js";import{I as r}from"./shared-44fd89ce.js";import{a as e}from"./shared-5e0b71a2.js";import{B as s}from"./shared-d1195c27.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-573d6e21.js";import"./shared-b16829cd.js";import"./shared-cf0ca582.js";import"./shared-018166d0.js";import"./shared-525c1936.js";import"./shared-4c4b87c2.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-c5326ab8.js";import"./shared-a585bfd3.js";import"./shared-28b0e29a.js";import"./shared-b04e9753.js";import"./shared-53caa399.js";import"./shared-8af5a4f2.js";import"./shared-9803aa7c.js";import"./shared-1aff7995.js";import"./shared-019348d7.js";import"./shared-57a98543.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-bb3c9e23.js";import"./shared-67898669.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-fcdb896f.js";import"./shared-27e2e59a.js";import"./shared-ffc84c84.js";import"./foxy-copy-to-clipboard.js";import"./shared-9fcd36e5.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,d=r=>r;const o=e(r,"gift-card-codes-form");class i extends o{constructor(){super(...arguments),this.__giftCardCodesGetValue=()=>{var r,e;return null!==(e=null===(r=this.form.gift_card_codes)||void 0===r?void 0:r.map((r=>({value:r}))))&&void 0!==e?e:[]},this.__giftCardCodesSetValue=r=>{this.edit({gift_card_codes:r.map((({value:r})=>r.split(" ").map((r=>r.trim())))).flat().filter(((r,e,s)=>s.indexOf(r)===e))})}}static get v8n(){return[({gift_card_codes:r})=>r&&r.length>0||"gift-card-codes:v8n_required"]}get readonlySelector(){const r=[super.readonlySelector.toString()];return this.href&&r.push("gift-card-codes"),new s(r.join(" ").trim())}get hiddenSelector(){const r=["delete timestamps",super.hiddenSelector.toString()];return new s(r.join(" ").trim())}renderBody(){return t(a||(a=d` <foxy-internal-editable-list-control infer="gift-card-codes" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-number-control infer="current-balance" min="0"></foxy-internal-number-control> ${0} `),this.__giftCardCodesGetValue,this.__giftCardCodesSetValue,super.renderBody())}async _sendPost(r){const e=JSON.stringify(r),s=await this._fetch(this.parent,{body:e,method:"POST"});return this.status={key:"success"},s}}customElements.define("foxy-gift-card-codes-form",i);export{i as GiftCardCodesForm};