@foxy.io/elements 1.18.0-beta.16 → 1.18.0-beta.17

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 (209) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +2 -2
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-api-browser.js +3 -3
  5. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  6. package/dist/cdn/foxy-attribute-card.js +1 -1
  7. package/dist/cdn/foxy-attribute-form.js +1 -1
  8. package/dist/cdn/foxy-cancellation-form.js +1 -1
  9. package/dist/cdn/foxy-collection-page.js +1 -1
  10. package/dist/cdn/foxy-collection-pages.js +1 -1
  11. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  12. package/dist/cdn/foxy-coupon-card.js +1 -1
  13. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  14. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  15. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  16. package/dist/cdn/foxy-coupon-form.js +1 -1
  17. package/dist/cdn/foxy-custom-field-card.js +1 -1
  18. package/dist/cdn/foxy-custom-field-form.js +1 -1
  19. package/dist/cdn/foxy-customer-api.js +1 -1
  20. package/dist/cdn/foxy-customer-card.js +1 -1
  21. package/dist/cdn/foxy-customer-form.js +1 -1
  22. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  23. package/dist/cdn/foxy-customer-portal.js +1 -1
  24. package/dist/cdn/foxy-customer.js +1 -1
  25. package/dist/cdn/foxy-customers-table.js +1 -1
  26. package/dist/cdn/foxy-discount-builder.js +1 -1
  27. package/dist/cdn/foxy-discount-card.js +1 -1
  28. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  29. package/dist/cdn/foxy-donation.js +1 -1
  30. package/dist/cdn/foxy-email-template-card.js +1 -1
  31. package/dist/cdn/foxy-email-template-form.js +1 -1
  32. package/dist/cdn/foxy-error-entry-card.js +1 -1
  33. package/dist/cdn/foxy-form-dialog.js +1 -1
  34. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  35. package/dist/cdn/foxy-gift-card-card.js +1 -1
  36. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  37. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  38. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  39. package/dist/cdn/foxy-gift-card-form.js +1 -1
  40. package/dist/cdn/foxy-i18n-editor.js +2 -0
  41. package/dist/cdn/foxy-i18n.js +1 -1
  42. package/dist/cdn/foxy-integration-card.js +1 -1
  43. package/dist/cdn/foxy-integration-form.js +1 -1
  44. package/dist/cdn/foxy-item-card.js +1 -1
  45. package/dist/cdn/foxy-item-category-card.js +1 -1
  46. package/dist/cdn/foxy-item-category-form.js +1 -1
  47. package/dist/cdn/foxy-item-form.js +1 -1
  48. package/dist/cdn/foxy-item-option-card.js +1 -1
  49. package/dist/cdn/foxy-item-option-form.js +1 -1
  50. package/dist/cdn/foxy-items-form.js +1 -1
  51. package/dist/cdn/foxy-nucleon-element.js +1 -1
  52. package/dist/cdn/foxy-pagination.js +1 -1
  53. package/dist/cdn/foxy-payment-card.js +1 -1
  54. package/dist/cdn/foxy-payment-method-card.js +1 -1
  55. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  56. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  57. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  58. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  59. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  60. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  61. package/dist/cdn/foxy-payments-api.js +1 -1
  62. package/dist/cdn/foxy-query-builder.js +1 -1
  63. package/dist/cdn/foxy-report-form.js +2 -2
  64. package/dist/cdn/foxy-reports-table.js +1 -1
  65. package/dist/cdn/foxy-shipment-card.js +1 -1
  66. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  67. package/dist/cdn/foxy-sign-in-form.js +1 -1
  68. package/dist/cdn/foxy-spinner.js +2 -2
  69. package/dist/cdn/foxy-store-form.js +1 -1
  70. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  71. package/dist/cdn/foxy-subscription-card.js +1 -1
  72. package/dist/cdn/foxy-subscription-form.js +3 -3
  73. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  74. package/dist/cdn/foxy-table.js +1 -1
  75. package/dist/cdn/foxy-tax-card.js +1 -1
  76. package/dist/cdn/foxy-tax-form.js +1 -1
  77. package/dist/cdn/foxy-template-card.js +1 -1
  78. package/dist/cdn/foxy-template-config-form.js +1 -1
  79. package/dist/cdn/foxy-template-form.js +1 -1
  80. package/dist/cdn/foxy-template-set-card.js +1 -1
  81. package/dist/cdn/foxy-template-set-form.js +1 -1
  82. package/dist/cdn/foxy-transaction-card.js +1 -1
  83. package/dist/cdn/foxy-transaction.js +1 -1
  84. package/dist/cdn/foxy-transactions-table.js +1 -1
  85. package/dist/cdn/foxy-user-form.js +1 -1
  86. package/dist/cdn/foxy-users-table.js +1 -1
  87. package/dist/cdn/foxy-webhook-card.js +1 -1
  88. package/dist/cdn/foxy-webhook-form.js +1 -1
  89. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  90. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  91. package/dist/cdn/shared-002b788f.js +15 -0
  92. package/dist/cdn/{shared-4623f740.js → shared-0672e78b.js} +1 -1
  93. package/dist/cdn/{shared-afaa6139.js → shared-162fc285.js} +1 -1
  94. package/dist/cdn/{shared-3f4f362e.js → shared-1b3e1a0d.js} +1 -1
  95. package/dist/cdn/{shared-de385bdb.js → shared-2215e6c8.js} +5 -5
  96. package/dist/cdn/shared-236d9b7e.js +1 -0
  97. package/dist/cdn/{shared-03f7cc13.js → shared-29376ba1.js} +1 -1
  98. package/dist/cdn/{shared-ff13276c.js → shared-29e21467.js} +3 -3
  99. package/dist/cdn/{shared-00c585e4.js → shared-2c842660.js} +1 -1
  100. package/dist/cdn/{shared-23e0d67e.js → shared-2d3027f4.js} +1 -1
  101. package/dist/cdn/{shared-a0c09692.js → shared-2f1e04ae.js} +1 -1
  102. package/dist/cdn/{shared-788e5ff5.js → shared-34b11d34.js} +1 -1
  103. package/dist/cdn/{shared-5714d3a4.js → shared-3a3878c9.js} +1 -1
  104. package/dist/cdn/{shared-0ff5e59d.js → shared-40537775.js} +1 -1
  105. package/dist/cdn/{shared-b1b40832.js → shared-40d82f6b.js} +1 -1
  106. package/dist/cdn/{shared-28b09f69.js → shared-4457dc27.js} +1 -1
  107. package/dist/cdn/{shared-6822bc96.js → shared-4975f86f.js} +1 -1
  108. package/dist/cdn/{shared-77359cd0.js → shared-4c338ca6.js} +1 -1
  109. package/dist/cdn/shared-515f00b1.js +1 -0
  110. package/dist/cdn/{shared-b5120f1a.js → shared-5504f415.js} +2 -2
  111. package/dist/cdn/{shared-452a471d.js → shared-55e20d5b.js} +1 -1
  112. package/dist/cdn/{shared-a8966936.js → shared-5ad8c9a0.js} +1 -1
  113. package/dist/cdn/{shared-9f53978e.js → shared-5b55627c.js} +1 -1
  114. package/dist/cdn/{shared-c70b41e1.js → shared-6003864d.js} +1 -1
  115. package/dist/cdn/shared-6b8874a7.js +1 -0
  116. package/dist/cdn/shared-6bf8883f.js +1 -0
  117. package/dist/cdn/{shared-77970922.js → shared-6d2064e9.js} +3 -3
  118. package/dist/cdn/{shared-1d851ca7.js → shared-6e6ed30a.js} +1 -1
  119. package/dist/cdn/{shared-59d73648.js → shared-71deb26e.js} +1 -1
  120. package/dist/cdn/{shared-0a7b94ac.js → shared-74277a73.js} +1 -1
  121. package/dist/cdn/{shared-555ec39f.js → shared-7661b51a.js} +15 -15
  122. package/dist/cdn/{shared-3d0dc4a6.js → shared-7b167fe9.js} +1 -1
  123. package/dist/cdn/{shared-03d5434f.js → shared-85f9051e.js} +1 -1
  124. package/dist/cdn/{shared-684e229f.js → shared-8a5e01ae.js} +1 -1
  125. package/dist/cdn/{shared-7af4d4b6.js → shared-8d533e0c.js} +1 -1
  126. package/dist/cdn/shared-923da875.js +6 -0
  127. package/dist/cdn/shared-92926b1d.js +1 -0
  128. package/dist/cdn/{shared-17d5d718.js → shared-92bd849f.js} +1 -1
  129. package/dist/cdn/shared-a46a2f49.js +1 -0
  130. package/dist/cdn/{shared-f04dd7e9.js → shared-a86761d3.js} +2 -2
  131. package/dist/cdn/{shared-b97d9ae3.js → shared-ad8141c4.js} +1 -1
  132. package/dist/cdn/{shared-7bfd93b7.js → shared-b28dbc68.js} +27 -51
  133. package/dist/cdn/{shared-2ce65ad5.js → shared-b5cbbdd8.js} +1 -1
  134. package/dist/cdn/{shared-15278fe0.js → shared-b7423eab.js} +1 -1
  135. package/dist/cdn/{shared-760538ac.js → shared-b7f7f15f.js} +1 -1
  136. package/dist/cdn/{shared-e4bc532a.js → shared-b8e9b536.js} +1 -1
  137. package/dist/cdn/{shared-ecd289b3.js → shared-bb522838.js} +1 -1
  138. package/dist/cdn/{shared-1e9dc71f.js → shared-bd194cdf.js} +1 -1
  139. package/dist/cdn/{shared-a98a6602.js → shared-c484320b.js} +1 -1
  140. package/dist/cdn/{shared-08d6d02b.js → shared-c52d3772.js} +1 -1
  141. package/dist/cdn/{shared-debbc076.js → shared-cced7800.js} +1 -1
  142. package/dist/cdn/{shared-b617fde5.js → shared-cfec6ec1.js} +1 -1
  143. package/dist/cdn/{shared-9195959e.js → shared-d302ad2c.js} +1 -1
  144. package/dist/cdn/{shared-e6bff624.js → shared-d43fc5cc.js} +1 -1
  145. package/dist/cdn/shared-dc798bf4.js +1 -0
  146. package/dist/cdn/{shared-4a796610.js → shared-dcbf57e0.js} +1 -1
  147. package/dist/cdn/{shared-8cb76c8b.js → shared-e119731e.js} +1 -1
  148. package/dist/cdn/shared-e396ec04.js +25 -0
  149. package/dist/cdn/{shared-0db7afef.js → shared-e3ce88dc.js} +12 -17
  150. package/dist/cdn/{shared-3b22a756.js → shared-ea316e64.js} +1 -1
  151. package/dist/cdn/{shared-b5b5c848.js → shared-ef0fc329.js} +1 -1
  152. package/dist/cdn/{shared-f43a5253.js → shared-f022673a.js} +7 -7
  153. package/dist/cdn/{shared-184945cc.js → shared-f23d122e.js} +3 -3
  154. package/dist/cdn/{shared-45c3705a.js → shared-f2d19582.js} +1 -1
  155. package/dist/cdn/{shared-0d697dd1.js → shared-facfe95a.js} +4 -4
  156. package/dist/cdn/{shared-779795c5.js → shared-ff2f84c7.js} +1 -1
  157. package/dist/cdn/translations/api-browser/en.json +1 -0
  158. package/dist/cdn/translations/i18n-editor/en.json +10 -0
  159. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.d.ts +2 -0
  160. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +29 -17
  161. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
  162. package/dist/elements/public/ApiBrowser/ApiBrowser.d.ts +2 -1
  163. package/dist/elements/public/ApiBrowser/ApiBrowser.js +38 -15
  164. package/dist/elements/public/ApiBrowser/ApiBrowser.js.map +1 -1
  165. package/dist/elements/public/I18nEditor/I18nEditor.d.ts +18 -0
  166. package/dist/elements/public/I18nEditor/I18nEditor.js +173 -0
  167. package/dist/elements/public/I18nEditor/I18nEditor.js.map +1 -0
  168. package/dist/elements/public/I18nEditor/index.d.ts +7 -0
  169. package/dist/elements/public/I18nEditor/index.js +9 -0
  170. package/dist/elements/public/I18nEditor/index.js.map +1 -0
  171. package/dist/elements/public/I18nEditor/internal/InternalI18nEditorEntry/InternalI18nEditorEntry.d.ts +17 -0
  172. package/dist/elements/public/I18nEditor/internal/InternalI18nEditorEntry/InternalI18nEditorEntry.js +169 -0
  173. package/dist/elements/public/I18nEditor/internal/InternalI18nEditorEntry/InternalI18nEditorEntry.js.map +1 -0
  174. package/dist/elements/public/I18nEditor/internal/InternalI18nEditorEntry/index.d.ts +6 -0
  175. package/dist/elements/public/I18nEditor/internal/InternalI18nEditorEntry/index.js +8 -0
  176. package/dist/elements/public/I18nEditor/internal/InternalI18nEditorEntry/index.js.map +1 -0
  177. package/dist/elements/public/I18nEditor/internal/InternalI18nEditorEntry/types.d.ts +3 -0
  178. package/dist/elements/public/I18nEditor/internal/InternalI18nEditorEntry/types.js +2 -0
  179. package/dist/elements/public/I18nEditor/internal/InternalI18nEditorEntry/types.js.map +1 -0
  180. package/dist/elements/public/I18nEditor/types.d.ts +4 -0
  181. package/dist/elements/public/I18nEditor/types.js +2 -0
  182. package/dist/elements/public/I18nEditor/types.js.map +1 -0
  183. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/InternalItemCategoryFormTaxesControlItem.js +0 -2
  184. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/InternalItemCategoryFormTaxesControlItem.js.map +1 -1
  185. package/dist/elements/public/StoreForm/StoreForm.js +2 -10
  186. package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
  187. package/dist/elements/public/TemplateSetForm/TemplateSetForm.d.ts +1 -0
  188. package/dist/elements/public/TemplateSetForm/TemplateSetForm.js +29 -18
  189. package/dist/elements/public/TemplateSetForm/TemplateSetForm.js.map +1 -1
  190. package/dist/elements/public/TemplateSetForm/index.d.ts +1 -0
  191. package/dist/elements/public/TemplateSetForm/index.js +1 -0
  192. package/dist/elements/public/TemplateSetForm/index.js.map +1 -1
  193. package/dist/elements/public/index.d.ts +1 -0
  194. package/dist/elements/public/index.defined.d.ts +1 -0
  195. package/dist/elements/public/index.defined.js +1 -0
  196. package/dist/elements/public/index.defined.js.map +1 -1
  197. package/dist/elements/public/index.js +1 -0
  198. package/dist/elements/public/index.js.map +1 -1
  199. package/dist/mixins/responsive.js +3 -3
  200. package/dist/mixins/responsive.js.map +1 -1
  201. package/dist/mixins/themeable.js +264 -0
  202. package/dist/mixins/themeable.js.map +1 -1
  203. package/package.json +2 -2
  204. package/dist/cdn/shared-193a0fb1.js +0 -1
  205. package/dist/cdn/shared-2af327d0.js +0 -15
  206. package/dist/cdn/shared-a420358e.js +0 -1
  207. package/dist/cdn/shared-a83b38f1.js +0 -1
  208. package/dist/cdn/shared-d82f3ba0.js +0 -1
  209. package/dist/cdn/shared-f14201ed.js +0 -1
@@ -1 +1 @@
1
- import"./shared-e4bc532a.js";import"./shared-7af4d4b6.js";import{I as t}from"./shared-17d5d718.js";import"./shared-59d73648.js";import"./foxy-copy-to-clipboard.js";import"./shared-4623f740.js";import{_ as e}from"./shared-a8ced8bf.js";import{a as s}from"./shared-ff13276c.js";import{h as o}from"./shared-7f33a83a.js";import"./shared-3d0dc4a6.js";import"./shared-08d6d02b.js";import"./shared-77970922.js";import"./shared-de385bdb.js";import"./shared-d3bf9ac0.js";import"./shared-77359cd0.js";import"./shared-0479553e.js";import"./shared-a8966936.js";import"./shared-2af327d0.js";import"./shared-4f037e43.js";import"./shared-15278fe0.js";import"./shared-a420358e.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";import"./shared-b5b5c848.js";import"./shared-6822bc96.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-a98a6602.js";import"./shared-3b22a756.js";let r,a,n,d,c,i,l,p=t=>t;const m=s(t,"integration-form");class y extends m{constructor(){super(...arguments),this.__postResponse=null}static get properties(){return e(e({},super.properties),{},{__postResponse:{attribute:!1}})}static get v8n(){return[({project_name:t})=>!!t||"project-name:v8n_required"]}renderBody(){return this.data?this.__renderSnapshotBody():this.__renderTemplateBody()}async _fetch(...t){var e;const s=this.constructor,o=await new s.API(this).fetch(...t),r="string"==typeof t[0]?null===(e=t[1])||void 0===e?void 0:e.method:t[0].method,a="string"==typeof t[0]?t[0]:t[0].url;if(!o.ok)throw o;const n=await o.json();return"POST"===(null==r?void 0:r.toUpperCase())&&a===this.parent&&(this.__postResponse=n),n}__renderSnapshotBody(){var t,e;const s=this.data,l=new Date(1e3*(null!==(t=s.expires)&&void 0!==t?t:0)),m=(null===(e=s.project_description)||void 0===e?void 0:e.trim())||this.t("no_description");return o(r||(r=p` <dl class="grid grid-cols-1 gap-s"> <dt class="sr-only">${0}</dt> <dd class="font-bold truncate text-xl">${0}&ZeroWidthSpace;</dd> <dt class="sr-only">${0}</dt> <dd class="text-secondary">${0}&ZeroWidthSpace;</dd> </dl> ${0} <table class="font-lumo text-m leading-m w-full"> <tbody class="divide-y divide-contrast-10"> <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m font-semibold"> <foxy-i18n infer="" key="added_by"></foxy-i18n> </td> <td class="max-w-0 truncate py-s text-body w-2-3"> ${0} </td> </tr> <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m font-semibold"> <foxy-i18n infer="" key="contact"></foxy-i18n> </td> <td class="max-w-0 truncate py-s text-body w-2-3"> ${0} </td> </tr> <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m font-semibold"> <foxy-i18n infer="" key="company"></foxy-i18n> </td> <td class="max-w-0 truncate py-s text-body w-2-3"> ${0} </td> </tr> <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m font-semibold"> <foxy-i18n infer="" key="expires"></foxy-i18n> </td> <td class="max-w-0 truncate py-s text-body w-2-3"> <foxy-i18n infer="" key="expires_date" .options="${0}"></foxy-i18n> </td> </tr> <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m font-semibold">Client ID</td> <td class="max-w-0 truncate py-s text-body w-2-3"> <div class="flex items-center gap-s"> <code class="truncate flex-1">${0}</code> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="inline-block" text="${0}"> </foxy-copy-to-clipboard> </div> </td> </tr> ${0} <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m font-semibold">Scope</td> <td class="max-w-0 truncate py-s text-body w-2-3"><code>${0}</code></td> </tr> </tbody> </table> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `),this.t("title_description"),s.project_name,this.t("subtitle_description"),m,this.__postResponse?o(a||(a=p` <div class="bg-success-10 text-success p-m pb-s space-y-xs leading-s rounded-t-l rounded-b-l"> <foxy-i18n infer="" class="block" key="post_success_message"></foxy-i18n> <vaadin-button theme="tertiary contrast" class="p-0" @click="${0}"> <foxy-i18n infer="" key="post_success_action"></foxy-i18n> </vaadin-button> </div> `),(()=>this.__postResponse=null)):"",s.added_by_email?o(n||(n=p` <a target="_blank" class="font-semibold text-primary rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="mailto:${0}"> ${0} </a> `),s.added_by_email,s.added_by_name):s.added_by_name,s.contact_email?o(d||(d=p` <a target="_blank" class="font-semibold text-primary rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="mailto:${0}"> ${0} </a> `),s.contact_email,s.contact_name):s.contact_name,s.company_url?o(c||(c=p` <a target="_blank" class="font-semibold text-primary rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> ${0} </a> `),s.company_url,s.company_name):s.company_name,{date:l},s.client_id,s.client_id,this.__postResponse?o(i||(i=p` <tr class="font-semibold text-success"> <td class="max-w-0 truncate py-s w-1-3 pr-m font-semibold">Client secret</td> <td class="max-w-0 py-s w-2-3"> <div class="flex items-center gap-s"> <code class="truncate flex-1">${0}</code> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="inline-block" text="${0}"> </foxy-copy-to-clipboard> </div> </td> </tr> <tr class="font-semibold text-success"> <td class="max-w-0 truncate py-s w-1-3 pr-m font-semibold">Refresh token</td> <td class="max-w-0 py-s w-2-3"> <div class="flex items-center gap-s"> <code class="truncate flex-1">${0}</code> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="inline-block" text="${0}"> </foxy-copy-to-clipboard> </div> </td> </tr> <tr class="font-semibold text-success"> <td class="max-w-0 truncate py-s w-1-3 pr-m font-semibold">Access token</td> <td class="max-w-0 py-s w-2-3"> <div class="flex items-center gap-s"> <code class="truncate flex-1">${0}</code> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="inline-block" text="${0}"> </foxy-copy-to-clipboard> </div> </td> </tr> `),this.__postResponse.client_secret,this.__postResponse.client_secret,this.__postResponse.refresh_token,this.__postResponse.refresh_token,this.__postResponse.access_token,this.__postResponse.access_token):"",s.scope)}__renderTemplateBody(){return o(l||(l=p` <foxy-internal-text-control infer="project-name"></foxy-internal-text-control> <foxy-internal-text-area-control infer="project-description"> </foxy-internal-text-area-control> <foxy-internal-create-control infer="create"></foxy-internal-create-control> `))}}customElements.define("foxy-integration-form",y);export{y as IntegrationForm};
1
+ import"./shared-b8e9b536.js";import"./shared-8d533e0c.js";import{I as t}from"./shared-92bd849f.js";import"./shared-71deb26e.js";import"./foxy-copy-to-clipboard.js";import"./shared-0672e78b.js";import{_ as e}from"./shared-a8ced8bf.js";import{a as s}from"./shared-29e21467.js";import{h as o}from"./shared-7f33a83a.js";import"./shared-7b167fe9.js";import"./shared-c52d3772.js";import"./shared-6d2064e9.js";import"./shared-2215e6c8.js";import"./shared-6b8874a7.js";import"./shared-d3bf9ac0.js";import"./shared-4c338ca6.js";import"./shared-0479553e.js";import"./shared-5ad8c9a0.js";import"./shared-002b788f.js";import"./shared-4f037e43.js";import"./shared-b7423eab.js";import"./shared-dc798bf4.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";import"./shared-ef0fc329.js";import"./shared-4975f86f.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-c484320b.js";import"./shared-ea316e64.js";let r,a,n,c,d,i,l,p=t=>t;const m=s(t,"integration-form");class y extends m{constructor(){super(...arguments),this.__postResponse=null}static get properties(){return e(e({},super.properties),{},{__postResponse:{attribute:!1}})}static get v8n(){return[({project_name:t})=>!!t||"project-name:v8n_required"]}renderBody(){return this.data?this.__renderSnapshotBody():this.__renderTemplateBody()}async _fetch(...t){var e;const s=this.constructor,o=await new s.API(this).fetch(...t),r="string"==typeof t[0]?null===(e=t[1])||void 0===e?void 0:e.method:t[0].method,a="string"==typeof t[0]?t[0]:t[0].url;if(!o.ok)throw o;const n=await o.json();return"POST"===(null==r?void 0:r.toUpperCase())&&a===this.parent&&(this.__postResponse=n),n}__renderSnapshotBody(){var t,e;const s=this.data,l=new Date(1e3*(null!==(t=s.expires)&&void 0!==t?t:0)),m=(null===(e=s.project_description)||void 0===e?void 0:e.trim())||this.t("no_description");return o(r||(r=p` <dl class="grid grid-cols-1 gap-s"> <dt class="sr-only">${0}</dt> <dd class="font-bold truncate text-xl">${0}&ZeroWidthSpace;</dd> <dt class="sr-only">${0}</dt> <dd class="text-secondary">${0}&ZeroWidthSpace;</dd> </dl> ${0} <table class="font-lumo text-m leading-m w-full"> <tbody class="divide-y divide-contrast-10"> <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m font-semibold"> <foxy-i18n infer="" key="added_by"></foxy-i18n> </td> <td class="max-w-0 truncate py-s text-body w-2-3"> ${0} </td> </tr> <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m font-semibold"> <foxy-i18n infer="" key="contact"></foxy-i18n> </td> <td class="max-w-0 truncate py-s text-body w-2-3"> ${0} </td> </tr> <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m font-semibold"> <foxy-i18n infer="" key="company"></foxy-i18n> </td> <td class="max-w-0 truncate py-s text-body w-2-3"> ${0} </td> </tr> <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m font-semibold"> <foxy-i18n infer="" key="expires"></foxy-i18n> </td> <td class="max-w-0 truncate py-s text-body w-2-3"> <foxy-i18n infer="" key="expires_date" .options="${0}"></foxy-i18n> </td> </tr> <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m font-semibold">Client ID</td> <td class="max-w-0 truncate py-s text-body w-2-3"> <div class="flex items-center gap-s"> <code class="truncate flex-1">${0}</code> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="inline-block" text="${0}"> </foxy-copy-to-clipboard> </div> </td> </tr> ${0} <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m font-semibold">Scope</td> <td class="max-w-0 truncate py-s text-body w-2-3"><code>${0}</code></td> </tr> </tbody> </table> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `),this.t("title_description"),s.project_name,this.t("subtitle_description"),m,this.__postResponse?o(a||(a=p` <div class="bg-success-10 text-success p-m pb-s space-y-xs leading-s rounded-t-l rounded-b-l"> <foxy-i18n infer="" class="block" key="post_success_message"></foxy-i18n> <vaadin-button theme="tertiary contrast" class="p-0" @click="${0}"> <foxy-i18n infer="" key="post_success_action"></foxy-i18n> </vaadin-button> </div> `),(()=>this.__postResponse=null)):"",s.added_by_email?o(n||(n=p` <a target="_blank" class="font-semibold text-primary rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="mailto:${0}"> ${0} </a> `),s.added_by_email,s.added_by_name):s.added_by_name,s.contact_email?o(c||(c=p` <a target="_blank" class="font-semibold text-primary rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="mailto:${0}"> ${0} </a> `),s.contact_email,s.contact_name):s.contact_name,s.company_url?o(d||(d=p` <a target="_blank" class="font-semibold text-primary rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> ${0} </a> `),s.company_url,s.company_name):s.company_name,{date:l},s.client_id,s.client_id,this.__postResponse?o(i||(i=p` <tr class="font-semibold text-success"> <td class="max-w-0 truncate py-s w-1-3 pr-m font-semibold">Client secret</td> <td class="max-w-0 py-s w-2-3"> <div class="flex items-center gap-s"> <code class="truncate flex-1">${0}</code> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="inline-block" text="${0}"> </foxy-copy-to-clipboard> </div> </td> </tr> <tr class="font-semibold text-success"> <td class="max-w-0 truncate py-s w-1-3 pr-m font-semibold">Refresh token</td> <td class="max-w-0 py-s w-2-3"> <div class="flex items-center gap-s"> <code class="truncate flex-1">${0}</code> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="inline-block" text="${0}"> </foxy-copy-to-clipboard> </div> </td> </tr> <tr class="font-semibold text-success"> <td class="max-w-0 truncate py-s w-1-3 pr-m font-semibold">Access token</td> <td class="max-w-0 py-s w-2-3"> <div class="flex items-center gap-s"> <code class="truncate flex-1">${0}</code> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="inline-block" text="${0}"> </foxy-copy-to-clipboard> </div> </td> </tr> `),this.__postResponse.client_secret,this.__postResponse.client_secret,this.__postResponse.refresh_token,this.__postResponse.refresh_token,this.__postResponse.access_token,this.__postResponse.access_token):"",s.scope)}__renderTemplateBody(){return o(l||(l=p` <foxy-internal-text-control infer="project-name"></foxy-internal-text-control> <foxy-internal-text-area-control infer="project-description"> </foxy-internal-text-area-control> <foxy-internal-create-control infer="create"></foxy-internal-create-control> `))}}customElements.define("foxy-integration-form",y);export{y as IntegrationForm};
@@ -1 +1 @@
1
- import{I as e}from"./shared-1d851ca7.js";import"./shared-4623f740.js";import{_ as i}from"./shared-a8ced8bf.js";import{a as t}from"./shared-ff13276c.js";import{h as s}from"./shared-7f33a83a.js";import{i as r}from"./shared-d3bf9ac0.js";import{C as a}from"./shared-a8966936.js";import"./foxy-spinner.js";import"./shared-a98a6602.js";import"./shared-08d6d02b.js";import"./shared-3b22a756.js";import"./shared-4f037e43.js";import"./shared-2af327d0.js";import"./shared-15278fe0.js";import"./shared-a420358e.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";import"./shared-4e709717.js";let d,l,o,n,c,h,p=e=>e;const f=a(t(e,"item-card"));class u extends f{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}static get properties(){return i(i({},super.properties),{},{__currencyDisplay:{attribute:!1},__currency:{attribute:!1}})}renderBody(){var e,i,t,a,f,m,v,y,_;const x=null!==(i=null===(e=this.data)||void 0===e?void 0:e.quantity)&&void 0!==i?i:0,w=null!==(a=null===(t=this.data)||void 0===t?void 0:t.price)&&void 0!==a?a:0,L=x*w,C=null===(m=null===(f=this.data)||void 0===f?void 0:f._embedded)||void 0===m?void 0:m["fx:item_options"];return s(d||(d=p` <div class="flex items-start space-x-m leading-m"> <div class="w-l h-l relative flex-shrink-0"> <img class="relative w-full h-full object-cover rounded" src="${0}" alt="" @error="${0}"> <div class="border border-contrast-10 absolute inset-0 rounded"></div> </div> <div class="flex-1 min-w-0"> <div class="flex-1 h-l flex items-center"> <div class="flex-1 leading-s"> <div class="font-semibold text-m truncate">${0}</div> <div class="text-secondary text-m truncate"> ${0} &times; <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> &equals; <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> </div> </div> ${0} </div> ${0} </div> </div> `),r(null===(v=this.data)||void 0===v?void 0:v.image),(e=>{e.currentTarget.src=u.__placeholder}),null===(y=this.data)||void 0===y?void 0:y.name,x,JSON.stringify({amount:`${w} ${this.__currency}`,currencyDisplay:this.__currencyDisplay}),JSON.stringify({amount:`${L} ${this.__currency}`,currencyDisplay:this.__currencyDisplay}),(null===(_=this.data)||void 0===_?void 0:_.subscription_frequency)?s(l||(l=p` <div class="w-xs h-xs flex items-center justify-center rounded-full bg-contrast-5"> <iron-icon icon="icons:autorenew" class="icon-inline text-s"></iron-icon> </div> `)):"",C&&C.length>0?s(o||(o=p` <div class="mt-s"> ${0} </div> `),C.map((e=>s(n||(n=p` <div data-testclass="option" class="flex items-center text-m space-x-xs leading-m"> <div class="flex-1 text-tertiary truncate"> ${0}: ${0} </div> ${0} ${0} </div> `),e.name,e.value,e.price_mod?s(c||(c=p` <div class="${0} rounded px-xs truncate"> <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> </div> `),e.price_mod>0?"text-success":"text-error",JSON.stringify({amount:`${e.price_mod} ${this.__currency}`,currencyDisplay:this.__currencyDisplay})):"",e.weight_mod?s(h||(h=p` <div class="${0} rounded px-xs truncate"> ${0} <foxy-i18n key="wgt" infer=""></foxy-i18n> </div> `),e.price_mod>0?"text-success":"text-error",e.weight_mod):"")))):"")}async _sendGet(){const e=await super._sendGet(),[i,t]=await Promise.all([super._fetch(e._links["fx:transaction"].href),super._fetch(e._links["fx:store"].href)]);return this.__currency=i.currency_code,this.__currencyDisplay=t.use_international_currency_symbol?"code":"symbol",e}}u.__placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E',customElements.define("foxy-item-card",u);export{u as ItemCard};
1
+ import{I as e}from"./shared-6e6ed30a.js";import"./shared-0672e78b.js";import{_ as i}from"./shared-a8ced8bf.js";import{a as t}from"./shared-29e21467.js";import{h as s}from"./shared-7f33a83a.js";import{i as r}from"./shared-d3bf9ac0.js";import{C as a}from"./shared-5ad8c9a0.js";import"./foxy-spinner.js";import"./shared-c484320b.js";import"./shared-c52d3772.js";import"./shared-ea316e64.js";import"./shared-4f037e43.js";import"./shared-002b788f.js";import"./shared-b7423eab.js";import"./shared-dc798bf4.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";import"./shared-4e709717.js";let d,l,o,c,n,h,p=e=>e;const f=a(t(e,"item-card"));class u extends f{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}static get properties(){return i(i({},super.properties),{},{__currencyDisplay:{attribute:!1},__currency:{attribute:!1}})}renderBody(){var e,i,t,a,f,m,v,y,_;const x=null!==(i=null===(e=this.data)||void 0===e?void 0:e.quantity)&&void 0!==i?i:0,w=null!==(a=null===(t=this.data)||void 0===t?void 0:t.price)&&void 0!==a?a:0,L=x*w,C=null===(m=null===(f=this.data)||void 0===f?void 0:f._embedded)||void 0===m?void 0:m["fx:item_options"];return s(d||(d=p` <div class="flex items-start space-x-m leading-m"> <div class="w-l h-l relative flex-shrink-0"> <img class="relative w-full h-full object-cover rounded" src="${0}" alt="" @error="${0}"> <div class="border border-contrast-10 absolute inset-0 rounded"></div> </div> <div class="flex-1 min-w-0"> <div class="flex-1 h-l flex items-center"> <div class="flex-1 leading-s"> <div class="font-semibold text-m truncate">${0}</div> <div class="text-secondary text-m truncate"> ${0} &times; <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> &equals; <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> </div> </div> ${0} </div> ${0} </div> </div> `),r(null===(v=this.data)||void 0===v?void 0:v.image),(e=>{e.currentTarget.src=u.__placeholder}),null===(y=this.data)||void 0===y?void 0:y.name,x,JSON.stringify({amount:`${w} ${this.__currency}`,currencyDisplay:this.__currencyDisplay}),JSON.stringify({amount:`${L} ${this.__currency}`,currencyDisplay:this.__currencyDisplay}),(null===(_=this.data)||void 0===_?void 0:_.subscription_frequency)?s(l||(l=p` <div class="w-xs h-xs flex items-center justify-center rounded-full bg-contrast-5"> <iron-icon icon="icons:autorenew" class="icon-inline text-s"></iron-icon> </div> `)):"",C&&C.length>0?s(o||(o=p` <div class="mt-s"> ${0} </div> `),C.map((e=>s(c||(c=p` <div data-testclass="option" class="flex items-center text-m space-x-xs leading-m"> <div class="flex-1 text-tertiary truncate"> ${0}: ${0} </div> ${0} ${0} </div> `),e.name,e.value,e.price_mod?s(n||(n=p` <div class="${0} rounded px-xs truncate"> <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> </div> `),e.price_mod>0?"text-success":"text-error",JSON.stringify({amount:`${e.price_mod} ${this.__currency}`,currencyDisplay:this.__currencyDisplay})):"",e.weight_mod?s(h||(h=p` <div class="${0} rounded px-xs truncate"> ${0} <foxy-i18n key="wgt" infer=""></foxy-i18n> </div> `),e.price_mod>0?"text-success":"text-error",e.weight_mod):"")))):"")}async _sendGet(){const e=await super._sendGet(),[i,t]=await Promise.all([super._fetch(e._links["fx:transaction"].href),super._fetch(e._links["fx:store"].href)]);return this.__currency=i.currency_code,this.__currencyDisplay=t.use_international_currency_symbol?"code":"symbol",e}}u.__placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E',customElements.define("foxy-item-card",u);export{u as ItemCard};
@@ -1 +1 @@
1
- import{I as s}from"./shared-1d851ca7.js";import{h as e}from"./shared-7f33a83a.js";import"./foxy-spinner.js";import"./shared-a98a6602.js";import"./shared-08d6d02b.js";import"./shared-ff13276c.js";import"./shared-a8ced8bf.js";import"./shared-3b22a756.js";import"./shared-4623f740.js";import"./shared-2af327d0.js";import"./shared-4f037e43.js";import"./shared-15278fe0.js";import"./shared-a420358e.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";import"./shared-4e709717.js";let r,a,d=s=>s;class t extends s{renderBody(){const s=this.data;return e(r||(r=d` <div class="flex justify-between gap-s"> <div class="font-semibold truncate flex-shrink-0">${0}&ZeroWidthSpace;</div> ${0} </div> `),null==s?void 0:s.name,(null==s?void 0:s.name)!==(null==s?void 0:s.code)?e(a||(a=d`<div class="truncate text-tertiary">${0}</div>`),null==s?void 0:s.code):"")}}customElements.define("foxy-item-category-card",t);export{t as ItemCategoryCard};
1
+ import{I as e}from"./shared-6e6ed30a.js";import{h as s}from"./shared-7f33a83a.js";import"./foxy-spinner.js";import"./shared-c484320b.js";import"./shared-c52d3772.js";import"./shared-29e21467.js";import"./shared-a8ced8bf.js";import"./shared-ea316e64.js";import"./shared-0672e78b.js";import"./shared-002b788f.js";import"./shared-4f037e43.js";import"./shared-b7423eab.js";import"./shared-dc798bf4.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";import"./shared-4e709717.js";let r,d,t=e=>e;class a extends e{renderBody(){const e=this.data;return s(r||(r=t` <div class="flex justify-between gap-s"> <div class="font-semibold truncate flex-shrink-0">${0}&ZeroWidthSpace;</div> ${0} </div> `),null==e?void 0:e.name,(null==e?void 0:e.name)!==(null==e?void 0:e.code)?s(d||(d=t`<div class="truncate text-tertiary">${0}</div>`),null==e?void 0:e.code):"")}}customElements.define("foxy-item-category-card",a);export{a as ItemCategoryCard};
@@ -1 +1 @@
1
- import"./shared-a0c09692.js";import"./shared-b1b40832.js";import"./shared-28b09f69.js";import"./shared-1e9dc71f.js";import"./shared-59d73648.js";import{I as e}from"./shared-17d5d718.js";import"./foxy-discount-builder.js";import{I as t}from"./shared-77359cd0.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";import"./shared-03d5434f.js";import"./foxy-nucleon-element.js";import{TaxCard as n}from"./foxy-tax-card.js";import{_ as r}from"./shared-a8ced8bf.js";import{i}from"./shared-d3bf9ac0.js";import{h as o}from"./shared-7f33a83a.js";import{a}from"./shared-ff13276c.js";import"./shared-7bfd93b7.js";import"./shared-3d0dc4a6.js";import"./shared-08d6d02b.js";import"./shared-de385bdb.js";import"./shared-a98a6602.js";import"./shared-a420358e.js";import"./shared-2af327d0.js";import"./shared-e6bff624.js";import"./shared-788e5ff5.js";import"./shared-0db7afef.js";import"./shared-4623f740.js";import"./shared-4f037e43.js";import"./shared-e4bc532a.js";import"./shared-b5b5c848.js";import"./shared-6822bc96.js";import"./shared-a8966936.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-3b22a756.js";import"./shared-15278fe0.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";import"./shared-d519a301.js";import"./shared-e6f3e9f0.js";import"./shared-0479553e.js";import"./shared-11c2efc8.js";import"./shared-1d851ca7.js";let l,s=e=>e;customElements.define("foxy-internal-item-category-form-taxes-control-item",class extends n{constructor(){super(...arguments),this.taxItemCategories=null,this.itemCategory=null,this.__resourceElementIsBusy=!1,this.__queryElementData=null}static get properties(){return r(r({},super.properties),{},{taxItemCategories:{type:String,attribute:"tax-item-categories"},itemCategory:{type:String,attribute:"item-category"}})}render(){var e,t,n,r,a;const d=null===(n=null===(t=null===(e=this.__queryElementData)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:tax_item_categories"])||void 0===n?void 0:n[0];let m;try{const e=new URL(null!==(r=this.taxItemCategories)&&void 0!==r?r:""),t=new URL(this.href).pathname.split("/").pop();if(!t)throw new Error;e.searchParams.set("tax_id",t),e.searchParams.set("limit","1"),m=e.toString()}catch(e){m=void 0}return o(l||(l=s` <foxy-nucleon href="${0}" id="query" @update="${0}"> <foxy-nucleon parent="${0}" href="${0}" id="resource" @update="${0}"> </foxy-nucleon> </foxy-nucleon> <vaadin-checkbox class="px-m py-s block overflow-hidden" ?disabled="${0}" ?checked="${0}" @change="${0}"> ${0} </vaadin-checkbox> `),i(m),(e=>{const t=e.currentTarget;this.__queryElementData=t.data,this.requestUpdate()}),i(null!==(a=this.taxItemCategories)&&void 0!==a?a:void 0),i(null==d?void 0:d._links.self.href),(e=>{const t=e.currentTarget;this.__resourceElementIsBusy=!t.in("idle"),this.requestUpdate()}),!this.__queryElementData||this.__resourceElementIsBusy||this.disabled,!!d,(e=>{const t=e.currentTarget,n=this.renderRoot.querySelector("#resource");t.checked?(n.edit({tax_uri:this.data._links.self.href,item_category_uri:this.itemCategory}),n.submit()):n.delete()}),super.render())}});let d,m=e=>e;customElements.define("foxy-internal-item-category-form-taxes-control",class extends t{constructor(){super(...arguments),this.taxes=null}static get properties(){return r(r({},super.properties),{},{taxes:{type:String}})}renderControl(){var e,t,n,r;const i=this.nucleon;let a;try{const t=new URL(null!==(e=this.taxes)&&void 0!==e?e:"");t.searchParams.set("limit","5"),a=t.toString()}catch(e){a=null!==(t=this.taxes)&&void 0!==t?t:""}return o(d||(d=m` <foxy-i18n class="block text-s font-medium text-secondary leading-none mb-s" infer="" key="title"> </foxy-i18n> <foxy-pagination first="${0}" infer="pagination"> <foxy-collection-page class="block mb-s divide-y divide-contrast-10 border border-contrast-10 rounded-t-l rounded-b-l" infer="" item="foxy-internal-item-category-form-taxes-control-item" .props="${0}"> </foxy-collection-page> </foxy-pagination> <foxy-i18n class="block text-xs text-secondary leading-xs mt-xs" infer="" key="helper_text"> </foxy-i18n> `),a,{"tax-item-categories":null!==(r=null===(n=null==i?void 0:i.form._links)||void 0===n?void 0:n["fx:tax_item_categories"].href)&&void 0!==r?r:"","item-category":null==i?void 0:i.href})}});let p,c,_,f,u,h,y,g,x,v,b,j,$,w=e=>e;class q extends(a(e,"item-category-form")){constructor(){super(...arguments),this.emailTemplates=null,this.taxes=null}static get properties(){return r(r({},super.properties),{},{emailTemplates:{type:String,attribute:"email-templates"},taxes:{type:String}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>e&&e.length<=50||"code:v8n_too_long",({name:e})=>!!e||"name:v8n_required",({name:e})=>e&&e.length<=50||"name:v8n_too_long",({item_delivery_type:e})=>!!e||"item-delivery-type:v8n_required",({item_delivery_type:e,max_downloads_per_customer:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-per-customer:v8n_required",({max_downloads_per_customer:e})=>"number"!=typeof e||e>=0||"max-downloads-per-customer:v8n_negative",({item_delivery_type:e,max_downloads_time_period:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-time-period:v8n_required",({max_downloads_time_period:e})=>"number"!=typeof e||e>=0||"max-downloads-time-period:v8n_negative",({customs_value:e})=>"number"!=typeof e||e>=0||"customs-value:v8n_negative",({item_delivery_type:e,default_weight:t})=>"shipped"!==e||"number"==typeof t||"default-weight:v8n_required",({default_weight:e})=>"number"!=typeof e||e>=0||"default-weight:v8n_negative",({item_delivery_type:e,default_weight_unit:t})=>"shipped"!==e||"string"==typeof t||"default-weight-unit:v8n_required",({item_delivery_type:e,default_length_unit:t})=>"shipped"!==e||"string"==typeof t||"default-length-unit:v8n_required",({item_delivery_type:e,shipping_flat_rate:t})=>"flat_rate"!==e||"number"==typeof t||"shipping-flat-rate:v8n_required",({shipping_flat_rate:e})=>"number"!=typeof e||e>=0||"shipping-flat-rate:v8n_negative",({item_delivery_type:e,shipping_flat_rate_type:t})=>"flat_rate"!==e||"string"==typeof t||"shipping-flat-rate-type:v8n_required",({handling_fee_type:e})=>!!e||"handling-fee-type:v8n_required",({handling_fee_type:e,handling_fee_minimum:t})=>"flat_percent_with_minimum"!==e||"number"==typeof t||"handling-fee-minimum:v8n_required",({handling_fee_minimum:e})=>"number"!=typeof e||e>=0||"handling-fee-minimum:v8n_negative",({handling_fee_type:e,handling_fee_percentage:t})=>"flat_percent_with_minimum"!==e&&"flat_percent"!==e||"number"==typeof t||"handling-fee-percentage:v8n_required",({handling_fee_percentage:e})=>"number"!=typeof e||e>=0||"handling-fee-percentage:v8n_negative",({send_admin_email:e,admin_email:t})=>!e||!!t||"admin-email:v8n_required"]}renderBody(){var e,t,n,r;const a=this.form.item_delivery_type,l=null!==(e=this.form.handling_fee_type)&&void 0!==e?e:"none",s=!this.hiddenSelector.matches("dividers",!0),d=o(p||(p=w`<div class="border-t border-contrast-10 col-span-2"></div>`));return o(c||(c=w` <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="name" class="col-span-2"></foxy-internal-text-control> <foxy-internal-text-control infer="code" class="col-span-2"></foxy-internal-text-control> ${0} <foxy-internal-select-control infer="handling-fee-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} ${0} <foxy-internal-select-control infer="item-delivery-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} ${0} ${0} <foxy-internal-text-control infer="discount-name" class="col-span-2"> </foxy-internal-text-control> ${0} ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="admin-email-template-uri" class="${0}" @change="${0}"> </foxy-internal-async-combo-box-control> ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="customer-email-template-uri" class="col-span-2" @change="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="gift-recipient-email-template-uri" class="col-span-2"> </foxy-internal-async-combo-box-control> ${0} ${0} </div> ${0} `),s?d:"",q.__handlingFeeTypeOptions,"none"===l?"":o(_||(_=w` ${0} ${0} ${0} `),this.__renderHandlingFee(),l.includes("percent")?this.__renderHandlingFeePercentage():"","flat_percent_with_minimum"===l?this.__renderHandlingFeeMinimum():""),s?d:"",q.__itemDeliveryTypeOptions,"downloaded"===a?this.__renderDownloadDeliveryControls():"flat_rate"===a?this.__renderFlatRateControls():"shipped"===a?this.__renderShippingControls():"","shipped"===a||"flat_rate"===a?this.__renderCustomsValue():"",s?d:"",this.form.discount_name?this.__renderDiscountBuilder():"",s?d:"",i(null!==(t=this.emailTemplates)&&void 0!==t?t:void 0),this.form.send_admin_email?"":"col-span-2",(e=>{this.edit({send_admin_email:!!e.detail,admin_email:e.detail?this.form.admin_email:""})}),this.form.send_admin_email?this.__renderAdminEmail():"",i(null!==(n=this.emailTemplates)&&void 0!==n?n:void 0),(e=>this.edit({send_customer_email:!!e.detail})),i(null!==(r=this.emailTemplates)&&void 0!==r?r:void 0),s?d:"",this.data?this.__renderTaxes():"",super.renderBody())}__renderHandlingFee(){return o(f||(f=w` <foxy-internal-number-control infer="handling-fee" class="${0}"> </foxy-internal-number-control> `),"flat_percent"===this.form.handling_fee_type?"":"col-span-2")}__renderHandlingFeePercentage(){return o(u||(u=w` <foxy-internal-number-control infer="handling-fee-percentage"> </foxy-internal-number-control> `))}__renderHandlingFeeMinimum(){return o(h||(h=w` <foxy-internal-number-control infer="handling-fee-minimum"> </foxy-internal-number-control> `))}__renderDownloadDeliveryControls(){return o(y||(y=w` <foxy-internal-integer-control infer="max-downloads-per-customer"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="max-downloads-time-period"> </foxy-internal-integer-control> `))}__renderFlatRateControls(){return o(g||(g=w` <foxy-internal-number-control infer="shipping-flat-rate"> </foxy-internal-number-control> <foxy-internal-select-control infer="shipping-flat-rate-type" .options="${0}"> </foxy-internal-select-control> `),q.__shippingFlatRateTypeOptions)}__renderShippingControls(){return o(x||(x=w` <foxy-internal-integer-control infer="default-weight" class="col-span-2"> </foxy-internal-integer-control> <foxy-internal-select-control infer="default-weight-unit" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="default-length-unit" .options="${0}"> </foxy-internal-select-control> `),q.__defaultWeightUnitOptions,q.__defaultLengthUnitOptions)}__renderCustomsValue(){return o(v||(v=w` <foxy-internal-number-control infer="customs-value" class="col-span-2"> </foxy-internal-number-control> `))}__renderDiscountBuilder(){var e,t;const n={name:null!==(e=this.form.discount_name)&&void 0!==e?e:"",type:this.form.discount_type||"quantity_amount",details:null!==(t=this.form.discount_details)&&void 0!==t?t:""};return o(b||(b=w` <foxy-discount-builder infer="discount-builder" class="col-span-2" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> `),n,(e=>{const t=e.currentTarget;this.edit({discount_name:t.parsedValue.name,discount_type:t.parsedValue.type,discount_details:t.parsedValue.details})}))}__renderAdminEmail(){return o(j||(j=w`<foxy-internal-text-control infer="admin-email"> </foxy-internal-text-control>`))}__renderTaxes(){var e;return o($||($=w` <foxy-internal-item-category-form-taxes-control taxes="${0}" class="col-span-2" infer="taxes"> </foxy-internal-item-category-form-taxes-control> `),i(null!==(e=this.taxes)&&void 0!==e?e:void 0))}}q.__shippingFlatRateTypeOptions=[{label:"option_per_order",value:"per_order"},{label:"option_per_shipment",value:"per_shipment"}],q.__defaultWeightUnitOptions=[{label:"option_lbs",value:"LBS"},{label:"option_kgs",value:"KGS"}],q.__defaultLengthUnitOptions=[{label:"option_in",value:"IN"},{label:"option_cm",value:"CM"}],q.__itemDeliveryTypeOptions=[{label:"option_notshipped",value:"notshipped"},{label:"option_downloaded",value:"downloaded"},{label:"option_flat_rate",value:"flat_rate"},{label:"option_shipped",value:"shipped"},{label:"option_pickup",value:"pickup"}],q.__handlingFeeTypeOptions=[{label:"option_none",value:"none"},{label:"option_flat_per_order",value:"flat_per_order"},{label:"option_flat_per_item",value:"flat_per_item"},{label:"option_flat_percent",value:"flat_percent"},{label:"option_flat_percent_with_minimum",value:"flat_percent_with_minimum"}],customElements.define("foxy-item-category-form",q);export{q as ItemCategoryForm};
1
+ import"./shared-2f1e04ae.js";import"./shared-40d82f6b.js";import"./shared-4457dc27.js";import"./shared-bd194cdf.js";import"./shared-71deb26e.js";import{I as e}from"./shared-92bd849f.js";import"./foxy-discount-builder.js";import{I as t}from"./shared-4c338ca6.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";import"./shared-85f9051e.js";import"./foxy-nucleon-element.js";import{TaxCard as n}from"./foxy-tax-card.js";import{_ as r}from"./shared-a8ced8bf.js";import{i}from"./shared-d3bf9ac0.js";import{h as o}from"./shared-7f33a83a.js";import{a}from"./shared-29e21467.js";import"./shared-b28dbc68.js";import"./shared-7b167fe9.js";import"./shared-c52d3772.js";import"./shared-6b8874a7.js";import"./shared-e396ec04.js";import"./shared-c484320b.js";import"./shared-2215e6c8.js";import"./shared-dc798bf4.js";import"./shared-002b788f.js";import"./shared-d43fc5cc.js";import"./shared-34b11d34.js";import"./shared-e3ce88dc.js";import"./shared-923da875.js";import"./shared-0672e78b.js";import"./shared-4f037e43.js";import"./shared-b8e9b536.js";import"./shared-ef0fc329.js";import"./shared-4975f86f.js";import"./shared-5ad8c9a0.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-ea316e64.js";import"./shared-b7423eab.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";import"./shared-d519a301.js";import"./shared-e6f3e9f0.js";import"./shared-0479553e.js";import"./shared-11c2efc8.js";import"./shared-6e6ed30a.js";let l,s=e=>e;customElements.define("foxy-internal-item-category-form-taxes-control-item",class extends n{constructor(){super(...arguments),this.taxItemCategories=null,this.itemCategory=null,this.__resourceElementIsBusy=!1,this.__queryElementData=null}static get properties(){return r(r({},super.properties),{},{taxItemCategories:{type:String,attribute:"tax-item-categories"},itemCategory:{type:String,attribute:"item-category"}})}render(){var e,t,n,r,a;const d=null===(n=null===(t=null===(e=this.__queryElementData)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:tax_item_categories"])||void 0===n?void 0:n[0];let m;try{const e=new URL(null!==(r=this.taxItemCategories)&&void 0!==r?r:""),t=new URL(this.href).pathname.split("/").pop();if(!t)throw new Error;e.searchParams.set("tax_id",t),e.searchParams.set("limit","1"),m=e.toString()}catch(e){m=void 0}return o(l||(l=s` <foxy-nucleon href="${0}" id="query" @update="${0}"> <foxy-nucleon parent="${0}" href="${0}" id="resource" @update="${0}"> </foxy-nucleon> </foxy-nucleon> <vaadin-checkbox class="px-m py-s block overflow-hidden" ?disabled="${0}" ?checked="${0}" @change="${0}"> ${0} </vaadin-checkbox> `),i(m),(e=>{const t=e.currentTarget;this.__queryElementData=t.data,this.requestUpdate()}),i(null!==(a=this.taxItemCategories)&&void 0!==a?a:void 0),i(null==d?void 0:d._links.self.href),(e=>{const t=e.currentTarget;this.__resourceElementIsBusy=!t.in("idle"),this.requestUpdate()}),!this.__queryElementData||this.__resourceElementIsBusy||this.disabled,!!d,(e=>{const t=e.currentTarget,n=this.renderRoot.querySelector("#resource");t.checked?(n.edit({tax_uri:this.data._links.self.href,item_category_uri:this.itemCategory}),n.submit()):n.delete()}),super.render())}});let d,m=e=>e;customElements.define("foxy-internal-item-category-form-taxes-control",class extends t{constructor(){super(...arguments),this.taxes=null}static get properties(){return r(r({},super.properties),{},{taxes:{type:String}})}renderControl(){var e,t,n,r;const i=this.nucleon;let a;try{const t=new URL(null!==(e=this.taxes)&&void 0!==e?e:"");t.searchParams.set("limit","5"),a=t.toString()}catch(e){a=null!==(t=this.taxes)&&void 0!==t?t:""}return o(d||(d=m` <foxy-i18n class="block text-s font-medium text-secondary leading-none mb-s" infer="" key="title"> </foxy-i18n> <foxy-pagination first="${0}" infer="pagination"> <foxy-collection-page class="block mb-s divide-y divide-contrast-10 border border-contrast-10 rounded-t-l rounded-b-l" infer="" item="foxy-internal-item-category-form-taxes-control-item" .props="${0}"> </foxy-collection-page> </foxy-pagination> <foxy-i18n class="block text-xs text-secondary leading-xs mt-xs" infer="" key="helper_text"> </foxy-i18n> `),a,{"tax-item-categories":null!==(r=null===(n=null==i?void 0:i.form._links)||void 0===n?void 0:n["fx:tax_item_categories"].href)&&void 0!==r?r:"","item-category":null==i?void 0:i.href})}});let p,c,_,f,u,h,y,g,x,v,b,j,$,w=e=>e;class q extends(a(e,"item-category-form")){constructor(){super(...arguments),this.emailTemplates=null,this.taxes=null}static get properties(){return r(r({},super.properties),{},{emailTemplates:{type:String,attribute:"email-templates"},taxes:{type:String}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>e&&e.length<=50||"code:v8n_too_long",({name:e})=>!!e||"name:v8n_required",({name:e})=>e&&e.length<=50||"name:v8n_too_long",({item_delivery_type:e})=>!!e||"item-delivery-type:v8n_required",({item_delivery_type:e,max_downloads_per_customer:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-per-customer:v8n_required",({max_downloads_per_customer:e})=>"number"!=typeof e||e>=0||"max-downloads-per-customer:v8n_negative",({item_delivery_type:e,max_downloads_time_period:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-time-period:v8n_required",({max_downloads_time_period:e})=>"number"!=typeof e||e>=0||"max-downloads-time-period:v8n_negative",({customs_value:e})=>"number"!=typeof e||e>=0||"customs-value:v8n_negative",({item_delivery_type:e,default_weight:t})=>"shipped"!==e||"number"==typeof t||"default-weight:v8n_required",({default_weight:e})=>"number"!=typeof e||e>=0||"default-weight:v8n_negative",({item_delivery_type:e,default_weight_unit:t})=>"shipped"!==e||"string"==typeof t||"default-weight-unit:v8n_required",({item_delivery_type:e,default_length_unit:t})=>"shipped"!==e||"string"==typeof t||"default-length-unit:v8n_required",({item_delivery_type:e,shipping_flat_rate:t})=>"flat_rate"!==e||"number"==typeof t||"shipping-flat-rate:v8n_required",({shipping_flat_rate:e})=>"number"!=typeof e||e>=0||"shipping-flat-rate:v8n_negative",({item_delivery_type:e,shipping_flat_rate_type:t})=>"flat_rate"!==e||"string"==typeof t||"shipping-flat-rate-type:v8n_required",({handling_fee_type:e})=>!!e||"handling-fee-type:v8n_required",({handling_fee_type:e,handling_fee_minimum:t})=>"flat_percent_with_minimum"!==e||"number"==typeof t||"handling-fee-minimum:v8n_required",({handling_fee_minimum:e})=>"number"!=typeof e||e>=0||"handling-fee-minimum:v8n_negative",({handling_fee_type:e,handling_fee_percentage:t})=>"flat_percent_with_minimum"!==e&&"flat_percent"!==e||"number"==typeof t||"handling-fee-percentage:v8n_required",({handling_fee_percentage:e})=>"number"!=typeof e||e>=0||"handling-fee-percentage:v8n_negative",({send_admin_email:e,admin_email:t})=>!e||!!t||"admin-email:v8n_required"]}renderBody(){var e,t,n,r;const a=this.form.item_delivery_type,l=null!==(e=this.form.handling_fee_type)&&void 0!==e?e:"none",s=!this.hiddenSelector.matches("dividers",!0),d=o(p||(p=w`<div class="border-t border-contrast-10 col-span-2"></div>`));return o(c||(c=w` <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="name" class="col-span-2"></foxy-internal-text-control> <foxy-internal-text-control infer="code" class="col-span-2"></foxy-internal-text-control> ${0} <foxy-internal-select-control infer="handling-fee-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} ${0} <foxy-internal-select-control infer="item-delivery-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} ${0} ${0} <foxy-internal-text-control infer="discount-name" class="col-span-2"> </foxy-internal-text-control> ${0} ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="admin-email-template-uri" class="${0}" @change="${0}"> </foxy-internal-async-combo-box-control> ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="customer-email-template-uri" class="col-span-2" @change="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="gift-recipient-email-template-uri" class="col-span-2"> </foxy-internal-async-combo-box-control> ${0} ${0} </div> ${0} `),s?d:"",q.__handlingFeeTypeOptions,"none"===l?"":o(_||(_=w` ${0} ${0} ${0} `),this.__renderHandlingFee(),l.includes("percent")?this.__renderHandlingFeePercentage():"","flat_percent_with_minimum"===l?this.__renderHandlingFeeMinimum():""),s?d:"",q.__itemDeliveryTypeOptions,"downloaded"===a?this.__renderDownloadDeliveryControls():"flat_rate"===a?this.__renderFlatRateControls():"shipped"===a?this.__renderShippingControls():"","shipped"===a||"flat_rate"===a?this.__renderCustomsValue():"",s?d:"",this.form.discount_name?this.__renderDiscountBuilder():"",s?d:"",i(null!==(t=this.emailTemplates)&&void 0!==t?t:void 0),this.form.send_admin_email?"":"col-span-2",(e=>{this.edit({send_admin_email:!!e.detail,admin_email:e.detail?this.form.admin_email:""})}),this.form.send_admin_email?this.__renderAdminEmail():"",i(null!==(n=this.emailTemplates)&&void 0!==n?n:void 0),(e=>this.edit({send_customer_email:!!e.detail})),i(null!==(r=this.emailTemplates)&&void 0!==r?r:void 0),s?d:"",this.data?this.__renderTaxes():"",super.renderBody())}__renderHandlingFee(){return o(f||(f=w` <foxy-internal-number-control infer="handling-fee" class="${0}"> </foxy-internal-number-control> `),"flat_percent"===this.form.handling_fee_type?"":"col-span-2")}__renderHandlingFeePercentage(){return o(u||(u=w` <foxy-internal-number-control infer="handling-fee-percentage"> </foxy-internal-number-control> `))}__renderHandlingFeeMinimum(){return o(h||(h=w` <foxy-internal-number-control infer="handling-fee-minimum"> </foxy-internal-number-control> `))}__renderDownloadDeliveryControls(){return o(y||(y=w` <foxy-internal-integer-control infer="max-downloads-per-customer"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="max-downloads-time-period"> </foxy-internal-integer-control> `))}__renderFlatRateControls(){return o(g||(g=w` <foxy-internal-number-control infer="shipping-flat-rate"> </foxy-internal-number-control> <foxy-internal-select-control infer="shipping-flat-rate-type" .options="${0}"> </foxy-internal-select-control> `),q.__shippingFlatRateTypeOptions)}__renderShippingControls(){return o(x||(x=w` <foxy-internal-integer-control infer="default-weight" class="col-span-2"> </foxy-internal-integer-control> <foxy-internal-select-control infer="default-weight-unit" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="default-length-unit" .options="${0}"> </foxy-internal-select-control> `),q.__defaultWeightUnitOptions,q.__defaultLengthUnitOptions)}__renderCustomsValue(){return o(v||(v=w` <foxy-internal-number-control infer="customs-value" class="col-span-2"> </foxy-internal-number-control> `))}__renderDiscountBuilder(){var e,t;const n={name:null!==(e=this.form.discount_name)&&void 0!==e?e:"",type:this.form.discount_type||"quantity_amount",details:null!==(t=this.form.discount_details)&&void 0!==t?t:""};return o(b||(b=w` <foxy-discount-builder infer="discount-builder" class="col-span-2" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> `),n,(e=>{const t=e.currentTarget;this.edit({discount_name:t.parsedValue.name,discount_type:t.parsedValue.type,discount_details:t.parsedValue.details})}))}__renderAdminEmail(){return o(j||(j=w`<foxy-internal-text-control infer="admin-email"> </foxy-internal-text-control>`))}__renderTaxes(){var e;return o($||($=w` <foxy-internal-item-category-form-taxes-control taxes="${0}" class="col-span-2" infer="taxes"> </foxy-internal-item-category-form-taxes-control> `),i(null!==(e=this.taxes)&&void 0!==e?e:void 0))}}q.__shippingFlatRateTypeOptions=[{label:"option_per_order",value:"per_order"},{label:"option_per_shipment",value:"per_shipment"}],q.__defaultWeightUnitOptions=[{label:"option_lbs",value:"LBS"},{label:"option_kgs",value:"KGS"}],q.__defaultLengthUnitOptions=[{label:"option_in",value:"IN"},{label:"option_cm",value:"CM"}],q.__itemDeliveryTypeOptions=[{label:"option_notshipped",value:"notshipped"},{label:"option_downloaded",value:"downloaded"},{label:"option_flat_rate",value:"flat_rate"},{label:"option_shipped",value:"shipped"},{label:"option_pickup",value:"pickup"}],q.__handlingFeeTypeOptions=[{label:"option_none",value:"none"},{label:"option_flat_per_order",value:"flat_per_order"},{label:"option_flat_per_item",value:"flat_per_item"},{label:"option_flat_percent",value:"flat_percent"},{label:"option_flat_percent_with_minimum",value:"flat_percent_with_minimum"}],customElements.define("foxy-item-category-form",q);export{q as ItemCategoryForm};
@@ -1 +1 @@
1
- import"./shared-b1b40832.js";import"./shared-0ff5e59d.js";import"./shared-28b09f69.js";import{I as t}from"./shared-59d73648.js";import{I as e}from"./shared-17d5d718.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-coupon-card.js";import"./shared-a0c09692.js";import{I as r}from"./shared-77359cd0.js";import"./foxy-discount-builder.js";import{i as o}from"./shared-d3bf9ac0.js";import{h as i}from"./shared-7f33a83a.js";import"./shared-03f7cc13.js";import"./shared-555ec39f.js";import{_ as n}from"./shared-a8ced8bf.js";import{s}from"./shared-bc7f58ef.js";import{p as a}from"./shared-9f53978e.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import{a as l}from"./shared-ff13276c.js";import"./shared-e6bff624.js";import"./shared-de385bdb.js";import"./shared-3d0dc4a6.js";import"./shared-08d6d02b.js";import"./shared-788e5ff5.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-a98a6602.js";import"./shared-3b22a756.js";import"./shared-4623f740.js";import"./shared-2af327d0.js";import"./shared-4f037e43.js";import"./shared-a8966936.js";import"./shared-15278fe0.js";import"./shared-a420358e.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";import"./shared-d519a301.js";import"./shared-11c2efc8.js";import"./foxy-pagination.js";import"./shared-e4bc532a.js";import"./shared-4e709717.js";import"./shared-b5b5c848.js";import"./shared-6822bc96.js";import"./shared-0479553e.js";import"./shared-c70b41e1.js";import"./shared-77970922.js";import"./shared-45c3705a.js";import"./shared-3f4f362e.js";import"./shared-ecd289b3.js";import"./shared-7bfd93b7.js";import"./shared-b5120f1a.js";import"./shared-0db7afef.js";import"./shared-5714d3a4.js";import"./shared-afaa6139.js";import"./shared-e6f3e9f0.js";import"./shared-a83b38f1.js";import"./foxy-cancellation-form.js";import"./foxy-collection-pages.js";import"./shared-193a0fb1.js";import"./shared-8cb76c8b.js";import"./foxy-table.js";import"./shared-debbc076.js";import"./foxy-nucleon-element.js";import"./shared-9195959e.js";import"./shared-75e78c70.js";import"./shared-0d697dd1.js";let d,c=t=>t;customElements.define("foxy-internal-item-form-line-item-discount-control",class extends r{constructor(){super(...arguments),this.infer="line-item-discount"}renderControl(){var t,e,r,n,s;return i(d||(d=c` <foxy-internal-details summary="title" infer=""> <div class="space-y-m p-m"> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" first="${0}" infer="coupon" @change="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="discount-name"></foxy-internal-text-control> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> </div> </foxy-internal-details> `),o(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.coupons)&&void 0!==e?e:void 0),(t=>{var e;t.preventDefault();const r=t.detail;null===(e=this.nucleon)||void 0===e||e.edit({discount_name:r.name,discount_type:r.coupon_discount_type,discount_details:r.coupon_discount_details})}),{type:null===(r=this.nucleon)||void 0===r?void 0:r.form.discount_type,name:null===(n=this.nucleon)||void 0===n?void 0:n.form.discount_name,details:null===(s=this.nucleon)||void 0===s?void 0:s.form.discount_details},(t=>{var e;const r=t.currentTarget.parsedValue;null===(e=this.nucleon)||void 0===e||e.edit({discount_name:r.name,discount_type:r.type,discount_details:r.details})}))}});let f,m=t=>t;customElements.define("foxy-internal-date-control",class extends t{constructor(){super(...arguments),this.format=null}static get properties(){return n(n({},super.properties),{},{format:{type:String}})}renderControl(){var t;let e;return e="unix"===this.format?s(new Date(1e3*(null!==(t=this._value)&&void 0!==t?t:0))):this._value,i(f||(f=m` <vaadin-date-picker error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @change="${0}"> </vaadin-date-picker> `),o(this._errorMessage),this.placeholder,this.helperText,this.label,this.disabled,this.readonly,this._checkValidity,e,(t=>{var e;return"Enter"===t.key&&(null===(e=this.nucleon)||void 0===e?void 0:e.submit())}),(t=>{var e,r;const o=t.currentTarget;"unix"===this.format?this._value=Math.floor((null!==(r=null===(e=a(o.value))||void 0===e?void 0:e.getTime())&&void 0!==r?r:0)/1e3):this._value=o.value}))}});let p,u,y,x=t=>t;customElements.define("foxy-internal-item-form-subscription-control",class extends r{constructor(){super(...arguments),this.infer="subscription"}renderControl(){var t,e,r,o,n;let s;try{const i=null!==(o=null===(r=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links)["fx:subscription"])||void 0===r?void 0:r.href)&&void 0!==o?o:"",n=new URL(i);n.searchParams.set("zoom","last_transaction,transaction_template:items"),s=n.toString()}catch(t){s=null}return i(p||(p=x` <foxy-internal-details summary="title" infer=""> ${0} </foxy-internal-details> `),s?i(u||(u=x` <foxy-form-dialog header="update" infer="form" href="${0}" form="foxy-subscription-form" .related="${0}"> </foxy-form-dialog> <button ?disabled="${0}" @click="${0}"> <foxy-subscription-card class="p-m" infer="card" href="${0}"> </foxy-subscription-card> </button> `),s,(null===(n=this.nucleon)||void 0===n?void 0:n.href)?[this.nucleon.href]:[],this.disabled,(t=>{const e=t.currentTarget;e.previousElementSibling.show(e)}),s):i(y||(y=x` <div class="space-y-m p-m"> <foxy-internal-frequency-control infer="frequency" property="subscription_frequency"> </foxy-internal-frequency-control> <foxy-internal-date-control infer="start" property="subscription_start_date"> </foxy-internal-date-control> <foxy-internal-date-control infer="end" property="subscription_end_date"> </foxy-internal-date-control> <foxy-internal-date-control infer="next" property="subscription_next_transaction_date"> </foxy-internal-date-control> </div> `)))}});let h,b=t=>t;customElements.define("foxy-internal-item-form-inventory-control",class extends r{constructor(){super(...arguments),this.infer="inventory"}renderControl(){var t,e;return i(h||(h=b` <foxy-internal-details summary="title" infer=""> <div class="grid grid-cols-2 gap-m p-m"> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" property="item_category_uri" first="${0}" class="col-span-2" infer="category"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-text-control infer="parent-code"></foxy-internal-text-control> </div> </foxy-internal-details> `),o(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.itemCategories)&&void 0!==e?e:void 0))}});let v,j=t=>t;customElements.define("foxy-internal-item-form-shipping-control",class extends r{constructor(){super(...arguments),this.infer="shipping"}renderControl(){var t,e;return i(v||(v=j` <foxy-internal-details summary="title" infer=""> <div class="grid grid-cols-2 gap-m p-m"> <foxy-internal-async-combo-box-control item-value-path="address_name" item-label-path="address_name" first="${0}" class="col-span-2" infer="shipto"> </foxy-internal-async-combo-box-control> <foxy-internal-integer-control infer="width"></foxy-internal-integer-control> <foxy-internal-integer-control infer="height"></foxy-internal-integer-control> <foxy-internal-integer-control infer="length"></foxy-internal-integer-control> <foxy-internal-integer-control infer="weight"></foxy-internal-integer-control> </div> </foxy-internal-details> `),o(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.customerAddresses)&&void 0!==e?e:void 0))}});let g,_=t=>t;customElements.define("foxy-internal-item-form-cart-control",class extends r{constructor(){super(...arguments),this.infer="cart"}renderControl(){return i(g||(g=_` <foxy-internal-details summary="title" infer=""> <div class="grid grid-cols-2 gap-m p-m"> <foxy-internal-date-control class="col-span-2" infer="expires" format="unix"> </foxy-internal-date-control> <foxy-internal-text-control class="col-span-2" infer="url"></foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="image"></foxy-internal-text-control> <foxy-internal-integer-control infer="quantity-min"></foxy-internal-integer-control> <foxy-internal-integer-control infer="quantity-max"></foxy-internal-integer-control> </div> </foxy-internal-details> `))}});let $,k,q=t=>t;class w extends(l(e,"item-form")){constructor(){super(...arguments),this.customerAddresses=null,this.itemCategories=null,this.coupons=null,this.__itemsLink=""}static get properties(){return n(n({},super.properties),{},{customerAddresses:{type:String,attribute:"customer-addresses"},itemCategories:{type:String,attribute:"item-categories"},coupons:{type:String}})}static get v8n(){return[({name:t})=>!!t||"name:v8n_required",({name:t})=>!!t&&t.length<=255||"name:v8n_too_long",({price:t})=>"number"==typeof t&&!isNaN(t)||"price:v8n_required",({price:t})=>"number"==typeof t&&t>=0||"price:v8n_negative",({quantity:t})=>"number"==typeof t&&t>=1||"quantity:v8n_less_than_one"]}renderBody(){return i($||($=q` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-m"> <foxy-internal-number-control infer="price"></foxy-internal-number-control> <foxy-internal-integer-control infer="quantity"></foxy-internal-integer-control> </div> <foxy-internal-item-form-subscription-control></foxy-internal-item-form-subscription-control> <foxy-internal-item-form-line-item-discount-control></foxy-internal-item-form-line-item-discount-control> <foxy-internal-item-form-cart-control></foxy-internal-item-form-cart-control> <foxy-internal-item-form-shipping-control></foxy-internal-item-form-shipping-control> <foxy-internal-item-form-inventory-control></foxy-internal-item-form-inventory-control> ${0} ${0} `),this.data?i(k||(k=q` <foxy-internal-async-details-control infer="discount-details" first="${0}" limit="5" item="foxy-discount-detail-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="coupon-details" first="${0}" limit="5" item="foxy-coupon-detail-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="attributes" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="item-options" first="${0}" limit="5" item="foxy-item-option-card" form="foxy-item-option-form" .related="${0}"> </foxy-internal-async-details-control> `),this.data._links["fx:discount_details"].href,this.data._links["fx:coupon_details"].href,this.data._links["fx:attributes"].href,this.data._links["fx:item_options"].href,[this.data._links["fx:transaction"].href,this.data._links["fx:shipment"].href,this.__itemsLink]):"",super.renderBody())}async _sendGet(){const t=await super._sendGet(),e=await super._fetch(t._links["fx:transaction"].href);return this.__itemsLink=e._links["fx:items"].href,t}}customElements.define("foxy-item-form",w);export{w as ItemForm};
1
+ import"./shared-40d82f6b.js";import"./shared-40537775.js";import"./shared-4457dc27.js";import{I as t}from"./shared-71deb26e.js";import{I as e}from"./shared-92bd849f.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-coupon-card.js";import"./shared-2f1e04ae.js";import{I as r}from"./shared-4c338ca6.js";import"./foxy-discount-builder.js";import{i as o}from"./shared-d3bf9ac0.js";import{h as i}from"./shared-7f33a83a.js";import"./shared-29376ba1.js";import"./shared-7661b51a.js";import{_ as n}from"./shared-a8ced8bf.js";import{s}from"./shared-bc7f58ef.js";import{p as a}from"./shared-5b55627c.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import{a as l}from"./shared-29e21467.js";import"./shared-d43fc5cc.js";import"./shared-6b8874a7.js";import"./shared-c52d3772.js";import"./shared-7b167fe9.js";import"./shared-2215e6c8.js";import"./shared-34b11d34.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-c484320b.js";import"./shared-ea316e64.js";import"./shared-0672e78b.js";import"./shared-002b788f.js";import"./shared-4f037e43.js";import"./shared-5ad8c9a0.js";import"./shared-b7423eab.js";import"./shared-dc798bf4.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";import"./shared-d519a301.js";import"./shared-11c2efc8.js";import"./foxy-pagination.js";import"./shared-b8e9b536.js";import"./shared-4e709717.js";import"./shared-ef0fc329.js";import"./shared-4975f86f.js";import"./shared-0479553e.js";import"./shared-6003864d.js";import"./shared-6d2064e9.js";import"./shared-f2d19582.js";import"./shared-1b3e1a0d.js";import"./shared-bb522838.js";import"./shared-b28dbc68.js";import"./shared-e396ec04.js";import"./shared-5504f415.js";import"./shared-e3ce88dc.js";import"./shared-923da875.js";import"./shared-3a3878c9.js";import"./shared-162fc285.js";import"./shared-e6f3e9f0.js";import"./shared-236d9b7e.js";import"./foxy-cancellation-form.js";import"./foxy-collection-pages.js";import"./shared-6bf8883f.js";import"./shared-e119731e.js";import"./foxy-table.js";import"./shared-cced7800.js";import"./foxy-nucleon-element.js";import"./shared-d302ad2c.js";import"./shared-75e78c70.js";import"./shared-facfe95a.js";let c,d=t=>t;customElements.define("foxy-internal-item-form-line-item-discount-control",class extends r{constructor(){super(...arguments),this.infer="line-item-discount"}renderControl(){var t,e,r,n,s;return i(c||(c=d` <foxy-internal-details summary="title" infer=""> <div class="space-y-m p-m"> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" first="${0}" infer="coupon" @change="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="discount-name"></foxy-internal-text-control> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> </div> </foxy-internal-details> `),o(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.coupons)&&void 0!==e?e:void 0),(t=>{var e;t.preventDefault();const r=t.detail;null===(e=this.nucleon)||void 0===e||e.edit({discount_name:r.name,discount_type:r.coupon_discount_type,discount_details:r.coupon_discount_details})}),{type:null===(r=this.nucleon)||void 0===r?void 0:r.form.discount_type,name:null===(n=this.nucleon)||void 0===n?void 0:n.form.discount_name,details:null===(s=this.nucleon)||void 0===s?void 0:s.form.discount_details},(t=>{var e;const r=t.currentTarget.parsedValue;null===(e=this.nucleon)||void 0===e||e.edit({discount_name:r.name,discount_type:r.type,discount_details:r.details})}))}});let f,m=t=>t;customElements.define("foxy-internal-date-control",class extends t{constructor(){super(...arguments),this.format=null}static get properties(){return n(n({},super.properties),{},{format:{type:String}})}renderControl(){var t;let e;return e="unix"===this.format?s(new Date(1e3*(null!==(t=this._value)&&void 0!==t?t:0))):this._value,i(f||(f=m` <vaadin-date-picker error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @change="${0}"> </vaadin-date-picker> `),o(this._errorMessage),this.placeholder,this.helperText,this.label,this.disabled,this.readonly,this._checkValidity,e,(t=>{var e;return"Enter"===t.key&&(null===(e=this.nucleon)||void 0===e?void 0:e.submit())}),(t=>{var e,r;const o=t.currentTarget;"unix"===this.format?this._value=Math.floor((null!==(r=null===(e=a(o.value))||void 0===e?void 0:e.getTime())&&void 0!==r?r:0)/1e3):this._value=o.value}))}});let p,u,y,x=t=>t;customElements.define("foxy-internal-item-form-subscription-control",class extends r{constructor(){super(...arguments),this.infer="subscription"}renderControl(){var t,e,r,o,n;let s;try{const i=null!==(o=null===(r=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links)["fx:subscription"])||void 0===r?void 0:r.href)&&void 0!==o?o:"",n=new URL(i);n.searchParams.set("zoom","last_transaction,transaction_template:items"),s=n.toString()}catch(t){s=null}return i(p||(p=x` <foxy-internal-details summary="title" infer=""> ${0} </foxy-internal-details> `),s?i(u||(u=x` <foxy-form-dialog header="update" infer="form" href="${0}" form="foxy-subscription-form" .related="${0}"> </foxy-form-dialog> <button ?disabled="${0}" @click="${0}"> <foxy-subscription-card class="p-m" infer="card" href="${0}"> </foxy-subscription-card> </button> `),s,(null===(n=this.nucleon)||void 0===n?void 0:n.href)?[this.nucleon.href]:[],this.disabled,(t=>{const e=t.currentTarget;e.previousElementSibling.show(e)}),s):i(y||(y=x` <div class="space-y-m p-m"> <foxy-internal-frequency-control infer="frequency" property="subscription_frequency"> </foxy-internal-frequency-control> <foxy-internal-date-control infer="start" property="subscription_start_date"> </foxy-internal-date-control> <foxy-internal-date-control infer="end" property="subscription_end_date"> </foxy-internal-date-control> <foxy-internal-date-control infer="next" property="subscription_next_transaction_date"> </foxy-internal-date-control> </div> `)))}});let h,b=t=>t;customElements.define("foxy-internal-item-form-inventory-control",class extends r{constructor(){super(...arguments),this.infer="inventory"}renderControl(){var t,e;return i(h||(h=b` <foxy-internal-details summary="title" infer=""> <div class="grid grid-cols-2 gap-m p-m"> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" property="item_category_uri" first="${0}" class="col-span-2" infer="category"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-text-control infer="parent-code"></foxy-internal-text-control> </div> </foxy-internal-details> `),o(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.itemCategories)&&void 0!==e?e:void 0))}});let v,j=t=>t;customElements.define("foxy-internal-item-form-shipping-control",class extends r{constructor(){super(...arguments),this.infer="shipping"}renderControl(){var t,e;return i(v||(v=j` <foxy-internal-details summary="title" infer=""> <div class="grid grid-cols-2 gap-m p-m"> <foxy-internal-async-combo-box-control item-value-path="address_name" item-label-path="address_name" first="${0}" class="col-span-2" infer="shipto"> </foxy-internal-async-combo-box-control> <foxy-internal-integer-control infer="width"></foxy-internal-integer-control> <foxy-internal-integer-control infer="height"></foxy-internal-integer-control> <foxy-internal-integer-control infer="length"></foxy-internal-integer-control> <foxy-internal-integer-control infer="weight"></foxy-internal-integer-control> </div> </foxy-internal-details> `),o(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.customerAddresses)&&void 0!==e?e:void 0))}});let g,_=t=>t;customElements.define("foxy-internal-item-form-cart-control",class extends r{constructor(){super(...arguments),this.infer="cart"}renderControl(){return i(g||(g=_` <foxy-internal-details summary="title" infer=""> <div class="grid grid-cols-2 gap-m p-m"> <foxy-internal-date-control class="col-span-2" infer="expires" format="unix"> </foxy-internal-date-control> <foxy-internal-text-control class="col-span-2" infer="url"></foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="image"></foxy-internal-text-control> <foxy-internal-integer-control infer="quantity-min"></foxy-internal-integer-control> <foxy-internal-integer-control infer="quantity-max"></foxy-internal-integer-control> </div> </foxy-internal-details> `))}});let $,k,q=t=>t;class w extends(l(e,"item-form")){constructor(){super(...arguments),this.customerAddresses=null,this.itemCategories=null,this.coupons=null,this.__itemsLink=""}static get properties(){return n(n({},super.properties),{},{customerAddresses:{type:String,attribute:"customer-addresses"},itemCategories:{type:String,attribute:"item-categories"},coupons:{type:String}})}static get v8n(){return[({name:t})=>!!t||"name:v8n_required",({name:t})=>!!t&&t.length<=255||"name:v8n_too_long",({price:t})=>"number"==typeof t&&!isNaN(t)||"price:v8n_required",({price:t})=>"number"==typeof t&&t>=0||"price:v8n_negative",({quantity:t})=>"number"==typeof t&&t>=1||"quantity:v8n_less_than_one"]}renderBody(){return i($||($=q` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-m"> <foxy-internal-number-control infer="price"></foxy-internal-number-control> <foxy-internal-integer-control infer="quantity"></foxy-internal-integer-control> </div> <foxy-internal-item-form-subscription-control></foxy-internal-item-form-subscription-control> <foxy-internal-item-form-line-item-discount-control></foxy-internal-item-form-line-item-discount-control> <foxy-internal-item-form-cart-control></foxy-internal-item-form-cart-control> <foxy-internal-item-form-shipping-control></foxy-internal-item-form-shipping-control> <foxy-internal-item-form-inventory-control></foxy-internal-item-form-inventory-control> ${0} ${0} `),this.data?i(k||(k=q` <foxy-internal-async-details-control infer="discount-details" first="${0}" limit="5" item="foxy-discount-detail-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="coupon-details" first="${0}" limit="5" item="foxy-coupon-detail-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="attributes" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="item-options" first="${0}" limit="5" item="foxy-item-option-card" form="foxy-item-option-form" .related="${0}"> </foxy-internal-async-details-control> `),this.data._links["fx:discount_details"].href,this.data._links["fx:coupon_details"].href,this.data._links["fx:attributes"].href,this.data._links["fx:item_options"].href,[this.data._links["fx:transaction"].href,this.data._links["fx:shipment"].href,this.__itemsLink]):"",super.renderBody())}async _sendGet(){const t=await super._sendGet(),e=await super._fetch(t._links["fx:transaction"].href);return this.__itemsLink=e._links["fx:items"].href,t}}customElements.define("foxy-item-form",w);export{w as ItemForm};
@@ -1 +1 @@
1
- import"./shared-3b22a756.js";import"./shared-a98a6602.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import{h as r}from"./shared-7f33a83a.js";import{a as e}from"./shared-ff13276c.js";import{T as s}from"./shared-c70b41e1.js";import"./shared-08d6d02b.js";import"./shared-4623f740.js";import"./shared-a8ced8bf.js";import"./shared-2af327d0.js";import"./shared-4f037e43.js";import"./shared-a8966936.js";import"./shared-d3bf9ac0.js";import"./shared-15278fe0.js";import"./shared-a420358e.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";import"./shared-4e709717.js";let t,a,i=r=>r;const o=e(s,"item-option-card");class c extends o{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}render(){return super.render({title:e=>{let s;try{s=Math.abs(e.price_mod).toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:this.__currencyDisplay,currency:this.__currency,style:"currency"})}catch(r){s="--"}return r(t||(t=i`${0} &bull; ${0} &bull; ${0}`),e.name,s,e.weight_mod)},subtitle:e=>r(a||(a=i`${0}`),e.value)})}async _sendGet(){const r=await super._sendGet(),[e,s]=await Promise.all([super._fetch(r._links["fx:transaction"].href),super._fetch(r._links["fx:store"].href)]);return this.__currency=e.currency_code,this.__currencyDisplay=s.use_international_currency_symbol?"code":"symbol",r}}customElements.define("foxy-item-option-card",c);export{c as ItemOptionCard};
1
+ import"./shared-ea316e64.js";import"./shared-c484320b.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import{h as r}from"./shared-7f33a83a.js";import{a as e}from"./shared-29e21467.js";import{T as s}from"./shared-6003864d.js";import"./shared-c52d3772.js";import"./shared-0672e78b.js";import"./shared-a8ced8bf.js";import"./shared-002b788f.js";import"./shared-4f037e43.js";import"./shared-5ad8c9a0.js";import"./shared-d3bf9ac0.js";import"./shared-b7423eab.js";import"./shared-dc798bf4.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";import"./shared-4e709717.js";let t,i,a=r=>r;const c=e(s,"item-option-card");class o extends c{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}render(){return super.render({title:e=>{let s;try{s=Math.abs(e.price_mod).toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:this.__currencyDisplay,currency:this.__currency,style:"currency"})}catch(r){s="--"}return r(t||(t=a`${0} &bull; ${0} &bull; ${0}`),e.name,s,e.weight_mod)},subtitle:e=>r(i||(i=a`${0}`),e.value)})}async _sendGet(){const r=await super._sendGet(),[e,s]=await Promise.all([super._fetch(r._links["fx:transaction"].href),super._fetch(r._links["fx:store"].href)]);return this.__currency=e.currency_code,this.__currencyDisplay=s.use_international_currency_symbol?"code":"symbol",r}}customElements.define("foxy-item-option-card",o);export{o as ItemOptionCard};
@@ -1 +1 @@
1
- import"./shared-28b09f69.js";import"./shared-59d73648.js";import{I as r}from"./shared-17d5d718.js";import{a as e}from"./shared-ff13276c.js";import{h as o}from"./shared-7f33a83a.js";import"./shared-e6bff624.js";import"./shared-de385bdb.js";import"./shared-3d0dc4a6.js";import"./shared-08d6d02b.js";import"./shared-d3bf9ac0.js";import"./shared-77359cd0.js";import"./shared-0479553e.js";import"./shared-4623f740.js";import"./shared-a8ced8bf.js";import"./shared-2af327d0.js";import"./shared-4f037e43.js";import"./shared-a8966936.js";import"./shared-15278fe0.js";import"./shared-a420358e.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";import"./shared-e4bc532a.js";import"./shared-b5b5c848.js";import"./shared-6822bc96.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-a98a6602.js";import"./shared-3b22a756.js";let t,s=r=>r;class a extends(e(r,"item-option-form")){static get v8n(){return[({name:r})=>!!r||"name:v8n_required",({name:r})=>!!r&&r.length<=100||"name:v8n_too_long",({value:r})=>!!r||"value:v8n_required",({value:r})=>!!r&&r.length<=1024||"value:v8n_too_long"]}renderBody(){return o(t||(t=s` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-text-control infer="value"></foxy-internal-text-control> <foxy-internal-number-control infer="price-mod"></foxy-internal-number-control> <foxy-internal-number-control infer="weight-mod"></foxy-internal-number-control> ${0} `),super.renderBody())}}customElements.define("foxy-item-option-form",a);export{a as ItemOptionForm};
1
+ import"./shared-4457dc27.js";import"./shared-71deb26e.js";import{I as r}from"./shared-92bd849f.js";import{a as e}from"./shared-29e21467.js";import{h as o}from"./shared-7f33a83a.js";import"./shared-d43fc5cc.js";import"./shared-6b8874a7.js";import"./shared-c52d3772.js";import"./shared-7b167fe9.js";import"./shared-2215e6c8.js";import"./shared-d3bf9ac0.js";import"./shared-4c338ca6.js";import"./shared-0479553e.js";import"./shared-0672e78b.js";import"./shared-a8ced8bf.js";import"./shared-002b788f.js";import"./shared-4f037e43.js";import"./shared-5ad8c9a0.js";import"./shared-b7423eab.js";import"./shared-dc798bf4.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";import"./shared-b8e9b536.js";import"./shared-ef0fc329.js";import"./shared-4975f86f.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-c484320b.js";import"./shared-ea316e64.js";let t,s=r=>r;class a extends(e(r,"item-option-form")){static get v8n(){return[({name:r})=>!!r||"name:v8n_required",({name:r})=>!!r&&r.length<=100||"name:v8n_too_long",({value:r})=>!!r||"value:v8n_required",({value:r})=>!!r&&r.length<=1024||"value:v8n_too_long"]}renderBody(){return o(t||(t=s` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-text-control infer="value"></foxy-internal-text-control> <foxy-internal-number-control infer="price-mod"></foxy-internal-number-control> <foxy-internal-number-control infer="weight-mod"></foxy-internal-number-control> ${0} `),super.renderBody())}}customElements.define("foxy-item-option-form",a);export{a as ItemOptionForm};
@@ -1 +1 @@
1
- export{a as Item,I as ItemsForm}from"./shared-193a0fb1.js";import"./shared-a8ced8bf.js";import"./shared-e4bc532a.js";import"./shared-3d0dc4a6.js";import"./shared-08d6d02b.js";import"./shared-ff13276c.js";import"./shared-7f33a83a.js";import"./shared-4623f740.js";import"./shared-2af327d0.js";import"./shared-4f037e43.js";import"./shared-a98a6602.js";import"./shared-45c3705a.js";import"./shared-3f4f362e.js";import"./shared-e6bff624.js";import"./shared-de385bdb.js";import"./shared-788e5ff5.js";import"./shared-77970922.js";import"./shared-ecd289b3.js";import"./shared-7bfd93b7.js";import"./shared-11c2efc8.js";import"./shared-4a796610.js";import"./shared-6822bc96.js";import"./shared-a420358e.js";import"./shared-a8966936.js";import"./shared-d3bf9ac0.js";import"./shared-4e709717.js";import"./shared-b5120f1a.js";import"./shared-0db7afef.js";import"./shared-8cb76c8b.js";import"./shared-3b22a756.js";
1
+ export{a as Item,I as ItemsForm}from"./shared-6bf8883f.js";import"./shared-a8ced8bf.js";import"./shared-b8e9b536.js";import"./shared-7b167fe9.js";import"./shared-c52d3772.js";import"./shared-29e21467.js";import"./shared-7f33a83a.js";import"./shared-0672e78b.js";import"./shared-002b788f.js";import"./shared-4f037e43.js";import"./shared-c484320b.js";import"./shared-f2d19582.js";import"./shared-1b3e1a0d.js";import"./shared-d43fc5cc.js";import"./shared-6b8874a7.js";import"./shared-2215e6c8.js";import"./shared-34b11d34.js";import"./shared-6d2064e9.js";import"./shared-bb522838.js";import"./shared-b28dbc68.js";import"./shared-e396ec04.js";import"./shared-11c2efc8.js";import"./shared-dcbf57e0.js";import"./shared-4975f86f.js";import"./shared-dc798bf4.js";import"./shared-5ad8c9a0.js";import"./shared-d3bf9ac0.js";import"./shared-4e709717.js";import"./shared-5504f415.js";import"./shared-e3ce88dc.js";import"./shared-923da875.js";import"./shared-e119731e.js";import"./shared-ea316e64.js";
@@ -1 +1 @@
1
- import{N as e}from"./shared-15278fe0.js";export{N as NucleonElement}from"./shared-15278fe0.js";import"./shared-a8ced8bf.js";import"./shared-7f33a83a.js";import"./shared-2af327d0.js";import"./shared-a420358e.js";import"./shared-d6276c83.js";import"./shared-4f037e43.js";import"./shared-4a796610.js";customElements.define("foxy-nucleon",e);
1
+ import{N as e}from"./shared-b7423eab.js";export{N as NucleonElement}from"./shared-b7423eab.js";import"./shared-a8ced8bf.js";import"./shared-7f33a83a.js";import"./shared-002b788f.js";import"./shared-dc798bf4.js";import"./shared-d6276c83.js";import"./shared-4f037e43.js";import"./shared-dcbf57e0.js";customElements.define("foxy-nucleon",e);
@@ -1 +1 @@
1
- import"./shared-3b22a756.js";import"./shared-a98a6602.js";import"./shared-e4bc532a.js";import"./shared-4623f740.js";import{_ as e}from"./shared-a8ced8bf.js";import{h as t,L as s}from"./shared-7f33a83a.js";import{C as i}from"./shared-a8966936.js";import{N as n}from"./shared-15278fe0.js";import{R as a,T as r,a as o}from"./shared-ff13276c.js";import{c as l}from"./shared-4e709717.js";import{Q as c}from"./shared-2af327d0.js";import{I as d}from"./shared-4f037e43.js";import"./shared-08d6d02b.js";import"./shared-3d0dc4a6.js";import"./shared-d3bf9ac0.js";import"./shared-a420358e.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";let m,_=e=>e;const h=a(i(r(o(d(s),"pagination"))));class p extends h{constructor(){super(...arguments),this.__pageElement=null,this.__rerender=()=>this.requestUpdate(),this.__first=""}static get properties(){return e(e({},super.properties),{},{first:{type:String},__pageElement:{attribute:!1}})}get first(){return this.__first}set first(e){this.__first=e,this.__pageElement&&(this.__pageElement.href=e)}connectedCallback(){super.connectedCallback(),this.__connectPageElement()}render(){var e;const s=null===(e=this.__pageElement)||void 0===e?void 0:e.data,{disabled:i,lang:n,ns:a}=this,r=Number(c(s,"returned_items")),o=Number.isNaN(r)?0:r,d=Number(c(s,"total_items")),h=Number.isNaN(d)?0:d,p=Number(c(s,"offset")),f=Number.isNaN(p)?0:p,g=!i&&f>0,u=!i&&f+o<h,v="sr-only sm-not-sr-only";return t(m||(m=_` <slot @slotchange="${0}"></slot> <div class="grid grid-cols-3 gap-s items-center -mx-xs"> <div class="flex items-center space-x-s"> <vaadin-button data-testid="first" theme="contrast tertiary-inline" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-s" icon="icons:first-page"></iron-icon> <foxy-i18n class="${0}" lang="${0}" key="first" ns="${0}"></foxy-i18n> </vaadin-button> <vaadin-button data-testid="prev" theme="contrast tertiary-inline" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-s" icon="icons:chevron-left"></iron-icon> <foxy-i18n class="${0}" lang="${0}" key="previous" ns="${0}"></foxy-i18n> </vaadin-button> </div> <foxy-i18n options="${0}" class="${0}" lang="${0}" key="pagination" ns="${0}"> </foxy-i18n> <div class="flex items-center justify-end space-x-s"> <vaadin-button data-testid="next" theme="contrast tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="next" ns="${0}"></foxy-i18n> <iron-icon class="icon-inline text-s" icon="icons:chevron-right"></iron-icon> </vaadin-button> <vaadin-button data-testid="last" theme="contrast tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="last" ns="${0}"></foxy-i18n> <iron-icon class="icon-inline text-s" icon="icons:last-page"></iron-icon> </vaadin-button> </div> </div> `),this.__connectPageElement,!g,(()=>this.__goTo("first")),v,n,a,!g,(()=>this.__goTo("prev")),v,n,a,JSON.stringify({total:h,from:f?f+1:0,to:f+o}),l({"flex-1 text-xs text-tertiary text-center leading-xs":!0,"opacity-0":!s}),n,a,!u,(()=>this.__goTo("next")),v,n,a,!u,(()=>this.__goTo("last")),v,n,a)}disconnectedCallback(){super.disconnectedCallback(),this.__disconnectPageElement()}__goTo(e){var t;this.__pageElement.href=String(c(null===(t=this.__pageElement)||void 0===t?void 0:t.data,`_links.${e}.href`))}__disconnectPageElement(){var e;null===(e=this.__pageElement)||void 0===e||e.removeEventListener("update",this.__rerender),this.__pageElement=null}__connectPageElement(){var e;this.__disconnectPageElement();const t=this.renderRoot.querySelector("slot"),s=(null!==(e=null==t?void 0:t.assignedElements())&&void 0!==e?e:[]).find((e=>e instanceof n));s&&(this.__pageElement=s,this.__pageElement.addEventListener("update",this.__rerender),this.__pageElement.href=this.first)}}customElements.define("foxy-pagination",p);export{p as Pagination};
1
+ import"./shared-ea316e64.js";import"./shared-c484320b.js";import"./shared-b8e9b536.js";import"./shared-0672e78b.js";import{_ as e}from"./shared-a8ced8bf.js";import{h as t,L as s}from"./shared-7f33a83a.js";import{C as i}from"./shared-5ad8c9a0.js";import{N as n}from"./shared-b7423eab.js";import{R as a,T as r,a as o}from"./shared-29e21467.js";import{c as l}from"./shared-4e709717.js";import{Q as c}from"./shared-002b788f.js";import{I as d}from"./shared-4f037e43.js";import"./shared-c52d3772.js";import"./shared-7b167fe9.js";import"./shared-d3bf9ac0.js";import"./shared-dc798bf4.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";let m,_=e=>e;const h=a(i(r(o(d(s),"pagination"))));class p extends h{constructor(){super(...arguments),this.__pageElement=null,this.__rerender=()=>this.requestUpdate(),this.__first=""}static get properties(){return e(e({},super.properties),{},{first:{type:String},__pageElement:{attribute:!1}})}get first(){return this.__first}set first(e){this.__first=e,this.__pageElement&&(this.__pageElement.href=e)}connectedCallback(){super.connectedCallback(),this.__connectPageElement()}render(){var e;const s=null===(e=this.__pageElement)||void 0===e?void 0:e.data,{disabled:i,lang:n,ns:a}=this,r=Number(c(s,"returned_items")),o=Number.isNaN(r)?0:r,d=Number(c(s,"total_items")),h=Number.isNaN(d)?0:d,p=Number(c(s,"offset")),f=Number.isNaN(p)?0:p,g=!i&&f>0,u=!i&&f+o<h,b="sr-only sm-not-sr-only";return t(m||(m=_` <slot @slotchange="${0}"></slot> <div class="grid grid-cols-3 gap-s items-center -mx-xs"> <div class="flex items-center space-x-s"> <vaadin-button data-testid="first" theme="contrast tertiary-inline" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-s" icon="icons:first-page"></iron-icon> <foxy-i18n class="${0}" lang="${0}" key="first" ns="${0}"></foxy-i18n> </vaadin-button> <vaadin-button data-testid="prev" theme="contrast tertiary-inline" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-s" icon="icons:chevron-left"></iron-icon> <foxy-i18n class="${0}" lang="${0}" key="previous" ns="${0}"></foxy-i18n> </vaadin-button> </div> <foxy-i18n options="${0}" class="${0}" lang="${0}" key="pagination" ns="${0}"> </foxy-i18n> <div class="flex items-center justify-end space-x-s"> <vaadin-button data-testid="next" theme="contrast tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="next" ns="${0}"></foxy-i18n> <iron-icon class="icon-inline text-s" icon="icons:chevron-right"></iron-icon> </vaadin-button> <vaadin-button data-testid="last" theme="contrast tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="last" ns="${0}"></foxy-i18n> <iron-icon class="icon-inline text-s" icon="icons:last-page"></iron-icon> </vaadin-button> </div> </div> `),this.__connectPageElement,!g,(()=>this.__goTo("first")),b,n,a,!g,(()=>this.__goTo("prev")),b,n,a,JSON.stringify({total:h,from:f?f+1:0,to:f+o}),l({"flex-1 text-xs text-tertiary text-center leading-xs":!0,"opacity-0":!s}),n,a,!u,(()=>this.__goTo("next")),b,n,a,!u,(()=>this.__goTo("last")),b,n,a)}disconnectedCallback(){super.disconnectedCallback(),this.__disconnectPageElement()}__goTo(e){var t;this.__pageElement.href=String(c(null===(t=this.__pageElement)||void 0===t?void 0:t.data,`_links.${e}.href`))}__disconnectPageElement(){var e;null===(e=this.__pageElement)||void 0===e||e.removeEventListener("update",this.__rerender),this.__pageElement=null}__connectPageElement(){var e;this.__disconnectPageElement();const t=this.renderRoot.querySelector("slot"),s=(null!==(e=null==t?void 0:t.assignedElements())&&void 0!==e?e:[]).find((e=>e instanceof n));s&&(this.__pageElement=s,this.__pageElement.addEventListener("update",this.__rerender),this.__pageElement.href=this.first)}}customElements.define("foxy-pagination",p);export{p as Pagination};
@@ -1 +1 @@
1
- import"./shared-0479553e.js";import"./shared-4623f740.js";import"./foxy-spinner.js";import{l as e,u as t}from"./shared-99065f2a.js";import{h as s}from"./shared-7f33a83a.js";import{C as r}from"./shared-a8966936.js";import{N as i}from"./shared-15278fe0.js";import{T as a,a as n}from"./shared-ff13276c.js";import{c as o}from"./shared-4e709717.js";import"./shared-a8ced8bf.js";import"./shared-2af327d0.js";import"./shared-4f037e43.js";import"./shared-a98a6602.js";import"./shared-08d6d02b.js";import"./shared-3b22a756.js";import"./shared-d3bf9ac0.js";import"./shared-a420358e.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";let d,l,c,p,u,h,f,m=e=>e;const v=a(r(n(i,"payment-card")));class _ extends v{constructor(){super(...arguments),this.templates={},this.__currencyDisplay="",this.__currency=""}render(){var e,t;const r=this.hiddenSelector,i=r.matches("card-info",!0),a=r.matches("fraud-risk",!0);return s(d||(d=m` <div aria-busy="${0}" aria-live="polite" class="relative text-body text-m font-lumo leading-m focus-outline-none"> <div class="${0}"> ${0} ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" class="m-auto" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),!this.data&&this.in("busy"),o({"relative transition duration-250 ease-in-out":!0,"opacity-0 pointer-events-none":!this.data}),r.matches("title",!0)?"":this.__renderTitle(),r.matches("subtitle",!0)?"":this.__renderSubtitle(),i&&a?"":s(l||(l=m` <div class="my-s flex space-x-s overflow-auto"> ${0} ${0} </div> `),i?"":this.__renderCardInfo(),a?"":this.__renderFraudRisk()),r.matches("processor-response",!0)?"":this.__renderProcessorResponse(),o({"transition duration-250 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}async _sendGet(){const e=await super._sendGet(),[t,s]=await Promise.all([super._fetch(e._links["fx:transaction"].href),super._fetch(e._links["fx:store"].href)]);return this.__currency=t.currency_code,this.__currencyDisplay=s.use_international_currency_symbol?"code":"symbol",e}__renderTitle(){const e=this.data?`gateways.${this.data.gateway_type}`:"",t=`${this.ns} gateways`;return s(c||(c=m` <div class="text-m flex text-secondary" data-testid="title"> ${0} <foxy-i18n lang="${0}" key="${0}" ns="${0}"></foxy-i18n>&ZeroWidthSpace; ${0} </div> `),this.renderTemplateOrSlot("title:before"),this.lang,e,t,this.renderTemplateOrSlot("title:after"))}__renderSubtitle(){var e,t,r,i;const a=`${null!==(t=null===(e=this.data)||void 0===e?void 0:e.amount)&&void 0!==t?t:""} ${this.__currency}`,n=JSON.stringify({amount:a,currencyDisplay:this.__currencyDisplay}),o=null!==(i=null===(r=this.data)||void 0===r?void 0:r.date_created)&&void 0!==i?i:"",d=JSON.stringify({value:o}),l=this.lang,c=this.ns;return s(p||(p=m` <div class="flex font-semibold text-m" data-testid="subtitle"> ${0} <foxy-i18n options="${0}" lang="${0}" key="price" ns="${0}"></foxy-i18n> <span>&nbsp;&bull;&nbsp;</span> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"></foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("subtitle:before"),n,l,c,d,l,c,this.renderTemplateOrSlot("subtitle:after"))}__renderCardInfo(){var r,i,a,n;const o=this.data,d=(null!==(r=null==o?void 0:o.cc_type)&&void 0!==r?r:"unknown").toLowerCase(),l=null===(i=null==o?void 0:o.cc_exp_year)||void 0===i?void 0:i.substring(2),c=null==o?void 0:o.cc_exp_month,p=null===(a=null==o?void 0:o.cc_number_masked)||void 0===a?void 0:a.replace(/x/gi,"");if(c&&l&&p)return s(u||(u=m` <div class="flex" data-testid="card-info"> ${0} <div class="truncate flex items-center h-s rounded overflow-hidden bg-contrast-5"> <div class="h-s">${0}</div> <div class="text-m font-semibold px-s">•••• ${0} ${0}/${0}</div> </div> ${0} </div> `),this.renderTemplateOrSlot("card-info:before"),null!==(n=e[d])&&void 0!==n?n:t,p,c,l,this.renderTemplateOrSlot("card-info:after"))}__renderFraudRisk(){var e,t;const r=null!==(t=null===(e=this.data)||void 0===e?void 0:e.fraud_protection_score)&&void 0!==t?t:0,i=r>0?"text-error":"text-success",a=r>0?"bg-error-10":"bg-success-10";return s(h||(h=m` <div class="flex" data-testid="fraud-risk"> ${0} <foxy-i18n options="${0}" class="truncate flex font-semibold h-s items-center px-s rounded text-m ${0} ${0}" lang="${0}" key="fraud_risk" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("fraud-risk:before"),JSON.stringify({score:r}),i,a,this.lang,this.ns,this.renderTemplateOrSlot("fraud-risk:after"))}__renderProcessorResponse(){var e;return s(f||(f=m` <div class="text-m text-tertiary" data-testid="processor-response"> ${0} ${0}&ZeroWidthSpace; ${0} </div> `),this.renderTemplateOrSlot("processor-response:before"),null===(e=this.data)||void 0===e?void 0:e.processor_response,this.renderTemplateOrSlot("processor-response:after"))}}customElements.define("foxy-payment-card",_);export{_ as PaymentCard};
1
+ import"./shared-0479553e.js";import"./shared-0672e78b.js";import"./foxy-spinner.js";import{l as e,u as t}from"./shared-99065f2a.js";import{h as s}from"./shared-7f33a83a.js";import{C as r}from"./shared-5ad8c9a0.js";import{N as i}from"./shared-b7423eab.js";import{T as a,a as n}from"./shared-29e21467.js";import{c as o}from"./shared-4e709717.js";import"./shared-a8ced8bf.js";import"./shared-002b788f.js";import"./shared-4f037e43.js";import"./shared-c484320b.js";import"./shared-c52d3772.js";import"./shared-ea316e64.js";import"./shared-d3bf9ac0.js";import"./shared-dc798bf4.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";let d,l,c,p,u,h,f,m=e=>e;const v=a(r(n(i,"payment-card")));class _ extends v{constructor(){super(...arguments),this.templates={},this.__currencyDisplay="",this.__currency=""}render(){var e,t;const r=this.hiddenSelector,i=r.matches("card-info",!0),a=r.matches("fraud-risk",!0);return s(d||(d=m` <div aria-busy="${0}" aria-live="polite" class="relative text-body text-m font-lumo leading-m focus-outline-none"> <div class="${0}"> ${0} ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" class="m-auto" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),!this.data&&this.in("busy"),o({"relative transition duration-250 ease-in-out":!0,"opacity-0 pointer-events-none":!this.data}),r.matches("title",!0)?"":this.__renderTitle(),r.matches("subtitle",!0)?"":this.__renderSubtitle(),i&&a?"":s(l||(l=m` <div class="my-s flex space-x-s overflow-auto"> ${0} ${0} </div> `),i?"":this.__renderCardInfo(),a?"":this.__renderFraudRisk()),r.matches("processor-response",!0)?"":this.__renderProcessorResponse(),o({"transition duration-250 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}async _sendGet(){const e=await super._sendGet(),[t,s]=await Promise.all([super._fetch(e._links["fx:transaction"].href),super._fetch(e._links["fx:store"].href)]);return this.__currency=t.currency_code,this.__currencyDisplay=s.use_international_currency_symbol?"code":"symbol",e}__renderTitle(){const e=this.data?`gateways.${this.data.gateway_type}`:"",t=`${this.ns} gateways`;return s(c||(c=m` <div class="text-m flex text-secondary" data-testid="title"> ${0} <foxy-i18n lang="${0}" key="${0}" ns="${0}"></foxy-i18n>&ZeroWidthSpace; ${0} </div> `),this.renderTemplateOrSlot("title:before"),this.lang,e,t,this.renderTemplateOrSlot("title:after"))}__renderSubtitle(){var e,t,r,i;const a=`${null!==(t=null===(e=this.data)||void 0===e?void 0:e.amount)&&void 0!==t?t:""} ${this.__currency}`,n=JSON.stringify({amount:a,currencyDisplay:this.__currencyDisplay}),o=null!==(i=null===(r=this.data)||void 0===r?void 0:r.date_created)&&void 0!==i?i:"",d=JSON.stringify({value:o}),l=this.lang,c=this.ns;return s(p||(p=m` <div class="flex font-semibold text-m" data-testid="subtitle"> ${0} <foxy-i18n options="${0}" lang="${0}" key="price" ns="${0}"></foxy-i18n> <span>&nbsp;&bull;&nbsp;</span> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"></foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("subtitle:before"),n,l,c,d,l,c,this.renderTemplateOrSlot("subtitle:after"))}__renderCardInfo(){var r,i,a,n;const o=this.data,d=(null!==(r=null==o?void 0:o.cc_type)&&void 0!==r?r:"unknown").toLowerCase(),l=null===(i=null==o?void 0:o.cc_exp_year)||void 0===i?void 0:i.substring(2),c=null==o?void 0:o.cc_exp_month,p=null===(a=null==o?void 0:o.cc_number_masked)||void 0===a?void 0:a.replace(/x/gi,"");if(c&&l&&p)return s(u||(u=m` <div class="flex" data-testid="card-info"> ${0} <div class="truncate flex items-center h-s rounded overflow-hidden bg-contrast-5"> <div class="h-s">${0}</div> <div class="text-m font-semibold px-s">•••• ${0} ${0}/${0}</div> </div> ${0} </div> `),this.renderTemplateOrSlot("card-info:before"),null!==(n=e[d])&&void 0!==n?n:t,p,c,l,this.renderTemplateOrSlot("card-info:after"))}__renderFraudRisk(){var e,t;const r=null!==(t=null===(e=this.data)||void 0===e?void 0:e.fraud_protection_score)&&void 0!==t?t:0,i=r>0?"text-error":"text-success",a=r>0?"bg-error-10":"bg-success-10";return s(h||(h=m` <div class="flex" data-testid="fraud-risk"> ${0} <foxy-i18n options="${0}" class="truncate flex font-semibold h-s items-center px-s rounded text-m ${0} ${0}" lang="${0}" key="fraud_risk" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("fraud-risk:before"),JSON.stringify({score:r}),i,a,this.lang,this.ns,this.renderTemplateOrSlot("fraud-risk:after"))}__renderProcessorResponse(){var e;return s(f||(f=m` <div class="text-m text-tertiary" data-testid="processor-response"> ${0} ${0}&ZeroWidthSpace; ${0} </div> `),this.renderTemplateOrSlot("processor-response:before"),null===(e=this.data)||void 0===e?void 0:e.processor_response,this.renderTemplateOrSlot("processor-response:after"))}}customElements.define("foxy-payment-card",_);export{_ as PaymentCard};
@@ -1 +1 @@
1
- import"./shared-a98a6602.js";import"./shared-3b22a756.js";import"./shared-e4bc532a.js";import"./shared-b5b5c848.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-4623f740.js";import{l as e,u as t}from"./shared-99065f2a.js";import{u as s,h as a,c as i}from"./shared-7f33a83a.js";import{B as r}from"./shared-2af327d0.js";import{C as n}from"./shared-a8966936.js";import"./foxy-nucleon-element.js";import{T as o,a as d}from"./shared-ff13276c.js";import{c as l}from"./shared-4e709717.js";import{N as c}from"./shared-15278fe0.js";import"./shared-08d6d02b.js";import"./shared-3d0dc4a6.js";import"./shared-a8ced8bf.js";import"./shared-6822bc96.js";import"./shared-a420358e.js";import"./shared-4f037e43.js";import"./shared-d3bf9ac0.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";const m=s("\n repeating-radial-gradient(\n circle at -100% 500%,\n rgba(255, 255, 255, 0),\n rgba(255, 255, 255, 0.05) 4px\n )\n"),h=s(Object.entries({unknown:"#797c85",amex:"#2557d6",diners:"#0079be",discover:"#4d4d4d",jcb:"#0e4c96",maestro:"#181818",mastercard:"#16366f",unionpay:"#0dadb5",visa:"#0e4595"}).map((([e,t])=>`.bg-${e} { background: ${t} ${m} }`)).join(" "));let p,f,u,b,v,y,_,g=e=>e;const j=o(n(d(c,"payment-method-card")));class $ extends j{constructor(){super(...arguments),this.templates={},this.__renderActionsDelete=()=>a(p||(p=g` <div class="flex"> ${0} <vaadin-button class="px-xs rounded" theme="icon" style="--lumo-primary-text-color:#fff;--lumo-primary-color-50pct:rgba(255, 255, 255, 0.5);--lumo-contrast-5pct:rgba(255, 255, 255, 0.05)" aria-label="${0}" data-testid="actions:delete" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:delete"></iron-icon> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("actions:delete:before"),this.t("delete").toString(),this.disabledSelector.matches("actions:delete",!0),this.__handleDelete,this.renderTemplateOrSlot("actions:delete:after")),this.__renderActions=()=>a(f||(f=g` <div class="flex" data-testid="actions"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("actions:before"),this.hiddenSelector.matches("actions:delete",!0)?"":this.__renderActionsDelete(),this.renderTemplateOrSlot("actions:after"))}static get styles(){return[super.styles,h,i(u||(u=g`.ratio-card{padding-top:63%;position:relative;height:0}.ratio-card>*{position:absolute;top:0;right:0;bottom:0;left:0}`))]}render(){var s,i,n,o,d,c;const{data:m,lang:h,ns:p}=this;if(this.in({idle:"template"})||!(null==m?void 0:m.save_cc)||!this.in("idle")){const e=this.in("fail")?"error":this.in("busy")?"busy":"empty";return a(b||(b=g` <div class="ratio-card" aria-live="polite" aria-busy="${0}" data-testid="wrapper"> <div class="h-full bg-contrast-5"></div> <div class="absolute inset-0 flex items-center justify-center"> <foxy-spinner data-testid="spinner" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),e,this.lang,p,null!==(i=null===(s=customElements.get("foxy-spinner"))||void 0===s?void 0:s.defaultNS)&&void 0!==i?i:"")}const f=null!==(o=null===(n=m.cc_type)||void 0===n?void 0:n.toLowerCase())&&void 0!==o?o:"unknown",u=null!==(d=e[f])&&void 0!==d?d:t,j=null===(c=m.cc_number_masked)||void 0===c?void 0:c.substring(m.cc_number_masked.length-4);return a(v||(v=g` <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <div class="ratio-card" data-testid="wrapper" aria-busy="${0}" aria-live="polite"> <div class="flex flex-col justify-between text-base text-m leading-m font-lumo p-m bg-unknown bg-${0}"> <div class="${0}"> ${0} <div class="ml-auto rounded h-m">${0}</div> </div> <div class="font-tnum leading-none flex justify-between"> <div data-testid="expiry"> ${0} </div> <div data-testid="number"> ${0} </div> </div> </div> </div> `),h,p,this.__handleConfirmHide,this.in("busy"),f,l({"flex items-start":!0,"justify-between":this.readonlyControls===r.False,"justify-end":this.readonlyControls===r.True}),this.hiddenSelector.matches("actions",!0)?"":this.__renderActions(),u,m.cc_exp_month&&m.cc_exp_year?a(y||(y=g` <span class="sr-only">${0}&nbsp;</span> <span>${0} / ${0}</span> `),this.t("expires").toString(),m.cc_exp_month,m.cc_exp_year):"",j?a(_||(_=g` <span class="sr-only">${0}&nbsp;</span> <span aria-hidden="true">••••</span> <span>${0}</span> `),this.t("last_4_digits").toString(),j):"")}async _sendDelete(){const e=JSON.stringify({save_cc:!1});await this._fetch(this.href,{method:"PATCH",body:e});return c.Rumour(this.group).share({data:null,source:this.href,related:[this.parent]}),null}__handleDelete(e){this.renderRoot.querySelector("#confirm").show(e.currentTarget)}__handleConfirmHide(e){e.detail.cancelled||this.delete()}}customElements.define("foxy-payment-method-card",$);export{$ as PaymentMethodCard};
1
+ import"./shared-c484320b.js";import"./shared-ea316e64.js";import"./shared-b8e9b536.js";import"./shared-ef0fc329.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-0672e78b.js";import{l as e,u as t}from"./shared-99065f2a.js";import{u as s,h as i,c as a}from"./shared-7f33a83a.js";import{B as r}from"./shared-002b788f.js";import{C as n}from"./shared-5ad8c9a0.js";import"./foxy-nucleon-element.js";import{T as o,a as d}from"./shared-29e21467.js";import{c as l}from"./shared-4e709717.js";import{N as c}from"./shared-b7423eab.js";import"./shared-c52d3772.js";import"./shared-7b167fe9.js";import"./shared-a8ced8bf.js";import"./shared-4975f86f.js";import"./shared-dc798bf4.js";import"./shared-4f037e43.js";import"./shared-d3bf9ac0.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";const m=s("\n repeating-radial-gradient(\n circle at -100% 500%,\n rgba(255, 255, 255, 0),\n rgba(255, 255, 255, 0.05) 4px\n )\n"),h=s(Object.entries({unknown:"#797c85",amex:"#2557d6",diners:"#0079be",discover:"#4d4d4d",jcb:"#0e4c96",maestro:"#181818",mastercard:"#16366f",unionpay:"#0dadb5",visa:"#0e4595"}).map((([e,t])=>`.bg-${e} { background: ${t} ${m} }`)).join(" "));let p,f,u,b,v,y,_,g=e=>e;const j=o(n(d(c,"payment-method-card")));class $ extends j{constructor(){super(...arguments),this.templates={},this.__renderActionsDelete=()=>i(p||(p=g` <div class="flex"> ${0} <vaadin-button class="px-xs rounded" theme="icon" style="--lumo-primary-text-color:#fff;--lumo-primary-color-50pct:rgba(255, 255, 255, 0.5);--lumo-contrast-5pct:rgba(255, 255, 255, 0.05)" aria-label="${0}" data-testid="actions:delete" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:delete"></iron-icon> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("actions:delete:before"),this.t("delete").toString(),this.disabledSelector.matches("actions:delete",!0),this.__handleDelete,this.renderTemplateOrSlot("actions:delete:after")),this.__renderActions=()=>i(f||(f=g` <div class="flex" data-testid="actions"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("actions:before"),this.hiddenSelector.matches("actions:delete",!0)?"":this.__renderActionsDelete(),this.renderTemplateOrSlot("actions:after"))}static get styles(){return[super.styles,h,a(u||(u=g`.ratio-card{padding-top:63%;position:relative;height:0}.ratio-card>*{position:absolute;top:0;right:0;bottom:0;left:0}`))]}render(){var s,a,n,o,d,c;const{data:m,lang:h,ns:p}=this;if(this.in({idle:"template"})||!(null==m?void 0:m.save_cc)||!this.in("idle")){const e=this.in("fail")?"error":this.in("busy")?"busy":"empty";return i(b||(b=g` <div class="ratio-card" aria-live="polite" aria-busy="${0}" data-testid="wrapper"> <div class="h-full bg-contrast-5"></div> <div class="absolute inset-0 flex items-center justify-center"> <foxy-spinner data-testid="spinner" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),e,this.lang,p,null!==(a=null===(s=customElements.get("foxy-spinner"))||void 0===s?void 0:s.defaultNS)&&void 0!==a?a:"")}const f=null!==(o=null===(n=m.cc_type)||void 0===n?void 0:n.toLowerCase())&&void 0!==o?o:"unknown",u=null!==(d=e[f])&&void 0!==d?d:t,j=null===(c=m.cc_number_masked)||void 0===c?void 0:c.substring(m.cc_number_masked.length-4);return i(v||(v=g` <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <div class="ratio-card" data-testid="wrapper" aria-busy="${0}" aria-live="polite"> <div class="flex flex-col justify-between text-base text-m leading-m font-lumo p-m bg-unknown bg-${0}"> <div class="${0}"> ${0} <div class="ml-auto rounded h-m">${0}</div> </div> <div class="font-tnum leading-none flex justify-between"> <div data-testid="expiry"> ${0} </div> <div data-testid="number"> ${0} </div> </div> </div> </div> `),h,p,this.__handleConfirmHide,this.in("busy"),f,l({"flex items-start":!0,"justify-between":this.readonlyControls===r.False,"justify-end":this.readonlyControls===r.True}),this.hiddenSelector.matches("actions",!0)?"":this.__renderActions(),u,m.cc_exp_month&&m.cc_exp_year?i(y||(y=g` <span class="sr-only">${0}&nbsp;</span> <span>${0} / ${0}</span> `),this.t("expires").toString(),m.cc_exp_month,m.cc_exp_year):"",j?i(_||(_=g` <span class="sr-only">${0}&nbsp;</span> <span aria-hidden="true">••••</span> <span>${0}</span> `),this.t("last_4_digits").toString(),j):"")}async _sendDelete(){const e=JSON.stringify({save_cc:!1});await this._fetch(this.href,{method:"PATCH",body:e});return c.Rumour(this.group).share({data:null,source:this.href,related:[this.parent]}),null}__handleDelete(e){this.renderRoot.querySelector("#confirm").show(e.currentTarget)}__handleConfirmHide(e){e.detail.cancelled||this.delete()}}customElements.define("foxy-payment-method-card",$);export{$ as PaymentMethodCard};
@@ -1 +1 @@
1
- import{I as t}from"./shared-1d851ca7.js";import"./shared-4623f740.js";import{_ as e}from"./shared-a8ced8bf.js";import{a as s}from"./shared-ff13276c.js";import{h as r}from"./shared-7f33a83a.js";import"./foxy-spinner.js";import"./shared-a98a6602.js";import"./shared-08d6d02b.js";import"./shared-3b22a756.js";import"./shared-4f037e43.js";import"./shared-2af327d0.js";import"./shared-15278fe0.js";import"./shared-a420358e.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";import"./shared-4e709717.js";let a,i,d=t=>t;const l=s(t,"payments-api-fraud-protection-card");class o extends l{constructor(){super(...arguments),this.getImageSrc=null}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='M0 20.73v-9.9L10.83 0h9.9L0 20.73ZM0 0h9.41L0 9.41V0Zm0 22.14L22.14 0h9.9l-9.43 9.44-.61-.27-10.5 4.66v7-.29L0 32.04v-9.9Zm11.54-.23L0 33.46v9.9l14.14-14.14a15 15 0 0 1-2.6-7.3Zm3.2 8.12L.77 44h9.9l9.7-9.7a13.75 13.75 0 0 1-5.63-4.27Zm6.67 4.64L12.08 44h9.9L44 21.98v-9.9L32.16 23.92C31.01 29.15 27.05 33.6 22 34.83l-.59-.16Zm11.02-12.43L44 10.67V.77L31.42 13.35l1.08.48v7a13 13 0 0 1-.07 1.4Zm-1.99-9.32L43.35 0h-9.9l-9.87 9.87 6.86 3.05ZM23.4 44 44 23.4v9.9L33.3 44h-9.9Zm11.31 0L44 34.71V44h-9.29Z'/%3E%3Cpath fill='%23fff' d='M30.17 21.99H22V11.72l-8.17 3.63V22H22v10.42c4.34-1.34 7.55-5.63 8.17-10.43Z'/%3E%3C/svg%3E"}static get properties(){return e(e({},super.properties),{},{getImageSrc:{attribute:!1}})}renderBody(){var t,e;const s=this.data,l=o.defaultImageSrc;return r(a||(a=d` <figure class="flex items-center gap-m h-m"> <img class="relative h-s w-s object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="${0}" @error="${0}"> <figcaption class="min-w-0 flex-1"> <dl class="flex justify-between gap-s"> <dt class="sr-only">${0}</dt> <dd class="font-semibold truncate flex-shrink-0"> ${0}&ZeroWidthSpace; </dd> ${0} </dl> </figcaption> </figure> `),null!==(e=s?null===(t=this.getImageSrc)||void 0===t?void 0:t.call(this,s.type):null)&&void 0!==e?e:l,this.t("image_alt"),(t=>t.currentTarget.src=l),this.t("title_description"),null==s?void 0:s.helper.name,(null==s?void 0:s.helper.name)!==(null==s?void 0:s.description)?r(i||(i=d` <dt class="sr-only">${0}</dt> <dd class="truncate text-tertiary">${0}</dd> `),this.t("subtitle_description"),null==s?void 0:s.description):"")}}customElements.define("foxy-payments-api-fraud-protection-card",o);export{o as PaymentsApiFraudProtectionCard};
1
+ import{I as e}from"./shared-6e6ed30a.js";import"./shared-0672e78b.js";import{_ as t}from"./shared-a8ced8bf.js";import{a as s}from"./shared-29e21467.js";import{h as r}from"./shared-7f33a83a.js";import"./foxy-spinner.js";import"./shared-c484320b.js";import"./shared-c52d3772.js";import"./shared-ea316e64.js";import"./shared-4f037e43.js";import"./shared-002b788f.js";import"./shared-b7423eab.js";import"./shared-dc798bf4.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";import"./shared-4e709717.js";let a,i,d=e=>e;const l=s(e,"payments-api-fraud-protection-card");class o extends l{constructor(){super(...arguments),this.getImageSrc=null}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='M0 20.73v-9.9L10.83 0h9.9L0 20.73ZM0 0h9.41L0 9.41V0Zm0 22.14L22.14 0h9.9l-9.43 9.44-.61-.27-10.5 4.66v7-.29L0 32.04v-9.9Zm11.54-.23L0 33.46v9.9l14.14-14.14a15 15 0 0 1-2.6-7.3Zm3.2 8.12L.77 44h9.9l9.7-9.7a13.75 13.75 0 0 1-5.63-4.27Zm6.67 4.64L12.08 44h9.9L44 21.98v-9.9L32.16 23.92C31.01 29.15 27.05 33.6 22 34.83l-.59-.16Zm11.02-12.43L44 10.67V.77L31.42 13.35l1.08.48v7a13 13 0 0 1-.07 1.4Zm-1.99-9.32L43.35 0h-9.9l-9.87 9.87 6.86 3.05ZM23.4 44 44 23.4v9.9L33.3 44h-9.9Zm11.31 0L44 34.71V44h-9.29Z'/%3E%3Cpath fill='%23fff' d='M30.17 21.99H22V11.72l-8.17 3.63V22H22v10.42c4.34-1.34 7.55-5.63 8.17-10.43Z'/%3E%3C/svg%3E"}static get properties(){return t(t({},super.properties),{},{getImageSrc:{attribute:!1}})}renderBody(){var e,t;const s=this.data,l=o.defaultImageSrc;return r(a||(a=d` <figure class="flex items-center gap-m h-m"> <img class="relative h-s w-s object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="${0}" @error="${0}"> <figcaption class="min-w-0 flex-1"> <dl class="flex justify-between gap-s"> <dt class="sr-only">${0}</dt> <dd class="font-semibold truncate flex-shrink-0"> ${0}&ZeroWidthSpace; </dd> ${0} </dl> </figcaption> </figure> `),null!==(t=s?null===(e=this.getImageSrc)||void 0===e?void 0:e.call(this,s.type):null)&&void 0!==t?t:l,this.t("image_alt"),(e=>e.currentTarget.src=l),this.t("title_description"),null==s?void 0:s.helper.name,(null==s?void 0:s.helper.name)!==(null==s?void 0:s.description)?r(i||(i=d` <dt class="sr-only">${0}</dt> <dd class="truncate text-tertiary">${0}</dd> `),this.t("subtitle_description"),null==s?void 0:s.description):"")}}customElements.define("foxy-payments-api-fraud-protection-card",o);export{o as PaymentsApiFraudProtectionCard};
@@ -1 +1 @@
1
- import{h as e,s as t}from"./shared-f43a5253.js";import"./shared-a0c09692.js";import"./shared-b97d9ae3.js";import"./shared-b617fde5.js";import"./shared-b1b40832.js";import"./shared-1e9dc71f.js";import"./shared-59d73648.js";import{I as r}from"./shared-17d5d718.js";import"./shared-4623f740.js";import{_ as o,l as i}from"./shared-a8ced8bf.js";import{a as s}from"./shared-ff13276c.js";import{h as l}from"./shared-7f33a83a.js";import{Q as a}from"./shared-2af327d0.js";import"./shared-d82f3ba0.js";import"./shared-3d0dc4a6.js";import"./shared-08d6d02b.js";import"./shared-de385bdb.js";import"./shared-0db7afef.js";import"./shared-7bfd93b7.js";import"./shared-a98a6602.js";import"./shared-d3bf9ac0.js";import"./shared-a420358e.js";import"./shared-03d5434f.js";import"./shared-e6bff624.js";import"./shared-788e5ff5.js";import"./shared-77359cd0.js";import"./shared-0479553e.js";import"./shared-a8966936.js";import"./shared-4f037e43.js";import"./shared-15278fe0.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";import"./shared-e4bc532a.js";import"./shared-b5b5c848.js";import"./shared-6822bc96.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-3b22a756.js";let d,n,c,p,h,f,m,u,v,b,g,x=e=>e;class j extends(s(r,"payments-api-fraud-protection-form")){constructor(){super(...arguments),this.getImageSrc=null}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='M0 20.73v-9.9L10.83 0h9.9L0 20.73ZM0 0h9.41L0 9.41V0Zm0 22.14L22.14 0h9.9l-9.43 9.44-.61-.27-10.5 4.66v7-.29L0 32.04v-9.9Zm11.54-.23L0 33.46v9.9l14.14-14.14a15 15 0 0 1-2.6-7.3Zm3.2 8.12L.77 44h9.9l9.7-9.7a13.75 13.75 0 0 1-5.63-4.27Zm6.67 4.64L12.08 44h9.9L44 21.98v-9.9L32.16 23.92C31.01 29.15 27.05 33.6 22 34.83l-.59-.16Zm11.02-12.43L44 10.67V.77L31.42 13.35l1.08.48v7a13 13 0 0 1-.07 1.4Zm-1.99-9.32L43.35 0h-9.9l-9.87 9.87 6.86 3.05ZM23.4 44 44 23.4v9.9L33.3 44h-9.9Zm11.31 0L44 34.71V44h-9.29Z'/%3E%3Cpath fill='%23fff' d='M30.17 21.99H22V11.72l-8.17 3.63V22H22v10.42c4.34-1.34 7.55-5.63 8.17-10.43Z'/%3E%3C/svg%3E"}static get properties(){return o(o({},super.properties),{},{getImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",({score_threshold_reject:e})=>"number"!=typeof e||e<=100&&e>=0||"score-threshold-reject:v8n_out_of_range",t=>{var r,o,i,s;const l=null!==(i=null===(o=null===(r=t.helper)||void 0===r?void 0:r.json)||void 0===o?void 0:o.blocks)&&void 0!==i?i:[];let a;try{a=JSON.parse(null!==(s=t.json)&&void 0!==s?s:"{}")}catch(e){a={}}for(const t of l)for(const r of t.fields)if("optional"in r&&!r.optional){const o=[t.parent_id,t.id,r.id].filter((e=>!!e));if(!e(a,o)&&"checkbox"!==r.type)return"additional-fields:v8n_invalid"}return!0}]}renderBody(){var e,t,r,o,s,a,m,u,v,b;let g;try{const e=i(/\/payment_presets\/(.+)\//,{presetId:1}).exec(new URL(this.href||this.parent).pathname).groups.presetId;g=new URL(`/payment_presets/${e}/available_fraud_protections`,this.href||this.parent).toString()}catch(e){g=""}const y=null===(e=this.renderRoot.querySelector("#available-fraud-protections"))||void 0===e?void 0:e.data,_=j.defaultImageSrc;return l(d||(d=x` <foxy-nucleon class="hidden" href="${0}" id="available-fraud-protections" @update="${0}"> </foxy-nucleon> ${0} `),g,(()=>this.requestUpdate()),this.form.type?l(n||(n=x` <figure class="relative flex flex-col gap-m p-m items-center"> <img class="relative h-xl w-xl object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <figcaption class="relative min-w-0 font-bold text-xl text-center"> ${0}&ZeroWidthSpace; </figcaption> </figure> <div class="rounded-t-l rounded-b-l border border-contrast-10 p-m grid grid-cols-1 gap-m"> ${0} ${0} </div> <foxy-internal-text-control infer="description"></foxy-internal-text-control> ${0} ${0} `),null!==(r=null===(t=this.getImageSrc)||void 0===t?void 0:t.call(this,this.form.type))&&void 0!==r?r:_,(e=>e.currentTarget.src=_),null!==(s=null===(o=this.form.helper)||void 0===o?void 0:o.name)&&void 0!==s?s:this.form.type,(null===(a=this.form.helper)||void 0===a?void 0:a.uses_rejection_threshold)?l(c||(c=x` <foxy-internal-integer-control infer="score-threshold-reject"> </foxy-internal-integer-control> `)):"",null===(u=null===(m=this.form.helper)||void 0===m?void 0:m.json)||void 0===u?void 0:u.blocks.map((e=>this.__renderBlock(e))),(null===(v=this.data)||void 0===v?void 0:v.type)?"":l(p||(p=x` <vaadin-button theme="contrast" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())),super.renderBody()):l(h||(h=x` <foxy-i18n class="block text-xxl font-bold border-b border-contrast-10 pb-m" infer="" key="select_protection_title"> </foxy-i18n> <div> <div class="-my-s grid grid-cols-1"> ${0} </div> </div> `),Object.entries(null!==(b=null==y?void 0:y.values)&&void 0!==b?b:{}).map((([e,t])=>{var r,o;return l(f||(f=x` <button class="block text-left hover-bg-contrast-5 p-s rounded-t-l rounded-b-l -mx-s" @click="${0}"> <figure class="flex items-center gap-m h-m"> <img class="relative h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <figcaption class="min-w-0 flex-1 truncate leading-s font-semibold"> ${0}&ZeroWidthSpace; </figcaption> </figure> </button> `),(()=>this.edit({type:e,helper:t})),null!==(o=null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,e))&&void 0!==o?o:_,(e=>e.currentTarget.src=_),t.name)}))))}__renderBlock(e){return l(m||(m=x`${0}`),e.fields.map((r=>{var o,i,s,d,n,c;const p=()=>{var t,o;let i;try{i=JSON.parse(null!==(t=this.form.json)&&void 0!==t?t:"")}catch(e){i={}}const s=[e.parent_id,e.id,r.id].filter((e=>!!e));return null!==(o=a(i,s))&&void 0!==o?o:i.default_value},h=o=>{var i;let s;try{s=JSON.parse(null!==(i=this.form.json)&&void 0!==i?i:"")}catch(e){s={}}const l=[e.parent_id,e.id,r.id].filter((e=>!!e));this.edit({json:JSON.stringify(t(s,l,o))})},f=r.options;return l(u||(u=x` ${0} `),"checkbox"===r.type?l(v||(v=x` <foxy-internal-checkbox-group-control helper-text="${0}" label="" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> `),null!==(o=r.description)&&void 0!==o?o:"",[{label:r.name,value:"checked"}],p,(e=>h(e.includes("checked")))):"select"===r.type?l(b||(b=x` <foxy-internal-select-control helper-text="${0}" placeholder="${0}" label="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),null!==(i=r.description)&&void 0!==i?i:"",null!==(n=null===(d=null===(s=r.options)||void 0===s?void 0:s.find((e=>e.value===r.default_value)))||void 0===d?void 0:d.name)&&void 0!==n?n:this.t("default_additional_field_placeholder"),r.name,f.map((({name:e,value:t})=>({label:e,value:t}))),p,h):l(g||(g=x` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" label="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(c=r.description)&&void 0!==c?c:"",r.default_value||this.t("default_additional_field_placeholder"),r.name,p,h))})))}}customElements.define("foxy-payments-api-fraud-protection-form",j);export{j as PaymentsApiFraudProtectionForm};
1
+ import"./shared-f022673a.js";import"./shared-2f1e04ae.js";import"./shared-ad8141c4.js";import"./shared-cfec6ec1.js";import"./shared-40d82f6b.js";import"./shared-bd194cdf.js";import"./shared-71deb26e.js";import{I as e}from"./shared-92bd849f.js";import"./shared-0672e78b.js";import{_ as t,l as r}from"./shared-a8ced8bf.js";import{a as o}from"./shared-29e21467.js";import{h as s}from"./shared-7f33a83a.js";import{Q as i}from"./shared-002b788f.js";import{h as l,s as a}from"./shared-515f00b1.js";import"./shared-7b167fe9.js";import"./shared-c52d3772.js";import"./shared-6b8874a7.js";import"./shared-923da875.js";import"./shared-c484320b.js";import"./shared-e396ec04.js";import"./shared-b28dbc68.js";import"./shared-2215e6c8.js";import"./shared-d3bf9ac0.js";import"./shared-dc798bf4.js";import"./shared-85f9051e.js";import"./shared-d43fc5cc.js";import"./shared-34b11d34.js";import"./shared-e3ce88dc.js";import"./shared-4c338ca6.js";import"./shared-0479553e.js";import"./shared-5ad8c9a0.js";import"./shared-4f037e43.js";import"./shared-b7423eab.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";import"./shared-b8e9b536.js";import"./shared-ef0fc329.js";import"./shared-4975f86f.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-ea316e64.js";import"./shared-92926b1d.js";let d,n,c,p,h,f,m,u,v,b,g,j=e=>e;class x extends(o(e,"payments-api-fraud-protection-form")){constructor(){super(...arguments),this.getImageSrc=null}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='M0 20.73v-9.9L10.83 0h9.9L0 20.73ZM0 0h9.41L0 9.41V0Zm0 22.14L22.14 0h9.9l-9.43 9.44-.61-.27-10.5 4.66v7-.29L0 32.04v-9.9Zm11.54-.23L0 33.46v9.9l14.14-14.14a15 15 0 0 1-2.6-7.3Zm3.2 8.12L.77 44h9.9l9.7-9.7a13.75 13.75 0 0 1-5.63-4.27Zm6.67 4.64L12.08 44h9.9L44 21.98v-9.9L32.16 23.92C31.01 29.15 27.05 33.6 22 34.83l-.59-.16Zm11.02-12.43L44 10.67V.77L31.42 13.35l1.08.48v7a13 13 0 0 1-.07 1.4Zm-1.99-9.32L43.35 0h-9.9l-9.87 9.87 6.86 3.05ZM23.4 44 44 23.4v9.9L33.3 44h-9.9Zm11.31 0L44 34.71V44h-9.29Z'/%3E%3Cpath fill='%23fff' d='M30.17 21.99H22V11.72l-8.17 3.63V22H22v10.42c4.34-1.34 7.55-5.63 8.17-10.43Z'/%3E%3C/svg%3E"}static get properties(){return t(t({},super.properties),{},{getImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",({score_threshold_reject:e})=>"number"!=typeof e||e<=100&&e>=0||"score-threshold-reject:v8n_out_of_range",e=>{var t,r,o,s;const i=null!==(o=null===(r=null===(t=e.helper)||void 0===t?void 0:t.json)||void 0===r?void 0:r.blocks)&&void 0!==o?o:[];let a;try{a=JSON.parse(null!==(s=e.json)&&void 0!==s?s:"{}")}catch(e){a={}}for(const e of i)for(const t of e.fields)if("optional"in t&&!t.optional){const r=[e.parent_id,e.id,t.id].filter((e=>!!e));if(!l(a,r)&&"checkbox"!==t.type)return"additional-fields:v8n_invalid"}return!0}]}renderBody(){var e,t,o,i,l,a,m,u,v,b;let g;try{const e=r(/\/payment_presets\/(.+)\//,{presetId:1}).exec(new URL(this.href||this.parent).pathname).groups.presetId;g=new URL(`/payment_presets/${e}/available_fraud_protections`,this.href||this.parent).toString()}catch(e){g=""}const y=null===(e=this.renderRoot.querySelector("#available-fraud-protections"))||void 0===e?void 0:e.data,_=x.defaultImageSrc;return s(d||(d=j` <foxy-nucleon class="hidden" href="${0}" id="available-fraud-protections" @update="${0}"> </foxy-nucleon> ${0} `),g,(()=>this.requestUpdate()),this.form.type?s(n||(n=j` <figure class="relative flex flex-col gap-m p-m items-center"> <img class="relative h-xl w-xl object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <figcaption class="relative min-w-0 font-bold text-xl text-center"> ${0}&ZeroWidthSpace; </figcaption> </figure> <div class="rounded-t-l rounded-b-l border border-contrast-10 p-m grid grid-cols-1 gap-m"> ${0} ${0} </div> <foxy-internal-text-control infer="description"></foxy-internal-text-control> ${0} ${0} `),null!==(o=null===(t=this.getImageSrc)||void 0===t?void 0:t.call(this,this.form.type))&&void 0!==o?o:_,(e=>e.currentTarget.src=_),null!==(l=null===(i=this.form.helper)||void 0===i?void 0:i.name)&&void 0!==l?l:this.form.type,(null===(a=this.form.helper)||void 0===a?void 0:a.uses_rejection_threshold)?s(c||(c=j` <foxy-internal-integer-control infer="score-threshold-reject"> </foxy-internal-integer-control> `)):"",null===(u=null===(m=this.form.helper)||void 0===m?void 0:m.json)||void 0===u?void 0:u.blocks.map((e=>this.__renderBlock(e))),(null===(v=this.data)||void 0===v?void 0:v.type)?"":s(p||(p=j` <vaadin-button theme="contrast" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())),super.renderBody()):s(h||(h=j` <foxy-i18n class="block text-xxl font-bold border-b border-contrast-10 pb-m" infer="" key="select_protection_title"> </foxy-i18n> <div> <div class="-my-s grid grid-cols-1"> ${0} </div> </div> `),Object.entries(null!==(b=null==y?void 0:y.values)&&void 0!==b?b:{}).map((([e,t])=>{var r,o;return s(f||(f=j` <button class="block text-left hover-bg-contrast-5 p-s rounded-t-l rounded-b-l -mx-s" @click="${0}"> <figure class="flex items-center gap-m h-m"> <img class="relative h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <figcaption class="min-w-0 flex-1 truncate leading-s font-semibold"> ${0}&ZeroWidthSpace; </figcaption> </figure> </button> `),(()=>this.edit({type:e,helper:t})),null!==(o=null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,e))&&void 0!==o?o:_,(e=>e.currentTarget.src=_),t.name)}))))}__renderBlock(e){return s(m||(m=j`${0}`),e.fields.map((t=>{var r,o,l,d,n,c;const p=()=>{var r,o;let s;try{s=JSON.parse(null!==(r=this.form.json)&&void 0!==r?r:"")}catch(e){s={}}const l=[e.parent_id,e.id,t.id].filter((e=>!!e));return null!==(o=i(s,l))&&void 0!==o?o:s.default_value},h=r=>{var o;let s;try{s=JSON.parse(null!==(o=this.form.json)&&void 0!==o?o:"")}catch(e){s={}}const i=[e.parent_id,e.id,t.id].filter((e=>!!e));this.edit({json:JSON.stringify(a(s,i,r))})},f=t.options;return s(u||(u=j` ${0} `),"checkbox"===t.type?s(v||(v=j` <foxy-internal-checkbox-group-control helper-text="${0}" label="" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> `),null!==(r=t.description)&&void 0!==r?r:"",[{label:t.name,value:"checked"}],p,(e=>h(e.includes("checked")))):"select"===t.type?s(b||(b=j` <foxy-internal-select-control helper-text="${0}" placeholder="${0}" label="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),null!==(o=t.description)&&void 0!==o?o:"",null!==(n=null===(d=null===(l=t.options)||void 0===l?void 0:l.find((e=>e.value===t.default_value)))||void 0===d?void 0:d.name)&&void 0!==n?n:this.t("default_additional_field_placeholder"),t.name,f.map((({name:e,value:t})=>({label:e,value:t}))),p,h):s(g||(g=j` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" label="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(c=t.description)&&void 0!==c?c:"",t.default_value||this.t("default_additional_field_placeholder"),t.name,p,h))})))}}customElements.define("foxy-payments-api-fraud-protection-form",x);export{x as PaymentsApiFraudProtectionForm};
@@ -1 +1 @@
1
- import{I as e}from"./shared-1d851ca7.js";import"./shared-4623f740.js";import{_ as t}from"./shared-a8ced8bf.js";import{a as s}from"./shared-ff13276c.js";import{h as r}from"./shared-7f33a83a.js";import"./foxy-spinner.js";import"./shared-a98a6602.js";import"./shared-08d6d02b.js";import"./shared-3b22a756.js";import"./shared-4f037e43.js";import"./shared-2af327d0.js";import"./shared-15278fe0.js";import"./shared-a420358e.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";import"./shared-4e709717.js";let a,i,l=e=>e;const d=s(e,"payments-api-payment-method-card");class o extends d{constructor(){super(...arguments),this.paymentGatewaysHelper=null,this.getImageSrc=null}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='m29.3 14 14-14H32.1l-14 14h11.2Zm2.7 9.9 12-12V.7L30.62 14.1A2 2 0 0 1 32 16v7.9ZM13.31 44h11.18L44 24.5V13.3l-12 12V28a2 2 0 0 1-2 2h-2.69l-14 14Zm-1.41 0H.7l14-14h11.2l-14 14Zm14 0h11.2l6.9-6.9V25.9L25.9 44Zm12.6 0H44v-5.5L38.5 44Z'/%3E%3Cpath fill='%23fff' d='M30 28H14v-6h16v6Zm0-10v-2H14v2h16ZM0 43.3l13.4-13.4A2 2 0 0 1 12 28v-7.9L0 32.12V43.3Z'/%3E%3Cpath fill='%23fff' d='M16.7 14H14c-1.11 0-1.99.89-1.99 2v2.7L0 30.7V19.52L19.52 0H30.7l-14 14Zm1.4-14H6.92L0 6.92V18.1L18.1 0ZM5.5 0H0v5.5L5.5 0Z'/%3E%3C/svg%3E"}static get properties(){return t(t({},super.properties),{},{paymentGatewaysHelper:{type:String,attribute:"payment-gateways-helper"},getImageSrc:{attribute:!1}})}renderBody(){var e,t;const s=o.defaultImageSrc,d=this.data;return r(a||(a=l` <figure class="flex items-center gap-m h-m"> <img class="relative h-s w-s object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="${0}" @error="${0}"> <figcaption class="min-w-0 flex-1"> <dl class="flex justify-between gap-s"> <dt class="sr-only">${0}</dt> <dd class="font-semibold truncate flex-shrink-0"> ${0}&ZeroWidthSpace; </dd> ${0} </dl> </figcaption> </figure> `),null!==(t=d?null===(e=this.getImageSrc)||void 0===e?void 0:e.call(this,d.type):null)&&void 0!==t?t:s,this.t("image_alt"),(e=>e.currentTarget.src=s),this.t("title_description"),null==d?void 0:d.helper.name,(null==d?void 0:d.helper.name)!==(null==d?void 0:d.description)?r(i||(i=l` <dt class="sr-only">${0}</dt> <dd class="truncate text-tertiary">${0}</dd> `),this.t("subtitle_description"),null==d?void 0:d.description):"")}}customElements.define("foxy-payments-api-payment-method-card",o);export{o as PaymentsApiPaymentMethodCard};
1
+ import{I as e}from"./shared-6e6ed30a.js";import"./shared-0672e78b.js";import{_ as t}from"./shared-a8ced8bf.js";import{a as s}from"./shared-29e21467.js";import{h as r}from"./shared-7f33a83a.js";import"./foxy-spinner.js";import"./shared-c484320b.js";import"./shared-c52d3772.js";import"./shared-ea316e64.js";import"./shared-4f037e43.js";import"./shared-002b788f.js";import"./shared-b7423eab.js";import"./shared-dc798bf4.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";import"./shared-4e709717.js";let a,i,l=e=>e;const d=s(e,"payments-api-payment-method-card");class o extends d{constructor(){super(...arguments),this.paymentGatewaysHelper=null,this.getImageSrc=null}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='m29.3 14 14-14H32.1l-14 14h11.2Zm2.7 9.9 12-12V.7L30.62 14.1A2 2 0 0 1 32 16v7.9ZM13.31 44h11.18L44 24.5V13.3l-12 12V28a2 2 0 0 1-2 2h-2.69l-14 14Zm-1.41 0H.7l14-14h11.2l-14 14Zm14 0h11.2l6.9-6.9V25.9L25.9 44Zm12.6 0H44v-5.5L38.5 44Z'/%3E%3Cpath fill='%23fff' d='M30 28H14v-6h16v6Zm0-10v-2H14v2h16ZM0 43.3l13.4-13.4A2 2 0 0 1 12 28v-7.9L0 32.12V43.3Z'/%3E%3Cpath fill='%23fff' d='M16.7 14H14c-1.11 0-1.99.89-1.99 2v2.7L0 30.7V19.52L19.52 0H30.7l-14 14Zm1.4-14H6.92L0 6.92V18.1L18.1 0ZM5.5 0H0v5.5L5.5 0Z'/%3E%3C/svg%3E"}static get properties(){return t(t({},super.properties),{},{paymentGatewaysHelper:{type:String,attribute:"payment-gateways-helper"},getImageSrc:{attribute:!1}})}renderBody(){var e,t;const s=o.defaultImageSrc,d=this.data;return r(a||(a=l` <figure class="flex items-center gap-m h-m"> <img class="relative h-s w-s object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="${0}" @error="${0}"> <figcaption class="min-w-0 flex-1"> <dl class="flex justify-between gap-s"> <dt class="sr-only">${0}</dt> <dd class="font-semibold truncate flex-shrink-0"> ${0}&ZeroWidthSpace; </dd> ${0} </dl> </figcaption> </figure> `),null!==(t=d?null===(e=this.getImageSrc)||void 0===e?void 0:e.call(this,d.type):null)&&void 0!==t?t:s,this.t("image_alt"),(e=>e.currentTarget.src=s),this.t("title_description"),null==d?void 0:d.helper.name,(null==d?void 0:d.helper.name)!==(null==d?void 0:d.description)?r(i||(i=l` <dt class="sr-only">${0}</dt> <dd class="truncate text-tertiary">${0}</dd> `),this.t("subtitle_description"),null==d?void 0:d.description):"")}}customElements.define("foxy-payments-api-payment-method-card",o);export{o as PaymentsApiPaymentMethodCard};
@@ -1 +1 @@
1
- import{h as e,s as t}from"./shared-f43a5253.js";import"./shared-a0c09692.js";import"./shared-b97d9ae3.js";import"./shared-b617fde5.js";import"./shared-1e9dc71f.js";import"./shared-59d73648.js";import{I as r}from"./shared-17d5d718.js";import"./shared-4623f740.js";import{_ as i,l as o}from"./shared-a8ced8bf.js";import{a as l}from"./shared-ff13276c.js";import{c as a}from"./shared-4e709717.js";import{h as s}from"./shared-7f33a83a.js";import{Q as n}from"./shared-2af327d0.js";import"./shared-d82f3ba0.js";import"./shared-3d0dc4a6.js";import"./shared-08d6d02b.js";import"./shared-de385bdb.js";import"./shared-0db7afef.js";import"./shared-7bfd93b7.js";import"./shared-a98a6602.js";import"./shared-d3bf9ac0.js";import"./shared-a420358e.js";import"./shared-03d5434f.js";import"./shared-77359cd0.js";import"./shared-0479553e.js";import"./shared-a8966936.js";import"./shared-4f037e43.js";import"./shared-15278fe0.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";import"./shared-e4bc532a.js";import"./shared-b5b5c848.js";import"./shared-6822bc96.js";import"./foxy-spinner.js";import"./shared-3b22a756.js";let d,c,p,f,h,m,u,v,_,y,x,b,g,$,k,j,w,V,S,Z,L=e=>e;class B extends(l(r,"payments-api-payment-method-form")){constructor(){super(...arguments),this.getImageSrc=null,this.__tab=0}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='m29.3 14 14-14H32.1l-14 14h11.2Zm2.7 9.9 12-12V.7L30.62 14.1A2 2 0 0 1 32 16v7.9ZM13.31 44h11.18L44 24.5V13.3l-12 12V28a2 2 0 0 1-2 2h-2.69l-14 14Zm-1.41 0H.7l14-14h11.2l-14 14Zm14 0h11.2l6.9-6.9V25.9L25.9 44Zm12.6 0H44v-5.5L38.5 44Z'/%3E%3Cpath fill='%23fff' d='M30 28H14v-6h16v6Zm0-10v-2H14v2h16ZM0 43.3l13.4-13.4A2 2 0 0 1 12 28v-7.9L0 32.12V43.3Z'/%3E%3Cpath fill='%23fff' d='M16.7 14H14c-1.11 0-1.99.89-1.99 2v2.7L0 30.7V19.52L19.52 0H30.7l-14 14Zm1.4-14H6.92L0 6.92V18.1L18.1 0ZM5.5 0H0v5.5L5.5 0Z'/%3E%3C/svg%3E"}static get properties(){return i(i({},super.properties),{},{__tab:{attribute:!1},getImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",t=>{var r,i,o,l;const a=null!==(o=null===(i=null===(r=t.helper)||void 0===r?void 0:r.additional_fields)||void 0===i?void 0:i.blocks)&&void 0!==o?o:[];let s;try{s=JSON.parse(null!==(l=t.additional_fields)&&void 0!==l?l:"{}")}catch(e){s={}}for(const t of a)for(const r of t.fields)if("optional"in r&&!r.optional){const i=[t.parent_id,t.id,r.id].filter((e=>!!e));if(!e(s,i)&&"checkbox"!==r.type)return"additional-fields:v8n_invalid"}return!0}]}renderBody(){var e,t,r,i,l,n,j,w,V,S,Z,H,I,q;let C;try{const e=o(/\/payment_presets\/(.+)\//,{presetId:1}).exec(new URL(this.href||this.parent).pathname).groups.presetId;C=new URL(`/payment_presets/${e}/available_payment_methods`,this.href||this.parent).toString()}catch(e){C=""}const W=null===(e=this.renderRoot.querySelector("#available-payment-methods"))||void 0===e?void 0:e.data,E=B.defaultImageSrc,M=Object.entries(null!==(t=null==W?void 0:W.values)&&void 0!==t?t:{}).sort(((e,t)=>e[0].localeCompare(t[0],"en"))).reduce(((e,[t,r])=>{const i=t.charAt(0).toUpperCase(),o=!/\w/.test(i)?"#":i,l=e.find((e=>e.name===o));return l?l.items.push({type:t,helper:r}):e.push({name:o,items:[{type:t,helper:r}]}),e}),[]);return s(d||(d=L` <foxy-nucleon class="hidden" href="${0}" id="available-payment-methods" @update="${0}"> </foxy-nucleon> ${0} `),C,(()=>this.requestUpdate()),this.form.type?s(c||(c=L` <figure class="relative flex flex-col gap-m p-m items-center"> <img class="relative h-xl w-xl object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <figcaption class="relative min-w-0 font-bold text-xl text-center"> ${0}&ZeroWidthSpace; </figcaption> </figure> <div class="rounded-t-l rounded-b-l border border-contrast-10"> <vaadin-tabs selected="${0}" theme="centered" @selected-changed="${0}"> <vaadin-tab><foxy-i18n infer="" key="tab_live"></foxy-i18n></vaadin-tab> <vaadin-tab><foxy-i18n infer="" key="tab_test"></foxy-i18n></vaadin-tab> </vaadin-tabs> <div class="overflow-hidden"> <div class="grid grid-cols-2 gap-m transition-transform transform duration-300" style="width:calc(200% + var(--lumo-space-m));--tw-translate-x:${0}"> <div class="grid grid-cols-1 gap-m p-m transition-opacity duration-300 ${0}"> ${0} ${0} ${0} ${0} </div> <div class="grid grid-cols-1 gap-m p-m transition-opacity duration-300 ${0}"> ${0} ${0} ${0} ${0} </div> </div> </div> </div> <foxy-internal-text-control infer="description"></foxy-internal-text-control> ${0} ${0} ${0} `),null!==(i=null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,this.form.type))&&void 0!==i?i:E,(e=>e.currentTarget.src=E),null!==(n=null===(l=this.form.helper)||void 0===l?void 0:l.name)&&void 0!==n?n:this.form.type,this.__tab,(e=>{var t;const r=e.currentTarget;this.__tab=null!==(t=r.selected)&&void 0!==t?t:0}),0===this.__tab?"0":"calc(-50% - (var(--lumo-space-m) / 2))",0===this.__tab?"opacity-100":"opacity-0",(null===(j=this.form.helper)||void 0===j?void 0:j.id_description)?s(p||(p=L` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="account-id"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.id_description):"",(null===(w=this.form.helper)||void 0===w?void 0:w.third_party_key_description)?s(f||(f=L` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="third-party-key"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.third_party_key_description):"",(null===(V=this.form.helper)||void 0===V?void 0:V.key_description)?s(h||(h=L` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="account-key"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.key_description):"",this.__liveBlocks.map((e=>this.__renderBlock(e))),1===this.__tab?"opacity-100":"opacity-0",(null===(S=this.form.helper)||void 0===S?void 0:S.id_description)?s(m||(m=L` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="test-account-id"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.id_description):"",(null===(Z=this.form.helper)||void 0===Z?void 0:Z.third_party_key_description)?s(u||(u=L` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="test-third-party-key"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.third_party_key_description):"",(null===(H=this.form.helper)||void 0===H?void 0:H.key_description)?s(v||(v=L` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="test-account-key"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.key_description):"",this.__testBlocks.map((e=>this.__renderBlock(e))),(null===(I=this.form.helper)||void 0===I?void 0:I.supports_3d_secure)?s(_||(_=L` <foxy-internal-radio-group-control infer="three-d-secure-toggle" class="-mb-s" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> ${0} `),(()=>{const e=this.form.config_3d_secure;return(null==e?void 0:e.startsWith("all_cards"))?"all_cards":(null==e?void 0:e.startsWith("maestro_only"))?"maestro_only":"off"}),(e=>{var t;let r="";"all_cards"!==e&&"maestro_only"!==e||(r=(null===(t=this.form.config_3d_secure)||void 0===t?void 0:t.endsWith("require_valid_response"))?`${e}_require_valid_response`:e),this.edit({config_3d_secure:r})}),[{value:"off",label:"option_off"},{value:"all_cards",label:"option_all_cards"},{value:"maestro_only",label:"option_maestro_only"}],this.form.config_3d_secure?s(y||(y=L` <foxy-internal-checkbox-group-control infer="three-d-secure-response" class="-mb-s" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> `),[{value:"valid_only",label:"option_valid_only"}],(()=>{var e;return(null===(e=this.form.config_3d_secure)||void 0===e?void 0:e.endsWith("require_valid_response"))?["valid_only"]:[]}),(e=>{const t=e.includes("valid_only")?"_require_valid_response":"",r=this.form.config_3d_secure,i=(null==r?void 0:r.startsWith("all_cards"))?"all_cards":"maestro_only";this.edit({config_3d_secure:`${i}${t}`})})):""):"",(null===(q=this.data)||void 0===q?void 0:q.type)?"":s(x||(x=L` <vaadin-button theme="contrast" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())),super.renderBody()):s(b||(b=L` <foxy-i18n class="block text-xxl font-bold border-b border-contrast-10 pb-m" infer="" key="select_method_title"> </foxy-i18n> <div> <div class="-my-s grid grid-cols-1"> ${0} </div> </div> `),M.map((e=>s(g||(g=L` <div class="w-m text-center font-semibold text-tertiary py-s"> ${0} </div> ${0} `),e.name,e.items.map((({type:e,helper:t})=>{var r,i;return s($||($=L` <button class="${0}" ?disabled="${0}" @click="${0}"> <figure class="flex items-center gap-m h-m"> <img class="relative h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <figcaption class="min-w-0 flex-1 truncate leading-s ${0}"> <div class="font-semibold">${0}&ZeroWidthSpace;</div> ${0} </figcaption> </figure> </button> `),a({"block text-left p-s rounded-t-l rounded-b-l -mx-s":!0,"transition-colors hover-bg-contrast-5":!t.conflict,"cursor-default":!!t.conflict}),!!t.conflict,(()=>this.edit({type:e,helper:t})),null!==(i=null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,e))&&void 0!==i?i:E,(e=>e.currentTarget.src=E),t.conflict?"text-tertiary":"",t.name,t.conflict?s(k||(k=L` <foxy-i18n class="block text-tertiary text-xs" infer="" key="conflict_message" .options="${0}"> </foxy-i18n> `),t.conflict):"")})))))))}get __liveBlocks(){var e,t,r;return null!==(r=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>e.is_live)))&&void 0!==r?r:[]}get __testBlocks(){var e,t,r;return null!==(r=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>!e.is_live)))&&void 0!==r?r:[]}__renderBlock(e){return s(j||(j=L`${0}`),e.fields.map((r=>{var i,o,l;const a=[e.parent_id,e.id,r.id].filter((e=>!!e)),d=["additional-fields",...a].join("-").replace(/_/g,"-"),c=()=>{var e,t;try{const r=JSON.parse(null!==(e=this.form.additional_fields)&&void 0!==e?e:"{}");return null!==(t=n(r,a))&&void 0!==t?t:r.default_value}catch(e){return r.default_value}},p=e=>{var r;try{const i=JSON.parse(null!==(r=this.form.additional_fields)&&void 0!==r?r:"{}");this.edit({additional_fields:JSON.stringify(t(i,a,e))})}catch(e){return""}},f=r.options;return s(w||(w=L` ${0} `),"checkbox"===r.type?s(V||(V=L` <foxy-internal-checkbox-group-control helper-text="${0}" label="" class="-mb-s" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> `),null!==(i=r.description)&&void 0!==i?i:"",d,[{label:r.name,value:"checked"}],c,(e=>{p(e.includes("checked"))})):"select"===r.type?s(S||(S=L` <foxy-internal-select-control helper-text="${0}" label="${0}" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),null!==(o=r.description)&&void 0!==o?o:"",r.name,d,f.map((({name:e,value:t})=>({label:e,value:t}))),c,p):s(Z||(Z=L` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(l=r.description)&&void 0!==l?l:"",r.default_value||this.t("default_additional_field_placeholder"),r.name,d,c,p))})))}}customElements.define("foxy-payments-api-payment-method-form",B);export{B as PaymentsApiPaymentMethodForm};
1
+ import"./shared-f022673a.js";import"./shared-2f1e04ae.js";import"./shared-ad8141c4.js";import"./shared-cfec6ec1.js";import"./shared-bd194cdf.js";import"./shared-71deb26e.js";import{I as e}from"./shared-92bd849f.js";import"./shared-0672e78b.js";import{_ as t,l as r}from"./shared-a8ced8bf.js";import{a as i}from"./shared-29e21467.js";import{c as o}from"./shared-4e709717.js";import{h as l}from"./shared-7f33a83a.js";import{h as a,s}from"./shared-515f00b1.js";import{Q as n}from"./shared-002b788f.js";import"./shared-7b167fe9.js";import"./shared-c52d3772.js";import"./shared-6b8874a7.js";import"./shared-923da875.js";import"./shared-c484320b.js";import"./shared-e396ec04.js";import"./shared-b28dbc68.js";import"./shared-2215e6c8.js";import"./shared-d3bf9ac0.js";import"./shared-dc798bf4.js";import"./shared-85f9051e.js";import"./shared-e3ce88dc.js";import"./shared-4c338ca6.js";import"./shared-0479553e.js";import"./shared-5ad8c9a0.js";import"./shared-4f037e43.js";import"./shared-b7423eab.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";import"./shared-b8e9b536.js";import"./shared-ef0fc329.js";import"./shared-4975f86f.js";import"./foxy-spinner.js";import"./shared-ea316e64.js";import"./shared-92926b1d.js";let d,c,p,f,h,m,u,v,_,y,x,b,g,$,j,k,w,V,S,Z,L=e=>e;class B extends(i(e,"payments-api-payment-method-form")){constructor(){super(...arguments),this.getImageSrc=null,this.__tab=0}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='m29.3 14 14-14H32.1l-14 14h11.2Zm2.7 9.9 12-12V.7L30.62 14.1A2 2 0 0 1 32 16v7.9ZM13.31 44h11.18L44 24.5V13.3l-12 12V28a2 2 0 0 1-2 2h-2.69l-14 14Zm-1.41 0H.7l14-14h11.2l-14 14Zm14 0h11.2l6.9-6.9V25.9L25.9 44Zm12.6 0H44v-5.5L38.5 44Z'/%3E%3Cpath fill='%23fff' d='M30 28H14v-6h16v6Zm0-10v-2H14v2h16ZM0 43.3l13.4-13.4A2 2 0 0 1 12 28v-7.9L0 32.12V43.3Z'/%3E%3Cpath fill='%23fff' d='M16.7 14H14c-1.11 0-1.99.89-1.99 2v2.7L0 30.7V19.52L19.52 0H30.7l-14 14Zm1.4-14H6.92L0 6.92V18.1L18.1 0ZM5.5 0H0v5.5L5.5 0Z'/%3E%3C/svg%3E"}static get properties(){return t(t({},super.properties),{},{__tab:{attribute:!1},getImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",e=>{var t,r,i,o;const l=null!==(i=null===(r=null===(t=e.helper)||void 0===t?void 0:t.additional_fields)||void 0===r?void 0:r.blocks)&&void 0!==i?i:[];let s;try{s=JSON.parse(null!==(o=e.additional_fields)&&void 0!==o?o:"{}")}catch(e){s={}}for(const e of l)for(const t of e.fields)if("optional"in t&&!t.optional){const r=[e.parent_id,e.id,t.id].filter((e=>!!e));if(!a(s,r)&&"checkbox"!==t.type)return"additional-fields:v8n_invalid"}return!0}]}renderBody(){var e,t,i,a,s,n,k,w,V,S,Z,H,I,q;let C;try{const e=r(/\/payment_presets\/(.+)\//,{presetId:1}).exec(new URL(this.href||this.parent).pathname).groups.presetId;C=new URL(`/payment_presets/${e}/available_payment_methods`,this.href||this.parent).toString()}catch(e){C=""}const W=null===(e=this.renderRoot.querySelector("#available-payment-methods"))||void 0===e?void 0:e.data,E=B.defaultImageSrc,M=Object.entries(null!==(t=null==W?void 0:W.values)&&void 0!==t?t:{}).sort(((e,t)=>e[0].localeCompare(t[0],"en"))).reduce(((e,[t,r])=>{const i=t.charAt(0).toUpperCase(),o=!/\w/.test(i)?"#":i,l=e.find((e=>e.name===o));return l?l.items.push({type:t,helper:r}):e.push({name:o,items:[{type:t,helper:r}]}),e}),[]);return l(d||(d=L` <foxy-nucleon class="hidden" href="${0}" id="available-payment-methods" @update="${0}"> </foxy-nucleon> ${0} `),C,(()=>this.requestUpdate()),this.form.type?l(c||(c=L` <figure class="relative flex flex-col gap-m p-m items-center"> <img class="relative h-xl w-xl object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <figcaption class="relative min-w-0 font-bold text-xl text-center"> ${0}&ZeroWidthSpace; </figcaption> </figure> <div class="rounded-t-l rounded-b-l border border-contrast-10"> <vaadin-tabs selected="${0}" theme="centered" @selected-changed="${0}"> <vaadin-tab><foxy-i18n infer="" key="tab_live"></foxy-i18n></vaadin-tab> <vaadin-tab><foxy-i18n infer="" key="tab_test"></foxy-i18n></vaadin-tab> </vaadin-tabs> <div class="overflow-hidden"> <div class="grid grid-cols-2 gap-m transition-transform transform duration-300" style="width:calc(200% + var(--lumo-space-m));--tw-translate-x:${0}"> <div class="grid grid-cols-1 gap-m p-m transition-opacity duration-300 ${0}"> ${0} ${0} ${0} ${0} </div> <div class="grid grid-cols-1 gap-m p-m transition-opacity duration-300 ${0}"> ${0} ${0} ${0} ${0} </div> </div> </div> </div> <foxy-internal-text-control infer="description"></foxy-internal-text-control> ${0} ${0} ${0} `),null!==(a=null===(i=this.getImageSrc)||void 0===i?void 0:i.call(this,this.form.type))&&void 0!==a?a:E,(e=>e.currentTarget.src=E),null!==(n=null===(s=this.form.helper)||void 0===s?void 0:s.name)&&void 0!==n?n:this.form.type,this.__tab,(e=>{var t;const r=e.currentTarget;this.__tab=null!==(t=r.selected)&&void 0!==t?t:0}),0===this.__tab?"0":"calc(-50% - (var(--lumo-space-m) / 2))",0===this.__tab?"opacity-100":"opacity-0",(null===(k=this.form.helper)||void 0===k?void 0:k.id_description)?l(p||(p=L` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="account-id"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.id_description):"",(null===(w=this.form.helper)||void 0===w?void 0:w.third_party_key_description)?l(f||(f=L` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="third-party-key"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.third_party_key_description):"",(null===(V=this.form.helper)||void 0===V?void 0:V.key_description)?l(h||(h=L` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="account-key"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.key_description):"",this.__liveBlocks.map((e=>this.__renderBlock(e))),1===this.__tab?"opacity-100":"opacity-0",(null===(S=this.form.helper)||void 0===S?void 0:S.id_description)?l(m||(m=L` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="test-account-id"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.id_description):"",(null===(Z=this.form.helper)||void 0===Z?void 0:Z.third_party_key_description)?l(u||(u=L` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="test-third-party-key"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.third_party_key_description):"",(null===(H=this.form.helper)||void 0===H?void 0:H.key_description)?l(v||(v=L` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="test-account-key"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.key_description):"",this.__testBlocks.map((e=>this.__renderBlock(e))),(null===(I=this.form.helper)||void 0===I?void 0:I.supports_3d_secure)?l(_||(_=L` <foxy-internal-radio-group-control infer="three-d-secure-toggle" class="-mb-s" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> ${0} `),(()=>{const e=this.form.config_3d_secure;return(null==e?void 0:e.startsWith("all_cards"))?"all_cards":(null==e?void 0:e.startsWith("maestro_only"))?"maestro_only":"off"}),(e=>{var t;let r="";"all_cards"!==e&&"maestro_only"!==e||(r=(null===(t=this.form.config_3d_secure)||void 0===t?void 0:t.endsWith("require_valid_response"))?`${e}_require_valid_response`:e),this.edit({config_3d_secure:r})}),[{value:"off",label:"option_off"},{value:"all_cards",label:"option_all_cards"},{value:"maestro_only",label:"option_maestro_only"}],this.form.config_3d_secure?l(y||(y=L` <foxy-internal-checkbox-group-control infer="three-d-secure-response" class="-mb-s" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> `),[{value:"valid_only",label:"option_valid_only"}],(()=>{var e;return(null===(e=this.form.config_3d_secure)||void 0===e?void 0:e.endsWith("require_valid_response"))?["valid_only"]:[]}),(e=>{const t=e.includes("valid_only")?"_require_valid_response":"",r=this.form.config_3d_secure,i=(null==r?void 0:r.startsWith("all_cards"))?"all_cards":"maestro_only";this.edit({config_3d_secure:`${i}${t}`})})):""):"",(null===(q=this.data)||void 0===q?void 0:q.type)?"":l(x||(x=L` <vaadin-button theme="contrast" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())),super.renderBody()):l(b||(b=L` <foxy-i18n class="block text-xxl font-bold border-b border-contrast-10 pb-m" infer="" key="select_method_title"> </foxy-i18n> <div> <div class="-my-s grid grid-cols-1"> ${0} </div> </div> `),M.map((e=>l(g||(g=L` <div class="w-m text-center font-semibold text-tertiary py-s"> ${0} </div> ${0} `),e.name,e.items.map((({type:e,helper:t})=>{var r,i;return l($||($=L` <button class="${0}" ?disabled="${0}" @click="${0}"> <figure class="flex items-center gap-m h-m"> <img class="relative h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <figcaption class="min-w-0 flex-1 truncate leading-s ${0}"> <div class="font-semibold">${0}&ZeroWidthSpace;</div> ${0} </figcaption> </figure> </button> `),o({"block text-left p-s rounded-t-l rounded-b-l -mx-s":!0,"transition-colors hover-bg-contrast-5":!t.conflict,"cursor-default":!!t.conflict}),!!t.conflict,(()=>this.edit({type:e,helper:t})),null!==(i=null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,e))&&void 0!==i?i:E,(e=>e.currentTarget.src=E),t.conflict?"text-tertiary":"",t.name,t.conflict?l(j||(j=L` <foxy-i18n class="block text-tertiary text-xs" infer="" key="conflict_message" .options="${0}"> </foxy-i18n> `),t.conflict):"")})))))))}get __liveBlocks(){var e,t,r;return null!==(r=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>e.is_live)))&&void 0!==r?r:[]}get __testBlocks(){var e,t,r;return null!==(r=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>!e.is_live)))&&void 0!==r?r:[]}__renderBlock(e){return l(k||(k=L`${0}`),e.fields.map((t=>{var r,i,o;const a=[e.parent_id,e.id,t.id].filter((e=>!!e)),d=["additional-fields",...a].join("-").replace(/_/g,"-"),c=()=>{var e,r;try{const t=JSON.parse(null!==(e=this.form.additional_fields)&&void 0!==e?e:"{}");return null!==(r=n(t,a))&&void 0!==r?r:t.default_value}catch(e){return t.default_value}},p=e=>{var t;try{const r=JSON.parse(null!==(t=this.form.additional_fields)&&void 0!==t?t:"{}");this.edit({additional_fields:JSON.stringify(s(r,a,e))})}catch(e){return""}},f=t.options;return l(w||(w=L` ${0} `),"checkbox"===t.type?l(V||(V=L` <foxy-internal-checkbox-group-control helper-text="${0}" label="" class="-mb-s" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> `),null!==(r=t.description)&&void 0!==r?r:"",d,[{label:t.name,value:"checked"}],c,(e=>{p(e.includes("checked"))})):"select"===t.type?l(S||(S=L` <foxy-internal-select-control helper-text="${0}" label="${0}" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),null!==(i=t.description)&&void 0!==i?i:"",t.name,d,f.map((({name:e,value:t})=>({label:e,value:t}))),c,p):l(Z||(Z=L` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(o=t.description)&&void 0!==o?o:"",t.default_value||this.t("default_additional_field_placeholder"),t.name,d,c,p))})))}}customElements.define("foxy-payments-api-payment-method-form",B);export{B as PaymentsApiPaymentMethodForm};
@@ -1 +1 @@
1
- import{I as s}from"./shared-1d851ca7.js";import"./foxy-nucleon-element.js";import{a as e}from"./shared-ff13276c.js";import{c as i}from"./shared-4e709717.js";import{h as t}from"./shared-7f33a83a.js";import"./foxy-spinner.js";import"./shared-a98a6602.js";import"./shared-08d6d02b.js";import"./shared-3b22a756.js";import"./shared-4623f740.js";import"./shared-a8ced8bf.js";import"./shared-2af327d0.js";import"./shared-4f037e43.js";import"./shared-15278fe0.js";import"./shared-a420358e.js";import"./shared-d6276c83.js";import"./shared-4a796610.js";let a,r=s=>s;const d=e(s,"payments-api-payment-preset-card");class o extends d{renderBody(){var s,e,d,o;return t(a||(a=r` <div class="flex items-center justify-between"> <div class="font-semibold"> <foxy-i18n infer="" class="sr-only" key="description_title"></foxy-i18n> <span>${0}&ZeroWidthSpace;</span> </div> <div class="${0}"> <foxy-i18n class="sr-only" infer="" key="status_title"></foxy-i18n> <foxy-i18n infer="" key="status_${0}"></foxy-i18n> </div> </div> `),null===(s=this.data)||void 0===s?void 0:s.description,i({"uppercase text-xs font-bold tracking-wide rounded-t-l rounded-b-l px-s py-xs":!0,"bg-success-10 text-success":!!(null===(e=this.data)||void 0===e?void 0:e.is_live),"bg-contrast-5":!(null===(d=this.data)||void 0===d?void 0:d.is_live)}),(null===(o=this.data)||void 0===o?void 0:o.is_live)?"live":"test")}}customElements.define("foxy-payments-api-payment-preset-card",o);export{o as PaymentsApiPaymentPresetCard};
1
+ import{I as s}from"./shared-6e6ed30a.js";import"./foxy-nucleon-element.js";import{a as e}from"./shared-29e21467.js";import{c as i}from"./shared-4e709717.js";import{h as t}from"./shared-7f33a83a.js";import"./foxy-spinner.js";import"./shared-c484320b.js";import"./shared-c52d3772.js";import"./shared-ea316e64.js";import"./shared-0672e78b.js";import"./shared-a8ced8bf.js";import"./shared-002b788f.js";import"./shared-4f037e43.js";import"./shared-b7423eab.js";import"./shared-dc798bf4.js";import"./shared-d6276c83.js";import"./shared-dcbf57e0.js";let r,a=s=>s;const d=e(s,"payments-api-payment-preset-card");class o extends d{renderBody(){var s,e,d,o;return t(r||(r=a` <div class="flex items-center justify-between"> <div class="font-semibold"> <foxy-i18n infer="" class="sr-only" key="description_title"></foxy-i18n> <span>${0}&ZeroWidthSpace;</span> </div> <div class="${0}"> <foxy-i18n class="sr-only" infer="" key="status_title"></foxy-i18n> <foxy-i18n infer="" key="status_${0}"></foxy-i18n> </div> </div> `),null===(s=this.data)||void 0===s?void 0:s.description,i({"uppercase text-xs font-bold tracking-wide rounded-t-l rounded-b-l px-s py-xs":!0,"bg-success-10 text-success":!!(null===(e=this.data)||void 0===e?void 0:e.is_live),"bg-contrast-5":!(null===(d=this.data)||void 0===d?void 0:d.is_live)}),(null===(o=this.data)||void 0===o?void 0:o.is_live)?"live":"test")}}customElements.define("foxy-payments-api-payment-preset-card",o);export{o as PaymentsApiPaymentPresetCard};