@foxy.io/elements 1.34.0 → 1.35.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) 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 +1 -1
  34. package/dist/cdn/foxy-customer.js +1 -1
  35. package/dist/cdn/foxy-customers-table.js +1 -1
  36. package/dist/cdn/foxy-discount-builder.js +1 -1
  37. package/dist/cdn/foxy-discount-card.js +1 -1
  38. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  39. package/dist/cdn/foxy-donation.js +1 -1
  40. package/dist/cdn/foxy-downloadable-card.js +1 -1
  41. package/dist/cdn/foxy-downloadable-form.js +1 -1
  42. package/dist/cdn/foxy-email-template-card.js +1 -1
  43. package/dist/cdn/foxy-email-template-form.js +1 -1
  44. package/dist/cdn/foxy-error-entry-card.js +1 -1
  45. package/dist/cdn/foxy-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-19cd0786.js +1 -0
  127. package/dist/cdn/{shared-6cf39826.js → shared-1c4ddc9b.js} +1 -1
  128. package/dist/cdn/{shared-f8252d03.js → shared-238d397f.js} +1 -1
  129. package/dist/cdn/{shared-370be17b.js → shared-257389e5.js} +4 -4
  130. package/dist/cdn/{shared-a86480c5.js → shared-27e2e59a.js} +1 -1
  131. package/dist/cdn/{shared-527eb17e.js → shared-28b0e29a.js} +1 -1
  132. package/dist/cdn/{shared-869ed25d.js → shared-297e8531.js} +1 -1
  133. package/dist/cdn/{shared-e8df4368.js → shared-2cb3cb3a.js} +1 -1
  134. package/dist/cdn/{shared-851b96ae.js → shared-2f02918d.js} +1 -1
  135. package/dist/cdn/{shared-fceaef95.js → shared-31d8e958.js} +1 -1
  136. package/dist/cdn/{shared-bbd2a4e6.js → shared-32440b17.js} +1 -1
  137. package/dist/cdn/{shared-5245b330.js → shared-363dce45.js} +1 -1
  138. package/dist/cdn/{shared-b62fb09f.js → shared-3713f047.js} +1 -1
  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 +545 -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 +60 -0
  193. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js.map +1 -1
  194. package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.d.ts +46 -0
  195. package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.js +810 -0
  196. package/dist/elements/public/ExperimentalAddToCartBuilder/ExperimentalAddToCartBuilder.js.map +1 -0
  197. package/dist/elements/public/ExperimentalAddToCartBuilder/index.d.ts +14 -0
  198. package/dist/elements/public/ExperimentalAddToCartBuilder/index.js +16 -0
  199. package/dist/elements/public/ExperimentalAddToCartBuilder/index.js.map +1 -0
  200. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/InternalExperimentalAddToCartBuilderCustomOptionCard.d.ts +6 -0
  201. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/InternalExperimentalAddToCartBuilderCustomOptionCard.js +14 -0
  202. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/InternalExperimentalAddToCartBuilderCustomOptionCard.js.map +1 -0
  203. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/index.d.ts +3 -0
  204. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/index.js +5 -0
  205. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/index.js.map +1 -0
  206. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/types.d.ts +11 -0
  207. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/types.js +2 -0
  208. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionCard/types.js.map +1 -0
  209. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/InternalExperimentalAddToCartBuilderCustomOptionForm.d.ts +20 -0
  210. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/InternalExperimentalAddToCartBuilderCustomOptionForm.js +122 -0
  211. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/InternalExperimentalAddToCartBuilderCustomOptionForm.js.map +1 -0
  212. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/index.d.ts +9 -0
  213. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/index.js +11 -0
  214. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/index.js.map +1 -0
  215. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/types.d.ts +11 -0
  216. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/types.js +2 -0
  217. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderCustomOptionForm/types.js.map +1 -0
  218. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/InternalExperimentalAddToCartBuilderItemControl.d.ts +11 -0
  219. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/InternalExperimentalAddToCartBuilderItemControl.js +379 -0
  220. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/InternalExperimentalAddToCartBuilderItemControl.js.map +1 -0
  221. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/index.d.ts +19 -0
  222. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/index.js +21 -0
  223. package/dist/elements/public/ExperimentalAddToCartBuilder/internal/InternalExperimentalAddToCartBuilderItemControl/index.js.map +1 -0
  224. package/dist/elements/public/ExperimentalAddToCartBuilder/preview.css.d.ts +2 -0
  225. package/dist/elements/public/ExperimentalAddToCartBuilder/preview.css.js +153 -0
  226. package/dist/elements/public/ExperimentalAddToCartBuilder/preview.css.js.map +1 -0
  227. package/dist/elements/public/ExperimentalAddToCartBuilder/types.d.ts +56 -0
  228. package/dist/elements/public/ExperimentalAddToCartBuilder/types.js +2 -0
  229. package/dist/elements/public/ExperimentalAddToCartBuilder/types.js.map +1 -0
  230. package/dist/elements/public/NucleonElement/API.js +3 -1
  231. package/dist/elements/public/NucleonElement/API.js.map +1 -1
  232. package/dist/elements/public/index.d.ts +1 -0
  233. package/dist/elements/public/index.defined.d.ts +1 -0
  234. package/dist/elements/public/index.defined.js +1 -0
  235. package/dist/elements/public/index.defined.js.map +1 -1
  236. package/dist/elements/public/index.js +1 -0
  237. package/dist/elements/public/index.js.map +1 -1
  238. package/dist/mixins/themeable.js +32 -0
  239. package/dist/mixins/themeable.js.map +1 -1
  240. package/package.json +1 -1
  241. package/dist/cdn/shared-0fe1dd67.js +0 -1
  242. package/dist/cdn/shared-41072bad.js +0 -1
  243. package/dist/cdn/shared-88bfb7f5.js +0 -1
  244. package/dist/cdn/shared-c518ece2.js +0 -1
@@ -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-19cd0786.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-19cd0786.js";import"./shared-80688cd4.js";import"./shared-80a7903f.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"./shared-b0d76785.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 n,s as i}from"./shared-dc73b9a5.js";import{_ as o,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-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"./shared-a0c6a159.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-22ba9566.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 n(f||(f=y` <div class="flex justify-between items-center h-xs"> <span class="font-medium">${0}</span> <span class="text-secondary">${0}</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,_,x=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 o(o({},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.data&&e.unshift("basics-group"),new a(e.join(" ").trim())}get disabledSelector(){const e=[super.disabledSelector.toString()];return this.data||this.existingOptions.some((e=>e.name===this.form.name))&&e.unshift("basics-group:value-configurable"),new a(e.join(" ").trim())}renderBody(){var e,t,r,i;return n(h||(h=x` <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> ${0} `),this.form.value_configurable?"default-value":"value",this.form.value_configurable?"":n(_||(_=x` <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> `),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!==(i=this.form.item_category_uri)&&void 0!==i?i: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 v,b,$,w,S,j,C,q,k,L,P,T,U,F,D=e=>e;customElements.define("foxy-internal-experimental-add-to-cart-builder-item-control",class extends t{constructor(){super(...arguments),this.itemCategories=null,this.currencyCode=null,this.index=0}static get properties(){return o(o({},super.properties),{},{itemCategories:{attribute:"item-categories"},currencyCode:{attribute:"currency-code"},index:{type:Number},store:{}})}renderControl(){var e,t,r,i,o,a,s,l,d;const m=null===(e=this.__itemCategoryLoader)||void 0===e?void 0:e.data,c=this.nucleon,p=this.index,f=null===(t=null==c?void 0:c.form.items)||void 0===t?void 0:t[p];return n(v||(v=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> <foxy-internal-summary-control infer="appearance-group" layout="details"> <foxy-internal-text-control property="items.${0}.image" layout="summary-item" infer="image"> </foxy-internal-text-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="subscriptions-group" layout="details"> <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="discount-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-summary-control> <foxy-internal-summary-control infer="expires-group" layout="details"> <foxy-internal-select-control property="items.${0}.expires_format" layout="summary-item" infer="expires-format" .options="${0}"> </foxy-internal-select-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-summary-control> <foxy-internal-summary-control infer="dimensions-group" layout="details"> <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-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> </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> `),p,p,u(null!==(r=this.itemCategories)&&void 0!==r?r:void 0),p,u(null!==(i=this.currencyCode)&&void 0!==i?i:void 0),(null==f?void 0:f.price_configurable)?"price-default":"price",p,p,p,p,(null==f?void 0:f.image)?n(b||(b=D` <foxy-internal-text-control property="items.${0}.url" layout="summary-item" infer="url"> </foxy-internal-text-control> `),p):"",p,(null==f?void 0:f.sub_enabled)?n($||($=D` <foxy-internal-frequency-control property="items.${0}.sub_frequency" layout="summary-item" infer="sub-frequency"> </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} `),p,p,[{label:"option_none",value:"none"},{label:"option_yyyymmdd",value:"yyyymmdd"},{label:"option_dd",value:"dd"},{label:"option_duration",value:"duration"}],"yyyymmdd"===f.sub_startdate_format?n(w||(w=D` <foxy-internal-date-control property="items.${0}.sub_startdate" layout="summary-item" infer="sub-startdate-yyyymmdd"> </foxy-internal-date-control> `),p):"duration"===f.sub_startdate_format?n(S||(S=D` <foxy-internal-frequency-control property="items.${0}.sub_startdate" layout="summary-item" infer="sub-startdate-duration"> </foxy-internal-frequency-control> `),p):"dd"===f.sub_startdate_format?n(j||(j=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> `),p):"",p,[{label:"option_none",value:"none"},{label:"option_yyyymmdd",value:"yyyymmdd"},{label:"option_duration",value:"duration"}],"yyyymmdd"===f.sub_enddate_format?n(C||(C=D` <foxy-internal-date-control property="items.${0}.sub_enddate" layout="summary-item" infer="sub-enddate-yyyymmdd"> </foxy-internal-date-control> `),p):"duration"===f.sub_enddate_format?n(q||(q=D` <foxy-internal-frequency-control property="items.${0}.sub_enddate" layout="summary-item" infer="sub-enddate-duration"> </foxy-internal-frequency-control> `),p):""):"",p,(null==f?void 0:f.discount_name)?n(k||(k=D` <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> `),{details:null!==(o=null==f?void 0:f.discount_details)&&void 0!==o?o:"",type:null!==(a=null==f?void 0:f.discount_type)&&void 0!==a?a:"discount_amount_percentage",name:null!==(s=null==f?void 0:f.discount_name)&&void 0!==s?s:""},(e=>this.__handleDiscountBuilderChange(e,f,p))):"",p,[{label:"option_none",value:"none"},{label:"option_minutes",value:"minutes"},{label:"option_timestamp",value:"timestamp"}],"minutes"===(null==f?void 0:f.expires_format)?n(L||(L=D` <foxy-internal-number-control property="items.${0}.expires_value" layout="summary-item" suffix="min" infer="expires-value-minutes"> </foxy-internal-number-control> `),p):"timestamp"===(null==f?void 0:f.expires_format)?n(P||(P=D` <foxy-internal-date-control property="items.${0}.expires_value" layout="summary-item" format="unix" infer="expires-value-timestamp"> </foxy-internal-date-control> `),p):"",p,"minutes"===(null==f?void 0:f.expires_format)?"":n(T||(T=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> `),p,p),u(null==m?void 0:m.default_weight),p,u(null==m?void 0:m.default_weight_unit),p,u(null==m?void 0:m.default_length_unit),p,u(null==m?void 0:m.default_length_unit),p,u(null==m?void 0:m.default_length_unit),null==c?void 0:c.virtualHost,p,{".defaultWeightUnit":null==m?void 0:m.default_weight_unit,".existingOptions":null!==(l=null==f?void 0:f.custom_options)&&void 0!==l?l:[],".itemCategories":this.itemCategories,".currencyCode":this.currencyCode},1===(null===(d=null==c?void 0:c.form.items)||void 0===d?void 0:d.length)?n(U||(U=D``)):n(F||(F=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==f?void 0:f.item_category_uri),(()=>this.requestUpdate()))}get __itemCategoryLoader(){return this.renderRoot.querySelector("#itemCategoryLoader")}__handleDiscountBuilderChange(e,t,r){var n;const i=e.currentTarget,o=this.nucleon;t.discount_details=i.parsedValue.details,t.discount_type=i.parsedValue.type,t.discount_name=i.parsedValue.name;const a=null!==(n=null==o?void 0:o.form.items)&&void 0!==n?n:[];a.splice(r,1,t),null==o||o.edit({items:[...a]})}});let H,M,A,E,O,z,I,R=e=>e;const B=l(s(e,"experimental-add-to-cart-builder"));class W extends B{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.__signAsync=d((async function(t,r){if(t===e.__previousUnsignedCode&&e.__previousSignedCode)return;const n=()=>t!==e.__previousUnsignedCode;e.__signingState="busy";try{const i=await new W.API(e).fetch(r,{headers:{"Content-Type":"text/plain"},method:"POST",body:t});if(!n())if(i.ok){const t=(await i.json()).result;n()||(e.__signingState="idle",e.__previousSignedCode=t.replace(/value="--OPEN--" data-replace/gi,"value"))}else e.__signingState="fail"}catch(t){n()||(e.__signingState="fail")}}),500),this.__previousUnsignedCode="",this.__previousSignedCode="",this.__signingState="idle",this.__openState=[]}static get properties(){return o(o({},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}})}renderBody(){var e,t,r,o,a,s,l,d,m,c,f,y;const h=this.__getAddToCartCode(),_=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===(o=this.__storeLoader)||void 0===o?void 0:o.data;return n(H||(H=R` <div class="grid gap-m items-start sm-grid-cols-2 md-grid-cols-3 h-full overflow-auto"> <div class="space-y-m"> ${0} <vaadin-button class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="add-product" key="caption"></foxy-i18n> </vaadin-button> </div> <div class="space-y-m md-col-span-2 sticky top-0"> ${0} <foxy-internal-summary-control infer="cart-settings-group"> <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-switch-control false-alias="add" true-alias="checkout" layout="summary-item" infer="cart"> </foxy-internal-switch-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="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 n(M||(M=R` <foxy-internal-summary-control layout="details" label="${0}" infer="item" ?open="${0}" @toggle="${0}"> <foxy-internal-experimental-add-to-cart-builder-item-control item-categories="${0}" currency-code="${0}" store="${0}" index="${0}" infer="" @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(_),t,(()=>{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:[]}]}),this.__openState=[...new Array(t.length).fill(!1),!0]}),h?n(A||(A=R` <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"> <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> </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',h.formHTML,p({"flex-1 transition-all filter":!0,"blur-sm":"idle"!==this.__signingState}),(e=>{var t;const r=e.currentTarget,n=null===(t=r.contentWindow)||void 0===t?void 0:t.document.documentElement;n&&(r.style.height=n.scrollHeight+"px")}),p({"break-all overflow-auto flex-1 min-w-0 transition-all filter":!0,"blur-sm":"idle"!==this.__signingState}),h.formHTML,p({"absolute right-0 bg-base rounded-s transition-opacity":!0,"opacity-0 pointer-events-none":"busy"!==this.__signingState}),h.formHTML,p({"flex-shrink-0 text-m transition-opacity":!0,"opacity-0 pointer-events-none":"busy"===this.__signingState}),i(E||(E=R`<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>`)),h.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}),h.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",h.linkHref,p({"flex-shrink-0 text-m transition-opacity":!0,"opacity-0 pointer-events-none":"busy"===this.__signingState})):n(O||(O=R` <foxy-internal-summary-control infer="preview"> <div class="flex items-center justify-center p-xl"> <foxy-spinner infer="unavailable" state="empty"></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),[{label:"option_false",value:"false"},{label:"option_true",value:"true"},{label:"option_reset",value:"reset"}],u(this.__defaultTemplateSetHref),(()=>this.requestUpdate()),u(this.localeCodes),(()=>this.requestUpdate()),u(null!==(d=this.form.template_set_uri)&&void 0!==d?d:void 0),(()=>this.requestUpdate()),u(null!==(f=null!==(c=null===(m=this.data)||void 0===m?void 0:m._links["fx:store"].href)&&void 0!==c?c:this.store)&&void 0!==f?f:void 0),(()=>this.requestUpdate()),null===(y=this.form.items)||void 0===y?void 0:y.map(((e,t)=>n(z||(z=R` <foxy-nucleon class="hidden" infer="" href="${0}" id="itemCategoryLoaderProduct${0}" @update="${0}"> </foxy-nucleon> ${0} `),u(e.item_category_uri),t,(()=>this.requestUpdate()),e.custom_options.map(((e,r)=>n(I||(I=R` <foxy-nucleon class="hidden" infer="" href="${0}" id="itemCategoryLoaderProduct${0}Option${0}" @update="${0}"> </foxy-nucleon> `),u(e.item_category_uri),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,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 n=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 n.searchParams.set("code","DEFAULT"),n.toString()}catch(e){return}}get __resolvedCurrencyCode(){var e,t,r,n;const i=this.renderRoot.querySelector("#localeCodesHelperLoader"),o=null===(e=this.__resolvedTemplateSet)||void 0===e?void 0:e.locale_code,a=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.values,s=o?null==a?void 0:a[o]:void 0;return s?null===(n=null===(r=/Currency: ([A-Z]{3})/g.exec(s))||void 0===r?void 0:r[1])||void 0===n?void 0:n.toUpperCase():void 0}get __resolvedTemplateSet(){var e,t,r,n;const i=e=>this.renderRoot.querySelector(e);return null!==(t=null===(e=i("#templateSetLoader"))||void 0===e?void 0:e.data)&&void 0!==t?t:null===(n=null===(r=i("#defaultTemplateSetLoader"))||void 0===r?void 0:r.data)||void 0===n?void 0:n._embedded["fx:template_sets"][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}`,n="number"==typeof t?`${r}Option${t}`:r;return this.renderRoot.querySelector(n)}__getAddToCartFormHTML(){var e,t,r,n,i,o,a;const s=this.__resolvedCurrencyCode,l=this.__resolvedTemplateSet,d=this.__resolvedCartUrl,u=null===(e=this.__storeLoader)||void 0===e?void 0:e.data;if(!(this.defaultDomain&&l&&u&&s&&d))return"";let c=`<form action="${m(d)}" method="post" target="_blank">`,p=1;const f=()=>`\n${" ".repeat(2*p)}`,y=(e,t)=>{const r=m(t),n=m(e);c+=`${f()}<input type="hidden" name="${n}" value="${r}">`};"DEFAULT"!==l.code&&y("template_set",l.code),this.form.empty&&y("empty",this.form.empty),"checkout"===this.form.cart&&y("cart","checkout");const h=null!==(t=this.form.items)&&void 0!==t?t:[],_=h.length>1;for(let e=0;e<h.length;++e){const t=this.__getItemCategoryLoader(e),l=null==t?void 0:t.data,d=h[e];if(!d.name||!d.price)return"";if(d.item_category_uri&&!l)return"";const x=d.quantity_min!==d.quantity_max,g=d.price_configurable,v=d.custom_options.some(((e,t,r)=>e.value_configurable||r.findIndex((t=>t.name===e.name))!==t)),b=_&&(g||x||v);b&&(c+=`${f()}<fieldset>`,p++,c+=`${f()}<legend>${m(d.name)}</legend>`);const $=0===e?"":`${e+1}:`;y(`${$}name`,d.name);const w=`${d.price}${s}`;if(d.price_configurable){const e=m(w);c+=`${f()}<label>`,p++,c+=`${f()}<span>${m(this.t("preview.price_label"))}</span>`,u.use_cart_validation?c+=`${f()}<input required name="${$}price" value="--OPEN--" data-replace="${e}">`:c+=`${f()}<input required name="${$}price" value="${e}">`,p--,c+=`${f()}</label>`}else y(`${$}price`,w);if(l&&"DEFAULT"!==l.code&&y(`${$}category`,l.code),d.code&&y(`${$}code`,d.code),d.parent_code&&y(`${$}parent_code`,d.parent_code),d.image&&(y(`${$}image`,d.image),d.url&&y(`${$}url`,d.url)),d.sub_enabled&&d.sub_frequency){if(y(`${$}sub_frequency`,d.sub_frequency),d.sub_startdate)if("yyyymmdd"===d.sub_startdate_format){const e=new Date(d.sub_startdate);y(`${$}sub_startdate`,`${e.getFullYear()}${(e.getMonth()+1).toString().padStart(2,"0")}${e.getDate().toString().padStart(2,"0")}`)}else y(`${$}sub_startdate`,String(d.sub_startdate));if(d.sub_enddate)if("yyyymmdd"===d.sub_enddate_format){const e=new Date(d.sub_enddate);y(`${$}sub_enddate`,`${e.getFullYear()}${(e.getMonth()+1).toString().padStart(2,"0")}${e.getDate().toString().padStart(2,"0")}`)}else y(`${$}sub_enddate`,d.sub_enddate)}d.discount_name&&d.discount_type&&d.discount_details&&y(`${$}discount_${d.discount_type}`,`${d.discount_name}{${d.discount_details}}`),d.expires_value&&("timestamp"===d.expires_format?y(`${$}expires`,(d.expires_value/1e3).toFixed(0)):y(`${$}expires`,d.expires_value.toFixed(0))),d.quantity_min||d.quantity_max?(c+=`${f()}<label>`,p++,c+=`${f()}<span>${m(this.t("preview.quantity_label"))}</span>`,c+=`${f()}<input type="number" name="${m(`${$}quantity`)}"`,"minutes"!==d.expires_format&&(d.quantity_min&&(c+=` min="${m(String(d.quantity_min))}"`),d.quantity_max&&(c+=` max="${m(String(d.quantity_max))}"`)),u.use_cart_validation?c+=` value="--OPEN--" data-replace="${m(String(null!==(r=d.quantity)&&void 0!==r?r:1))}">`:c+=` value="${m(String(null!==(n=d.quantity)&&void 0!==n?n:1))}">`,p--,c+=`${f()}</label>`):(null!==(i=d.quantity)&&void 0!==i?i:1)>1&&y(`${$}quantity`,(null!==(o=d.quantity)&&void 0!==o?o:1).toString()),"minutes"!==d.expires_format&&(d.quantity_min&&y(`${$}quantity_min`,d.quantity_min.toFixed(0)),d.quantity_max&&y(`${$}quantity_max`,d.quantity_max.toFixed(0))),d.length&&y(`${$}length`,d.length.toFixed(3)),d.width&&y(`${$}width`,d.width.toFixed(3)),d.height&&y(`${$}height`,d.height.toFixed(3)),d.weight&&y(`${$}weight`,d.weight.toFixed(3)),u.features_multiship&&(c+=`${f()}<label>`,p++,c+=`${f()}<span>${m(this.t("preview.shipto_label"))}</span>`,u.use_cart_validation?c+=`${f()}<input name="${$}shipto" value="--OPEN--" data-replace="">`:c+=`${f()}<input name="${$}shipto" value="">`,p--,c+=`${f()}</label>`);const S=d.custom_options.reduce(((e,t)=>(e[t.name]||(e[t.name]=[]),e[t.name].push(t),e)),{});for(const t in S){const r=S[t];if(1===r.length){const n=d.custom_options.indexOf(r[0]),i=null===(a=this.__getItemCategoryLoader(e,n))||void 0===a?void 0:a.data,o=this.__getOptionModifiers(r[0],null!=i?i:null,s),l=`${r[0].value}${o}`,h=`${$}${t}`;r[0].value_configurable?(c+=`${f()}<label>`,p++,c+=`${f()}<span>${m(t)}:</span>`,c+=`${f()}<input name="${m(h)}" `,u.use_cart_validation?c+=`value="--OPEN--" data-replace="${m(l)}">`:c+=`value="${m(l)}">`,p--,c+=`${f()}</label>`):y(h,l)}else c+=`${f()}<label>`,p++,c+=`${f()}<span>${m(t)}:</span>`,c+=`${f()}<select name="${$}${t}">`,p++,r.forEach((t=>{var r;const n=d.custom_options.indexOf(t),i=null===(r=this.__getItemCategoryLoader(e,n))||void 0===r?void 0:r.data,o=this.__getOptionModifiers(t,null!=i?i:null,s),a=m(`${t.value}${o}`),l=m(t.value);c+=`${f()}<option value="${a}">${l}</option>`})),p--,c+=`${f()}</select>`,p--,c+=`${f()}</label>`}b&&(p--,c+=`${f()}</fieldset>`)}const x=m(this.t("preview.submit_caption"));return c+=`${f()}<button type="submit">${x}</button>`,p--,c+=`${f()}</form>`,c}__getAddToCartLinkHref(){var e,t,r,n,i,o;const a=this.__resolvedCurrencyCode,s=this.__resolvedTemplateSet,l=this.__resolvedCartUrl,d=null===(e=this.__storeLoader)||void 0===e?void 0:e.data;if(!(this.defaultDomain&&s&&d&&a&&l))return"";const u=new URL(l);"DEFAULT"!==s.code&&u.searchParams.set("template_set",s.code),this.form.empty&&u.searchParams.set("empty",this.form.empty),"checkout"===this.form.cart&&u.searchParams.set("cart","checkout");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}:`,s=null===(n=this.__getItemCategoryLoader(e))||void 0===n?void 0:n.data;if(t.item_category_uri&&!s)return"";if(s&&"DEFAULT"!==s.code&&u.searchParams.set(`${r}category`,s.code),u.searchParams.set(`${r}name`,t.name),u.searchParams.set(`${r}price`,`${t.price}${a}`),t.code&&u.searchParams.set(`${r}code`,t.code),t.parent_code&&u.searchParams.set(`${r}parent_code`,t.parent_code),t.image&&(u.searchParams.set(`${r}image`,t.image),t.url&&u.searchParams.set(`${r}url`,t.url)),t.sub_enabled&&t.sub_frequency){if(u.searchParams.set(`${r}sub_frequency`,t.sub_frequency),t.sub_startdate)if("yyyymmdd"===t.sub_startdate_format){const e=new Date(t.sub_startdate),n=e.getFullYear(),i=(e.getMonth()+1).toString().padStart(2,"0"),o=e.getDate().toString().padStart(2,"0");u.searchParams.set(`${r}sub_startdate`,`${n}${i}${o}`)}else u.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),n=e.getFullYear(),i=(e.getMonth()+1).toString().padStart(2,"0"),o=e.getDate().toString().padStart(2,"0");u.searchParams.set(`${r}sub_enddate`,`${n}${i}${o}`)}else u.searchParams.set(`${r}sub_enddate`,t.sub_enddate)}t.discount_name&&t.discount_type&&t.discount_details&&u.searchParams.set(`${r}discount_${t.discount_type}`,`${t.discount_name}{${t.discount_details}}`),t.expires_value&&("timestamp"===t.expires_format?u.searchParams.set(`${r}expires`,(t.expires_value/1e3).toFixed(0)):u.searchParams.set(`${r}expires`,t.expires_value.toFixed(0))),(null!==(i=t.quantity)&&void 0!==i?i:1)>1&&u.searchParams.set(`${r}quantity`,(null!==(o=t.quantity)&&void 0!==o?o:1).toFixed(0)),"minutes"!==t.expires_format&&(t.quantity_min&&u.searchParams.set(`${r}quantity_min`,t.quantity_min.toString()),t.quantity_max&&u.searchParams.set(`${r}quantity_max`,t.quantity_max.toString())),t.weight&&u.searchParams.set(`${r}weight`,t.weight.toFixed(3)),t.length&&u.searchParams.set(`${r}length`,t.length.toFixed(3)),t.width&&u.searchParams.set(`${r}width`,t.width.toFixed(3)),t.height&&u.searchParams.set(`${r}height`,t.height.toFixed(3)),t.custom_options.forEach(((t,n)=>{var i,o;const s=null===(i=this.__getItemCategoryLoader(e,n))||void 0===i?void 0:i.data,l=this.__getOptionModifiers(t,null!=s?s:null,a);u.searchParams.set(`${r}${t.name}`,`${null!==(o=t.value)&&void 0!==o?o:""}${l}`)}))}return u.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(),n=this.__getAddToCartLinkHref();if(!r||!n)return null;const i=`<a href="${m(n)}">Add to cart</a>`,o=`${r}${this.__signingSeparator}${i}`;if(o===this.__previousUnsignedCode&&this.__previousSignedCode){const e=this.__previousSignedCode.split(this.__signingSeparator);return{formHTML:e[0],linkHref:c(e[1].substring(9,e[1].length-17))}}return this.__previousUnsignedCode=o,this.__previousSignedCode="",t.use_cart_validation&&this.__signAsync(o,this.encodeHelper),{formHTML:r,linkHref:n}}__getOptionModifiers(e,t,r){if(e.value_configurable)return"";const n=[];if(e.price){const t=e.replace_price?":":-1===Math.sign(e.price)?"-":"+";(e.replace_price||0!==e.price)&&n.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)&&n.push(`w${t}${Math.abs(e.weight)}`)}if(e.item_category_uri&&!t)return"";if(t&&n.push(`y:${t.code}`),e.code){const t=e.replace_code?":":"+";(e.replace_code||""!==e.code)&&n.push(`c${t}${e.code}`)}return n.length?`{${n.join("|")}}`:""}}customElements.define("foxy-experimental-add-to-cart-builder",W);export{W 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-19cd0786.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};
@@ -1 +1 @@
1
- import"./shared-e7069b0f.js";import"./shared-851b96ae.js";import"./shared-3efc6649.js";import"./shared-a34983ea.js";import"./shared-74d9b3d4.js";import"./shared-88bfb7f5.js";import"./shared-9e9bec09.js";import"./shared-a83e33cd.js";import"./shared-7cfd461d.js";import"./shared-a4953186.js";import{I as e}from"./shared-0fe1dd67.js";import"./foxy-generate-codes-form.js";import"./foxy-gift-card-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-gift-card-code-card.js";import"./foxy-gift-card-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import{_ as r,B as t}from"./shared-d1195c27.js";import{T as i}from"./shared-8874ec69.js";import{h as o}from"./shared-dc73b9a5.js";import{R as s,a}from"./shared-e766f6e0.js";import{i as n}from"./shared-9803aa7c.js";import"./shared-9c479921.js";import"./shared-126cb82b.js";import"./shared-a24264e6.js";import"./shared-dbc9aff0.js";import"./shared-0db6454a.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-f57e1679.js";import"./shared-9421c0d7.js";import"./shared-ae68261f.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.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-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-4e709717.js";import"./foxy-form-dialog.js";import"./shared-a86480c5.js";import"./shared-2ddb119e.js";import"./shared-e6379bd1.js";import"./shared-e0b00e0f.js";import"./shared-22ba9566.js";import"./shared-51fd3fc6.js";import"./shared-f378fe25.js";import"./shared-1df36027.js";import"./foxy-swipe-actions.js";import"./shared-7d234de2.js";import"./shared-6cf0c762.js";import"./shared-527eb17e.js";import"./shared-46de2ed2.js";import"./shared-16766722.js";import"./shared-1838736d.js";import"./shared-4f216dc1.js";import"./shared-c1f4a6ef.js";import"./shared-0293eba8.js";import"./shared-651c44fa.js";import"./shared-bec65d6d.js";import"./shared-7e1768cf.js";import"./shared-51c4a6dd.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-85803aca.js";import"./shared-fceaef95.js";import"./shared-f8252d03.js";import"./shared-41072bad.js";import"./shared-7040eef3.js";import"./shared-e8df4368.js";import"./shared-6cf39826.js";import"./shared-bbd2a4e6.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import"./shared-8e73014c.js";const d=["aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bgn","bhd","bif","bmd","bnd","bob","brl","bsd","btc","btn","bwp","byn","bzd","cad","cdf","chf","clf","clp","cnh","cny","cop","crc","cuc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ggp","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","hrk","htg","huf","idr","ils","imp","inr","iqd","irr","isk","jep","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sll","sos","srd","ssp","std","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","vef","ves","vnd","vuv","wst","xaf","xag","xau","xcd","xdr","xof","xpd","xpf","xpt","yer","zar","zmw","zwl"];let l,c,f=e=>e;const m=s(a(e,"gift-card-form"));class p extends m{constructor(){var e;super(...arguments),e=this,this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__provisioningMaxBalanceValueGetter=()=>{var e;return null===(e=this.form.provisioning_config)||void 0===e?void 0:e.initial_balance_max},this.__provisioningMaxBalanceValueSetter=e=>{var r,t;const i=null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==t?t:e;this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:i>e?e:i,initial_balance_max:e}})},this.__provisioningMinBalanceValueGetter=()=>{var e;return null===(e=this.form.provisioning_config)||void 0===e?void 0:e.initial_balance_min},this.__provisioningMinBalanceValueSetter=e=>{var r,t;const i=null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_max)&&void 0!==t?t:e;this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:e,initial_balance_max:i<e?e:i}})},this.__provisioningToggleValueGetter=()=>{var e;return!!(null===(e=this.form.provisioning_config)||void 0===e?void 0:e.allow_autoprovisioning)},this.__provisioningToggleValueSetter=e=>{var r,t,i,o;e?this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==t?t:0,initial_balance_max:null!==(o=null===(i=this.form.provisioning_config)||void 0===i?void 0:i.initial_balance_max)&&void 0!==o?o:0}}):this.edit({provisioning_config:null})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:r})=>"block"===r?`-${e}`:e)).filter(((e,r,t)=>!!e&&t.indexOf(e)===r)).join(",")})},this.__currencyCodeGetValue=()=>{var e;return null===(e=this.form.currency_code)||void 0===e?void 0:e.toLowerCase()},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:i.String},{label:"current_balance",path:"current_balance",type:i.Number},{label:"end_date",path:"end_date",type:i.Date},{label:"date_created",path:"date_created",type:i.Date},{label:"date_modified",path:"date_modified",type:i.Date}],this.__codesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(r){e.__codesActions[0].state="busy",e.__codesActions=[...e.__codesActions];try{await navigator.clipboard.writeText(r.code),e.__codesActions[0].state="end"}catch(r){e.__codesActions[0].state="error"}finally{e.__codesActions=[...e.__codesActions],setTimeout((()=>{e.__codesActions[0].state="idle",e.__codesActions=[...e.__codesActions]}),1e3)}}}]}static get properties(){return r(r({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",e=>{var r;if(null===(r=e.provisioning_config)||void 0===r?void 0:r.allow_autoprovisioning){if(!e.sku)return"sku:v8n_required";if(e.sku.length>200)return"sku:v8n_too_long"}return!0},e=>{var r;const t=null===(r=e.provisioning_config)||void 0===r?void 0:r.initial_balance_min;return!("number"==typeof t&&t<0)||"min-balance:v8n_negative"},e=>{var r;const t=null===(r=e.provisioning_config)||void 0===r?void 0:r.initial_balance_max;return!("number"==typeof t&&t<0)||"max-balance:v8n_negative"},({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long"]}get hiddenSelector(){var e;const r=[super.hiddenSelector.toString()];return this.data||r.push("codes","category-restrictions","attributes"),(null===(e=this.form.provisioning_config)||void 0===e?void 0:e.allow_autoprovisioning)||r.push("provisioning:sku","provisioning:min-balance","provisioning:max-balance"),new t(r.join(" ").trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeaderActions(e){return o(l||(l=f` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-gift-card-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:gift_card_codes"].href],e._links["fx:gift_card_codes"].href,[e._links["fx:gift_card_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,r,t,i,s,a,l,m,p,u;let _;try{const t=new URL(null!==(r=null===(e=this.data)||void 0===e?void 0:e._links["fx:gift_card_codes"].href)&&void 0!==r?r:"");t.searchParams.set("order","date_created desc"),_=t.toString()}catch(e){_=void 0}return o(c||(c=f` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"> </foxy-internal-text-control> <foxy-internal-select-control property="currency_code" layout="summary-item" infer="currency" .getValue="${0}" .options="${0}"> </foxy-internal-select-control> <foxy-internal-frequency-control property="expires_after" layout="summary-item" infer="expires"> </foxy-internal-frequency-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="provisioning"> <foxy-internal-switch-control infer="toggle" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="sku"></foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="min-balance" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="max-balance" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="codes" item="foxy-gift-card-code-card" form="foxy-gift-card-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="gift_card_uri" options-href="${0}" links-href="${0}" embed-key="fx:gift_card_item_categories" own-uri="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__currencyCodeGetValue,d.map((e=>({label:this.t(`general.currency.code_${e}`),value:e}))),this.__provisioningToggleValueGetter,this.__provisioningToggleValueSetter,n(null===(t=this.form.currency_code)||void 0===t?void 0:t.toUpperCase()),this.__provisioningMinBalanceValueGetter,this.__provisioningMinBalanceValueSetter,n(null===(i=this.form.currency_code)||void 0===i?void 0:i.toUpperCase()),this.__provisioningMaxBalanceValueGetter,this.__provisioningMaxBalanceValueSetter,_,{".getCustomerHref":this.getCustomerHref},this.__codesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],n(null===(a=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===a?void 0:a._links["fx:item_categories"].href),n(null===(l=this.data)||void 0===l?void 0:l._links["fx:gift_card_item_categories"].href),n(null===(m=this.data)||void 0===m?void 0:m._links.self.href),n(null===(p=this.data)||void 0===p?void 0:p._links["fx:attributes"].href),super.renderBody(),n(null===(u=this.data)||void 0===u?void 0:u._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-form",p);export{p as GiftCardForm};
1
+ import"./shared-ce055dce.js";import"./shared-2f02918d.js";import"./shared-504f3c65.js";import"./shared-51fd39fa.js";import"./shared-84761b5b.js";import"./shared-19cd0786.js";import"./shared-80a7903f.js";import"./shared-80688cd4.js";import"./shared-7889f2f2.js";import"./shared-b0d76785.js";import{I as e}from"./shared-44fd89ce.js";import"./foxy-generate-codes-form.js";import"./foxy-gift-card-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-gift-card-code-card.js";import"./foxy-gift-card-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import{_ as r,B as t}from"./shared-d1195c27.js";import{T as i}from"./shared-8874ec69.js";import{h as o}from"./shared-dc73b9a5.js";import{R as a,a as s}from"./shared-5e0b71a2.js";import{i as n}from"./shared-9803aa7c.js";import"./shared-ec5b614e.js";import"./shared-018166d0.js";import"./shared-b16829cd.js";import"./shared-cf0ca582.js";import"./shared-8af5a4f2.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-525c1936.js";import"./shared-9fcd36e5.js";import"./shared-57a98543.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.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-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-4e709717.js";import"./foxy-form-dialog.js";import"./shared-27e2e59a.js";import"./shared-ffc84c84.js";import"./shared-573d6e21.js";import"./shared-4c4b87c2.js";import"./shared-22ba9566.js";import"./shared-eb7bf7ba.js";import"./shared-6de0e9f3.js";import"./shared-8b838d83.js";import"./foxy-swipe-actions.js";import"./shared-c5326ab8.js";import"./shared-a585bfd3.js";import"./shared-28b0e29a.js";import"./shared-b04e9753.js";import"./shared-53caa399.js";import"./shared-68fdcf24.js";import"./shared-112e521b.js";import"./shared-c5cb7e8a.js";import"./shared-e77d8d01.js";import"./shared-651c44fa.js";import"./shared-d3a5cb85.js";import"./shared-b1fa0b61.js";import"./shared-51c4a6dd.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-b77e1a8a.js";import"./shared-31d8e958.js";import"./shared-238d397f.js";import"./shared-a7617e76.js";import"./shared-ebc72d69.js";import"./shared-2cb3cb3a.js";import"./shared-1c4ddc9b.js";import"./shared-32440b17.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import"./shared-01f85a69.js";const d=["aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bgn","bhd","bif","bmd","bnd","bob","brl","bsd","btc","btn","bwp","byn","bzd","cad","cdf","chf","clf","clp","cnh","cny","cop","crc","cuc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ggp","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","hrk","htg","huf","idr","ils","imp","inr","iqd","irr","isk","jep","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sll","sos","srd","ssp","std","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","vef","ves","vnd","vuv","wst","xaf","xag","xau","xcd","xdr","xof","xpd","xpf","xpt","yer","zar","zmw","zwl"];let l,c,f=e=>e;const m=a(s(e,"gift-card-form"));class p extends m{constructor(){var e;super(...arguments),e=this,this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__provisioningMaxBalanceValueGetter=()=>{var e;return null===(e=this.form.provisioning_config)||void 0===e?void 0:e.initial_balance_max},this.__provisioningMaxBalanceValueSetter=e=>{var r,t;const i=null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==t?t:e;this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:i>e?e:i,initial_balance_max:e}})},this.__provisioningMinBalanceValueGetter=()=>{var e;return null===(e=this.form.provisioning_config)||void 0===e?void 0:e.initial_balance_min},this.__provisioningMinBalanceValueSetter=e=>{var r,t;const i=null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_max)&&void 0!==t?t:e;this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:e,initial_balance_max:i<e?e:i}})},this.__provisioningToggleValueGetter=()=>{var e;return!!(null===(e=this.form.provisioning_config)||void 0===e?void 0:e.allow_autoprovisioning)},this.__provisioningToggleValueSetter=e=>{var r,t,i,o;e?this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==t?t:0,initial_balance_max:null!==(o=null===(i=this.form.provisioning_config)||void 0===i?void 0:i.initial_balance_max)&&void 0!==o?o:0}}):this.edit({provisioning_config:null})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:r})=>"block"===r?`-${e}`:e)).filter(((e,r,t)=>!!e&&t.indexOf(e)===r)).join(",")})},this.__currencyCodeGetValue=()=>{var e;return null===(e=this.form.currency_code)||void 0===e?void 0:e.toLowerCase()},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:i.String},{label:"current_balance",path:"current_balance",type:i.Number},{label:"end_date",path:"end_date",type:i.Date},{label:"date_created",path:"date_created",type:i.Date},{label:"date_modified",path:"date_modified",type:i.Date}],this.__codesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(r){e.__codesActions[0].state="busy",e.__codesActions=[...e.__codesActions];try{await navigator.clipboard.writeText(r.code),e.__codesActions[0].state="end"}catch(r){e.__codesActions[0].state="error"}finally{e.__codesActions=[...e.__codesActions],setTimeout((()=>{e.__codesActions[0].state="idle",e.__codesActions=[...e.__codesActions]}),1e3)}}}]}static get properties(){return r(r({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",e=>{var r;if(null===(r=e.provisioning_config)||void 0===r?void 0:r.allow_autoprovisioning){if(!e.sku)return"sku:v8n_required";if(e.sku.length>200)return"sku:v8n_too_long"}return!0},e=>{var r;const t=null===(r=e.provisioning_config)||void 0===r?void 0:r.initial_balance_min;return!("number"==typeof t&&t<0)||"min-balance:v8n_negative"},e=>{var r;const t=null===(r=e.provisioning_config)||void 0===r?void 0:r.initial_balance_max;return!("number"==typeof t&&t<0)||"max-balance:v8n_negative"},({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long"]}get hiddenSelector(){var e;const r=[super.hiddenSelector.toString()];return this.data||r.push("codes","category-restrictions","attributes"),(null===(e=this.form.provisioning_config)||void 0===e?void 0:e.allow_autoprovisioning)||r.push("provisioning:sku","provisioning:min-balance","provisioning:max-balance"),new t(r.join(" ").trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeaderActions(e){return o(l||(l=f` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-gift-card-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:gift_card_codes"].href],e._links["fx:gift_card_codes"].href,[e._links["fx:gift_card_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,r,t,i,a,s,l,m,p,u;let _;try{const t=new URL(null!==(r=null===(e=this.data)||void 0===e?void 0:e._links["fx:gift_card_codes"].href)&&void 0!==r?r:"");t.searchParams.set("order","date_created desc"),_=t.toString()}catch(e){_=void 0}return o(c||(c=f` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"> </foxy-internal-text-control> <foxy-internal-select-control property="currency_code" layout="summary-item" infer="currency" .getValue="${0}" .options="${0}"> </foxy-internal-select-control> <foxy-internal-frequency-control property="expires_after" layout="summary-item" infer="expires"> </foxy-internal-frequency-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="provisioning"> <foxy-internal-switch-control infer="toggle" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="sku"></foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="min-balance" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="max-balance" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="codes" item="foxy-gift-card-code-card" form="foxy-gift-card-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="gift_card_uri" options-href="${0}" links-href="${0}" embed-key="fx:gift_card_item_categories" own-uri="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__currencyCodeGetValue,d.map((e=>({label:this.t(`general.currency.code_${e}`),value:e}))),this.__provisioningToggleValueGetter,this.__provisioningToggleValueSetter,n(null===(t=this.form.currency_code)||void 0===t?void 0:t.toUpperCase()),this.__provisioningMinBalanceValueGetter,this.__provisioningMinBalanceValueSetter,n(null===(i=this.form.currency_code)||void 0===i?void 0:i.toUpperCase()),this.__provisioningMaxBalanceValueGetter,this.__provisioningMaxBalanceValueSetter,_,{".getCustomerHref":this.getCustomerHref},this.__codesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],n(null===(s=null===(a=this.__storeLoader)||void 0===a?void 0:a.data)||void 0===s?void 0:s._links["fx:item_categories"].href),n(null===(l=this.data)||void 0===l?void 0:l._links["fx:gift_card_item_categories"].href),n(null===(m=this.data)||void 0===m?void 0:m._links.self.href),n(null===(p=this.data)||void 0===p?void 0:p._links["fx:attributes"].href),super.renderBody(),n(null===(u=this.data)||void 0===u?void 0:u._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-form",p);export{p as GiftCardForm};