@foxy.io/elements 1.18.0-beta.5 → 1.18.0-beta.8

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 (268) 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 +5 -86
  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 -0
  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 -0
  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.js +1 -1
  41. package/dist/cdn/foxy-item-card.js +1 -1
  42. package/dist/cdn/foxy-item-category-card.js +1 -0
  43. package/dist/cdn/foxy-item-category-form.js +1 -0
  44. package/dist/cdn/foxy-item-form.js +1 -1
  45. package/dist/cdn/foxy-item-option-card.js +1 -1
  46. package/dist/cdn/foxy-item-option-form.js +1 -1
  47. package/dist/cdn/foxy-items-form.js +1 -1
  48. package/dist/cdn/foxy-nucleon-element.js +1 -1
  49. package/dist/cdn/foxy-pagination.js +1 -1
  50. package/dist/cdn/foxy-payment-card.js +1 -1
  51. package/dist/cdn/foxy-payment-method-card.js +1 -1
  52. package/dist/cdn/foxy-query-builder.js +1 -1
  53. package/dist/cdn/foxy-report-form.js +2 -2
  54. package/dist/cdn/foxy-reports-table.js +6 -6
  55. package/dist/cdn/foxy-shipment-card.js +1 -1
  56. package/dist/cdn/foxy-sign-in-form.js +1 -1
  57. package/dist/cdn/foxy-spinner.js +2 -2
  58. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  59. package/dist/cdn/foxy-subscription-card.js +1 -1
  60. package/dist/cdn/foxy-subscription-form.js +5 -5
  61. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  62. package/dist/cdn/foxy-table.js +1 -1
  63. package/dist/cdn/foxy-tax-card.js +1 -1
  64. package/dist/cdn/foxy-tax-form.js +1 -1
  65. package/dist/cdn/foxy-template-config-form.js +1 -1
  66. package/dist/cdn/foxy-template-form.js +1 -1
  67. package/dist/cdn/foxy-transaction-card.js +1 -1
  68. package/dist/cdn/foxy-transaction.js +1 -1
  69. package/dist/cdn/foxy-transactions-table.js +1 -1
  70. package/dist/cdn/foxy-user-form.js +1 -1
  71. package/dist/cdn/foxy-users-table.js +1 -1
  72. package/dist/cdn/foxy-webhook-card.js +1 -1
  73. package/dist/cdn/foxy-webhook-form.js +1 -1
  74. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  75. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  76. package/dist/cdn/{shared-1009388a.js → shared-02f2d418.js} +1 -1
  77. package/dist/cdn/shared-04c51428.js +1 -0
  78. package/dist/cdn/{shared-f2608c7d.js → shared-16aade17.js} +1 -1
  79. package/dist/cdn/shared-1b38c44f.js +29 -0
  80. package/dist/cdn/shared-1ed709ca.js +82 -0
  81. package/dist/cdn/{shared-41655ecf.js → shared-24fdefca.js} +1 -1
  82. package/dist/cdn/{shared-09d39b25.js → shared-26502fca.js} +1 -1
  83. package/dist/cdn/shared-2788214c.js +1 -0
  84. package/dist/cdn/{shared-edc7150d.js → shared-2c0e6413.js} +1 -1
  85. package/dist/cdn/{shared-6629d6b0.js → shared-351b4f85.js} +1 -1
  86. package/dist/cdn/shared-39265f55.js +11 -0
  87. package/dist/cdn/{shared-9be1a70f.js → shared-3ddbe8c9.js} +1 -1
  88. package/dist/cdn/{shared-cbbd7f8c.js → shared-403db7b9.js} +1 -1
  89. package/dist/cdn/{shared-023c287a.js → shared-4ba52733.js} +1 -1
  90. package/dist/cdn/shared-5155696f.js +1 -0
  91. package/dist/cdn/shared-565feb2f.js +1 -0
  92. package/dist/cdn/shared-589c6a83.js +1 -0
  93. package/dist/cdn/{shared-63e71a69.js → shared-5fd9d45d.js} +1 -1
  94. package/dist/cdn/shared-61199be1.js +1 -0
  95. package/dist/cdn/shared-710b5e7f.js +1 -0
  96. package/dist/cdn/{shared-f48ff40a.js → shared-71762c29.js} +1 -1
  97. package/dist/cdn/{shared-ea418c18.js → shared-75ec4e1a.js} +1 -1
  98. package/dist/cdn/{shared-07834676.js → shared-76daf1fb.js} +1 -1
  99. package/dist/cdn/shared-77f4c0b0.js +64 -0
  100. package/dist/cdn/{shared-977dcc25.js → shared-7976580a.js} +1 -1
  101. package/dist/cdn/shared-7a078e85.js +1 -0
  102. package/dist/cdn/{shared-408341aa.js → shared-7b72ee7e.js} +1 -1
  103. package/dist/cdn/{shared-91ad37aa.js → shared-7c5cfe1e.js} +12 -22
  104. package/dist/cdn/{shared-2a472b2d.js → shared-8403766d.js} +1 -1
  105. package/dist/cdn/{shared-240700a9.js → shared-84b5d8f0.js} +1 -1
  106. package/dist/cdn/{shared-d4d44ca4.js → shared-85cd6cfb.js} +1 -1
  107. package/dist/cdn/{shared-3a7cf739.js → shared-86d0d927.js} +1 -1
  108. package/dist/cdn/{shared-e66740a4.js → shared-8d7ef22f.js} +1 -1
  109. package/dist/cdn/{shared-cbb340fa.js → shared-90119584.js} +1 -1
  110. package/dist/cdn/{shared-87176207.js → shared-94a4ab55.js} +1 -1
  111. package/dist/cdn/{shared-2e0927c2.js → shared-94f3042a.js} +1 -1
  112. package/dist/cdn/shared-974bec9a.js +1 -0
  113. package/dist/cdn/{shared-c37600c8.js → shared-97a3aa5b.js} +1 -1
  114. package/dist/cdn/shared-9c176693.js +1 -0
  115. package/dist/cdn/{shared-b4d0adff.js → shared-a7429258.js} +4 -4
  116. package/dist/cdn/{shared-56f2ae96.js → shared-ad040ad4.js} +1 -1
  117. package/dist/cdn/{shared-19ae2188.js → shared-b95332ec.js} +1 -1
  118. package/dist/cdn/shared-bc7f58ef.js +1 -0
  119. package/dist/cdn/shared-be6ec4b3.js +1 -0
  120. package/dist/cdn/{shared-4c0520f6.js → shared-bfca826a.js} +1 -1
  121. package/dist/cdn/shared-c15f0523.js +1 -0
  122. package/dist/cdn/shared-c9d1a2cd.js +1 -0
  123. package/dist/cdn/{shared-833a8b4e.js → shared-cf2b9cc3.js} +1 -1
  124. package/dist/cdn/{shared-d8b553fa.js → shared-d37049e9.js} +1 -1
  125. package/dist/cdn/shared-d97ce3d5.js +1 -0
  126. package/dist/cdn/{shared-403fd4e3.js → shared-db118e3e.js} +1 -1
  127. package/dist/cdn/{shared-81b7c484.js → shared-de25e8f0.js} +5 -5
  128. package/dist/cdn/{shared-1971bbbd.js → shared-df26adf5.js} +1 -1
  129. package/dist/cdn/{shared-ca0f14c1.js → shared-e34d2ef1.js} +1 -1
  130. package/dist/cdn/{shared-44f45339.js → shared-eb344bd5.js} +1 -1
  131. package/dist/cdn/shared-ec8a003f.js +1 -0
  132. package/dist/cdn/{shared-d071c963.js → shared-ecdf2d11.js} +1 -1
  133. package/dist/cdn/{shared-628c7355.js → shared-f4b47b4a.js} +1 -1
  134. package/dist/cdn/{shared-b15671a5.js → shared-fe555bf4.js} +1 -1
  135. package/dist/cdn/shared-ff7a10de.js +1 -0
  136. package/dist/cdn/translations/email-template-card/en.json +8 -0
  137. package/dist/cdn/translations/email-template-form/en.json +5 -0
  138. package/dist/cdn/translations/gift-card-code-form/en.json +25 -22
  139. package/dist/cdn/translations/gift-card-code-log-card/en.json +10 -0
  140. package/dist/cdn/translations/gift-card-form/en.json +34 -2
  141. package/dist/cdn/translations/item-category-form/en.json +196 -0
  142. package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js +1 -0
  143. package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js.map +1 -1
  144. package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.js +1 -1
  145. package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.js.map +1 -1
  146. package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js +1 -1
  147. package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js.map +1 -1
  148. package/dist/elements/internal/InternalSelectControl/InternalSelectControl.d.ts +17 -0
  149. package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js +57 -0
  150. package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js.map +1 -0
  151. package/dist/elements/internal/InternalSelectControl/index.d.ts +5 -0
  152. package/dist/elements/internal/InternalSelectControl/index.js +7 -0
  153. package/dist/elements/internal/InternalSelectControl/index.js.map +1 -0
  154. package/dist/elements/internal/InternalSelectControl/types.d.ts +6 -0
  155. package/dist/elements/internal/InternalSelectControl/types.js +2 -0
  156. package/dist/elements/internal/InternalSelectControl/types.js.map +1 -0
  157. package/dist/elements/internal/InternalTextControl/InternalTextControl.js +1 -0
  158. package/dist/elements/internal/InternalTextControl/InternalTextControl.js.map +1 -1
  159. package/dist/elements/public/EmailTemplateCard/EmailTemplateCard.d.ts +10 -0
  160. package/dist/elements/public/EmailTemplateCard/EmailTemplateCard.js +34 -0
  161. package/dist/elements/public/EmailTemplateCard/EmailTemplateCard.js.map +1 -0
  162. package/dist/elements/public/EmailTemplateCard/index.d.ts +6 -0
  163. package/dist/elements/public/EmailTemplateCard/index.js +8 -0
  164. package/dist/elements/public/EmailTemplateCard/index.js.map +1 -0
  165. package/dist/elements/public/EmailTemplateCard/types.d.ts +3 -0
  166. package/dist/elements/public/EmailTemplateCard/types.js +2 -0
  167. package/dist/elements/public/EmailTemplateCard/types.js.map +1 -0
  168. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.d.ts +3 -0
  169. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js +17 -0
  170. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js.map +1 -1
  171. package/dist/elements/public/EmailTemplateForm/index.d.ts +1 -0
  172. package/dist/elements/public/EmailTemplateForm/index.js +1 -0
  173. package/dist/elements/public/EmailTemplateForm/index.js.map +1 -1
  174. package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.d.ts +4 -2
  175. package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +26 -6
  176. package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
  177. package/dist/elements/public/GiftCardCodeForm/index.d.ts +3 -1
  178. package/dist/elements/public/GiftCardCodeForm/index.js +3 -1
  179. package/dist/elements/public/GiftCardCodeForm/index.js.map +1 -1
  180. package/dist/elements/public/GiftCardCodeForm/internal/{InternalGiftCardCodeFormTransactionControl/InternalGiftCardCodeFormTransactionControl.d.ts → InternalGiftCardCodeFormItemControl/InternalGiftCardCodeFormItemControl.d.ts} +1 -1
  181. package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/InternalGiftCardCodeFormItemControl.js +23 -0
  182. package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/InternalGiftCardCodeFormItemControl.js.map +1 -0
  183. package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/index.d.ts +6 -0
  184. package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/index.js +8 -0
  185. package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/index.js.map +1 -0
  186. package/dist/elements/public/GiftCardCodeLogCard/GiftCardCodeLogCard.d.ts +12 -0
  187. package/dist/elements/public/GiftCardCodeLogCard/GiftCardCodeLogCard.js +108 -0
  188. package/dist/elements/public/GiftCardCodeLogCard/GiftCardCodeLogCard.js.map +1 -0
  189. package/dist/elements/public/GiftCardCodeLogCard/index.d.ts +6 -0
  190. package/dist/elements/public/GiftCardCodeLogCard/index.js +8 -0
  191. package/dist/elements/public/GiftCardCodeLogCard/index.js.map +1 -0
  192. package/dist/elements/public/GiftCardCodeLogCard/types.d.ts +3 -0
  193. package/dist/elements/public/GiftCardCodeLogCard/types.js +2 -0
  194. package/dist/elements/public/GiftCardCodeLogCard/types.js.map +1 -0
  195. package/dist/elements/public/GiftCardForm/GiftCardForm.js +4 -10
  196. package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
  197. package/dist/elements/public/ItemCard/ItemCard.js +8 -6
  198. package/dist/elements/public/ItemCard/ItemCard.js.map +1 -1
  199. package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.d.ts +6 -0
  200. package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.js +11 -0
  201. package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.js.map +1 -0
  202. package/dist/elements/public/ItemCategoryCard/index.d.ts +2 -0
  203. package/dist/elements/public/ItemCategoryCard/index.js +4 -0
  204. package/dist/elements/public/ItemCategoryCard/index.js.map +1 -0
  205. package/dist/elements/public/ItemCategoryCard/types.d.ts +3 -0
  206. package/dist/elements/public/ItemCategoryCard/types.js +2 -0
  207. package/dist/elements/public/ItemCategoryCard/types.js.map +1 -0
  208. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.d.ts +31 -0
  209. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js +309 -0
  210. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js.map +1 -0
  211. package/dist/elements/public/ItemCategoryForm/index.d.ts +10 -0
  212. package/dist/elements/public/ItemCategoryForm/index.js +12 -0
  213. package/dist/elements/public/ItemCategoryForm/index.js.map +1 -0
  214. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControl/InternalItemCategoryFormTaxesControl.d.ts +8 -0
  215. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControl/InternalItemCategoryFormTaxesControl.js +52 -0
  216. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControl/InternalItemCategoryFormTaxesControl.js.map +1 -0
  217. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControl/index.d.ts +6 -0
  218. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControl/index.js +8 -0
  219. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControl/index.js.map +1 -0
  220. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/InternalItemCategoryFormTaxesControlItem.d.ts +11 -0
  221. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/InternalItemCategoryFormTaxesControlItem.js +85 -0
  222. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/InternalItemCategoryFormTaxesControlItem.js.map +1 -0
  223. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/index.d.ts +5 -0
  224. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/index.js +7 -0
  225. package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/index.js.map +1 -0
  226. package/dist/elements/public/ItemCategoryForm/types.d.ts +3 -0
  227. package/dist/elements/public/ItemCategoryForm/types.js +2 -0
  228. package/dist/elements/public/ItemCategoryForm/types.js.map +1 -0
  229. package/dist/elements/public/NucleonElement/API.js +1 -1
  230. package/dist/elements/public/NucleonElement/API.js.map +1 -1
  231. package/dist/elements/public/QueryBuilder/components/Input.js +10 -8
  232. package/dist/elements/public/QueryBuilder/components/Input.js.map +1 -1
  233. package/dist/elements/public/QueryBuilder/components/RangeValue.js +7 -5
  234. package/dist/elements/public/QueryBuilder/components/RangeValue.js.map +1 -1
  235. package/dist/elements/public/QueryBuilder/components/Select.js +3 -1
  236. package/dist/elements/public/QueryBuilder/components/Select.js.map +1 -1
  237. package/dist/elements/public/index.d.ts +4 -0
  238. package/dist/elements/public/index.defined.d.ts +4 -0
  239. package/dist/elements/public/index.defined.js +4 -0
  240. package/dist/elements/public/index.defined.js.map +1 -1
  241. package/dist/elements/public/index.js +4 -0
  242. package/dist/elements/public/index.js.map +1 -1
  243. package/dist/mixins/themeable.js +32 -40
  244. package/dist/mixins/themeable.js.map +1 -1
  245. package/dist/utils/serialize-date.d.ts +1 -0
  246. package/dist/utils/serialize-date.js +7 -0
  247. package/dist/utils/serialize-date.js.map +1 -1
  248. package/package.json +1 -1
  249. package/dist/cdn/shared-1c660ed1.js +0 -1
  250. package/dist/cdn/shared-2061be9a.js +0 -1
  251. package/dist/cdn/shared-27ef5935.js +0 -1
  252. package/dist/cdn/shared-296f4621.js +0 -1
  253. package/dist/cdn/shared-3368abe5.js +0 -1
  254. package/dist/cdn/shared-4b5b7eb5.js +0 -1
  255. package/dist/cdn/shared-85bcfcde.js +0 -1
  256. package/dist/cdn/shared-8a86a620.js +0 -64
  257. package/dist/cdn/shared-8ec9793b.js +0 -1
  258. package/dist/cdn/shared-9b392ba8.js +0 -1
  259. package/dist/cdn/shared-b4865438.js +0 -29
  260. package/dist/cdn/shared-b778d103.js +0 -1
  261. package/dist/cdn/shared-d988a664.js +0 -1
  262. package/dist/cdn/shared-ebb63c77.js +0 -1
  263. package/dist/cdn/shared-f4056083.js +0 -1
  264. package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormTransactionControl/InternalGiftCardCodeFormTransactionControl.js +0 -50
  265. package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormTransactionControl/InternalGiftCardCodeFormTransactionControl.js.map +0 -1
  266. package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormTransactionControl/index.d.ts +0 -5
  267. package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormTransactionControl/index.js +0 -7
  268. package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormTransactionControl/index.js.map +0 -1
@@ -0,0 +1 @@
1
+ import{_ as t}from"./shared-e34d2ef1.js";import"./shared-90119584.js";import{L as e,c as i,h as s}from"./shared-7f33a83a.js";import{p as r}from"./shared-c9d1a2cd.js";import"./shared-26502fca.js";import"./shared-75ec4e1a.js";import"./shared-71762c29.js";import{t as a,S as n}from"./shared-1b38c44f.js";import"./shared-a7429258.js";import"./shared-61199be1.js";import{I as o,D as l}from"./shared-39265f55.js";import{E as c}from"./shared-d37049e9.js";import"./shared-02f2d418.js";import"./shared-76daf1fb.js";import"./shared-403db7b9.js";import"./shared-5fd9d45d.js";import{a as h}from"./shared-5155696f.js";import"./shared-eb344bd5.js";import{s as d}from"./shared-11c2efc8.js";class u extends CustomEvent{constructor(t){super("change",{detail:t})}}class m extends CustomEvent{constructor(t){super("submit",{detail:t,cancelable:!0})}}let _,p,g=t=>t;var y;!function(t){t[t.Excluded=0]="Excluded",t[t.BeforeEnter=1]="BeforeEnter",t[t.Default=2]="Default",t[t.Previous=3]="Previous",t[t.BeforeExit=4]="BeforeExit"}(y||(y={}));class f extends e{constructor(){super(...arguments),this.quantity=0,this.image=""}static get properties(){return t(t({},super.properties),{},{quantity:{attribute:!1},image:{attribute:!1}})}static get styles(){return[a.styles,i(_||(_=g`.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.blur-1{filter:blur(1px)}.blur-2{filter:blur(2px)}.grayscale{filter:grayscale()}.rotate-12{--tw-rotate:12deg}.-rotate-12{--tw-rotate:-12deg}.-rotate-24{--tw-rotate:-24deg}.translate-y-half{--tw-translate-y:50%}`))]}set empty(t){this.updateComplete.then((()=>{if(t){const[,...t]=this.__stack;t.forEach((t=>t.remove()))}else this.quantity>1&&this.__stack.length<2&&this.__insertImage(y.Previous,this.__stack[0])}))}set data({quantity:t,image:e}){this.quantity=t,this.image=e}render(){return s(p||(p=g`<div id="image" class="w-full h-full relative"></div>`))}firstUpdated(){const t=this.__insertImage(y.Default);this.quantity>1&&this.__insertImage(y.Previous,t)}updated(t){if(t.has("quantity")){const e=t.get("quantity");void 0!==e&&(this.quantity>e?this.__add():this.__remove())}t.has("image")&&this.__stack.forEach((t=>t.src=this.image))}get __container(){return this.shadowRoot.getElementById("image")}get __stack(){var t,e;return[...null!==(e=null===(t=this.__container)||void 0===t?void 0:t.querySelectorAll(":not(.opacity-0)"))&&void 0!==e?e:[]].reverse()}__add(){const[t,e]=this.__stack;this.quantity>1?(t&&this.__setImageState(t,y.Previous),e&&(this.__setImageState(e,y.BeforeExit),e.ontransitionend=()=>e.remove()),this.__setImageState(this.__insertImage(y.BeforeEnter),y.Default)):t&&this.__setImageState(t,y.Default)}__remove(){const[t,e]=this.__stack;let i;if(this.quantity>0?(e&&this.__setImageState(e,y.Default),i=t):(t&&this.__setImageState(t,y.Excluded),i=e),i&&(this.__setImageState(i,y.BeforeEnter),i.ontransitionend=()=>i.remove()),this.quantity>1){const t=this.__insertImage(y.BeforeExit,this.__container.firstElementChild);this.__setImageState(t,y.Previous)}}__insertImage(t,e=null){const i=new Image;return i.src=this.image,i.setAttribute("part","picture"),i.addEventListener("error",(()=>i.src=f.placeholder)),this.__setImageState(i,t),this.__container.insertBefore(i,e),i}__setImageState(t,e){t.offsetHeight,t.className=["absolute inset-0 w-full h-full object-cover rounded transform transition duration-700 ease-out-back",["grayscale","shadow-m translate-y-half scale-110 rotate-12 opacity-0","shadow-m","blur-1 -rotate-12 opacity-25","blur-2 -rotate-24 opacity-0"][e]].join(" ")}}f.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';let v,b,w,x,q,I,E,$,C=t=>t;class S extends(n(e)){constructor(){super(...arguments),this.empty=!1,this.data=[]}static get properties(){return t(t({},super.properties),{},{empty:{attribute:!1},data:{attribute:!1}})}static get styles(){return[a.styles,i(v||(v=C`.w-preview{width:5.5rem}.h-preview{height:5.5rem}.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.grayscale{filter:grayscale()}.grid-2>:nth-child(1),.grid-3>:nth-child(1),.grid-4-plus>:nth-child(1),.grid-4>:nth-child(1){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(2){opacity:0;--tw-translate-x:100%;--tw-translate-y:var(--tw-translate-x)}.grid-2>:nth-child(2),.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){transform-origin:top right}.grid-1>:nth-child(3),.grid-2>:nth-child(3),.grid-3>:nth-child(3),.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(3),.grid-2>:nth-child(3){opacity:0;--tw-translate-y:100%}.grid-3>:nth-child(3){transform-origin:bottom right}.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){transform-origin:bottom left}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4),.grid-4-plus>:nth-child(4),.grid-4>:nth-child(4){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4){opacity:0;transform-origin:bottom left;--tw-translate-x:100%}.grid-1>:nth-child(4)>:first-child,.grid-2>:nth-child(4)>:first-child,.grid-3>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:first-child{transform:perspective(250px) rotateX(-90deg)}.grid-4-plus>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:last-child{transition-delay:.15s;transition-timing-function:ease-out}.grid-4-plus>:nth-child(4)>:last-child,.grid-4>:nth-child(4)>:first-child{transition-timing-function:ease-in}.grid-4-plus>:nth-child(4)>:last-child{transform:perspective(250px) rotateX(90deg)}.grid-1>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){opacity:0}.grid-1>:nth-child(5){--tw-translate-x:100%}.grid-2>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-translate-y:-100%}.grid-1>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){opacity:0}.grid-1>:nth-child(6){--tw-translate-y:100%}.grid-2>:nth-child(6),.grid-3>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-translate-x:-100%}`))]}render(){const t=this.data.length,e="rounded bg-contrast-10",i="transition-all duration-700 ease-out-back transform absolute inset-0",r=this.empty?"grayscale":"",a=t>4?"grid-4-plus":`grid-${Math.max(1,t)}`,n=d({exportparts:"picture",class:"w-full h-full",".empty":this.empty}),[o,l,c,h]=this.data;return s(b||(b=C` <div class="${0} w-preview h-preview relative font-lumo"> <div class="${0} ${0} origin-top-left"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> ${0} </div> <div class="${0} ${0} origin-top-right"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> <div class="${0} flex text-body transition duration-150 absolute inset-0"> ${0} </div> <div class="transition duration-150 absolute inset-0"> ${0} </div> </div> <div class="${0} ${0} origin-top-right"></div> <div class="${0} ${0} origin-bottom-left"></div> </div> `),a,i,r,o?s(w||(w=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,o):"",i,r,l?s(x||(x=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,l):"",i,r,c?s(q||(q=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,c):"",i,r,e,t>102?s(I||(I=C`<iron-icon icon="icons:more-horiz" class="m-auto w-xl h-xl"></iron-icon>`)):s(E||(E=C`<div class="m-auto text-xxxl">+${0}</div>`),t-3),h?s($||($=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,h):"",i,e,i,e)}}let D,k,L=t=>t;class A extends S{static get scopedElements(){return{"x-pic":f}}}class N extends S{static get scopedElements(){return{"x-pic":A}}}class j extends(n(e)){constructor(){super(...arguments),this.quantity=0,this.items=[]}static get scopedElements(){return{"x-picture":f,"x-bundle-grid":N}}static get properties(){return{quantity:{attribute:!1},image:{attribute:!1},items:{attribute:!1}}}static get styles(){return a.styles}render(){const{quantity:t,image:e=""}=this,i=0===t,r=d({class:"w-full h-full",exportparts:"picture"});if(0===this.items.length)return s(D||(D=L`<x-picture ...="${0}" .data="${0}"></x-picture>`),r,{quantity:t,image:e});{const e=new Array(Math.max(1,t)).fill(this.items);return s(k||(k=L`<x-bundle-grid ...="${0}" .empty="${0}" .data="${0}"></x-bundle-grid>`),r,i,e)}}}class P extends h{static get properties(){return t(t({},super.properties),{},{open:{type:Object},signatures:{type:Object,converter:t=>{const e=JSON.parse(t);for(const t of Object.keys(e))64!=e[t].length&&console.error("There is something wrong with the signature. It should have 64 characters.");return e}}})}signedName(t){return this.signatures&&this.signatures[t]?`${t}||${this.signatures[t]}${this.isOpen(t)?"||open":""}`:t}isOpen(t){return!(!this.open||!this.open[t])}}let F,T,O,V,M,H,B,Z=t=>t;class R extends P{constructor(){super("items-form"),this.rel="product_item",this.readonly=!1,this.quantity=0,this.total=this.__computeTotalPrice(),this.currency="",this.isItem=!0,this.isChildItem=!1,this.pid=R.__newId(),this.__modified=!1,this.__childPrices=[],this.__images=[],this.__childrenCount=0,this.__itemDescription="",this.__handleQuantity={handleEvent:t=>{const e=Number(t.target.value);this.quantity=e,this.__modified=!0,this.__images=[this.getImageDescription()].concat(this.__images.slice(1,this.__images.length))}},this.__childItemsObserver=new MutationObserver(this.__observeItems.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__setCode(),this.__acknowledgeChildItems(),this.__changedChildItem(),this.__isValid()||console.error("Invalid item",this.value)}))}static get styles(){return[super.styles,i(F||(F=Z`:host{--quantity-width:6.5rem;--preview-size:5.5rem;--threshold:20rem}.min-w-description::before{content:'';width:var(--threshold);display:block;overflow:hidden}.ml-description{--min-width:calc(var(--threshold) + var(--preview-size) + var(--lumo-space-l));--free-space:calc(100% - var(--min-width));--max-margin-left:calc(var(--preview-size) + var(--lumo-space-l));--final-margin-left:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-left));margin-left:var(--final-margin-left)}.mr-quantity{--min-width:var(--threshold);--free-space:calc(100% - var(--min-width));--max-margin-right:calc(var(--quantity-width) + var(--lumo-space-l));--final-margin-right:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-right));margin-right:var(--final-margin-right)}:host([data-bundled]:not(:last-of-type)) .separator::after{content:' ';display:block;position:absolute;width:100vw;border-bottom:solid thin var(--lumo-shade-10pct);left:0;bottom:0}.w-quantity{width:var(--quantity-width)}.w-preview{width:var(--preview-size)}.h-preview{height:var(--preview-size)}`))]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"x-error-screen":c,"x-preview":j,"x-i18n":o}}static get properties(){return t(t({},super.properties),{},{__modified:{},readonly:{type:Boolean,reflect:!0},currency:{type:String},category:{type:String},code:{type:String,reflect:!0},expires:{type:String},height:{type:Number},image:{type:String},length:{type:Number},name:{type:String},parent_code:{type:String},price:{type:Number},quantity:{type:Number,reflect:!0},quantity_max:{type:Number},quantity_min:{type:String},shipto:{type:String},total:{type:Number,reflect:!0,attribute:"total"},url:{type:String},value:{type:Object},weight:{type:Number},width:{type:Number},__childPrices:{},__childrenCount:{},__images:{},alt:{type:String},isChildItem:{type:Boolean,reflect:!0,attribute:"data-bundled"},isItem:{type:Boolean,reflect:!0,attribute:"data-item"},open:{type:Object},pid:{type:Number,reflect:!0},items:{type:Array}})}get items(){const t=[];return this.__onEachChildItem([e=>t.push(e.value)]),t}set items(t){this.__createItems(t)}get value(){const t={};for(let e=0;e<this.attributes.length;e++)t[this.attributes[e].name]=this.attributes[e].value;return t.items=this.items,t}set value(t){this.__itemDescription="";for(const e in t){let i="";if("description"!=e){if("object"==typeof t[e])i=JSON.stringify(t[e]);else{const s=e;(t[s]&&"undefined"!==t[s]||0===t[s])&&(i=t[e].toString())}this.setAttribute(e,t[e]?i:"")}else this.__itemDescription=t[e]}}updated(t){t.forEach(((t,e)=>{"__itemDescription"!=e&&"isChildItem"!=e||this.__updateDescriptionEl()})),this.__setTotalPrice(),this.dispatchEvent(new Event("change"))}render(){var t;if(!this.__isValid())return s(T||(T=Z`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`));const e=`font-lumo text-body text-s leading-m transition duration-100 ${this.quantity?"":"removed opacity-50"}`;if(this.isChildItem)return s(O||(O=Z` <article part="item" class="py-s w-full relative separator item-summary flex justify-between ${0}"> <div class="description flex-1"> <h1 class="text-header font-medium">${0}</h1> <section class="description text-secondary"> <slot></slot> </section> </div> ${0} </article> `),e,this.name,this.quantity<2?"":s(V||(V=Z` <section class="quantity font-medium text-tertiary whitespace-nowrap"> ${0} </section> `),this._t("item.items",{quantity:this.quantity})));{const i=(null!==(t=this.price)&&void 0!==t?t:0)+this.__childPrices.reduce(((t,e)=>t+e),0),r=this.__translateAmount(i*this.quantity),a=this.__translateAmount(i);return s(M||(M=Z` <article part="item" class="p-l relative item ${0} ${0}"> <x-preview class="preview float-left w-preview h-preview mr-l mb-l" exportparts="picture" .image="${0}" .quantity="${0}" .items="${0}"> </x-preview> <section class="description min-w-description ml-description"> <h1 class="text-header font-medium text-l leading-none mr-quantity mb-s"> ${0} </h1> <div class="item-description text-secondary mr-quantity mb-s"> <slot></slot> </div> <div class="child-items mb-s"> <slot name="items"></slot> </div> ${0} </section> <section class="quantity w-quantity absolute top-0 right-0 m-l"> <vaadin-integer-field class="w-full p-0" name="quantity" @change="${0}" value="${0}" min="0" has-controls ?readonly="${0}"> </vaadin-integer-field> ${0} </section> </article> `),e,this.__modified?"modified":"",this.image,this.quantity,[...this.querySelectorAll("[data-bundled]")].map((t=>{var e;return{quantity:t.quantity,image:null!==(e=t.image)&&void 0!==e?e:""}})),this.name,a?s(H||(H=Z`<div class="font-medium price text-l">${0}</div>`),a):"",this.__handleQuantity,this.quantity,this.readonly,this.quantity>1?s(B||(B=Z` <x-i18n .ns="${0}" .lang="${0}" .opts="${0}" class="price-total text-secondary text-xs text-center block mt-xs" key="price.total"> </x-i18n> `),this.ns,this.lang,{amount:r}):"")}}getImageDescription(){return{src:this.image,alt:this.alt,quantity:this.quantity}}signedName(t){const e=super.signedName(t);return`${this.pid.toString()}:${e}`}static __newId(){const t=R.__existingIds.reduce(((t,e)=>e>t?e:t),0)+1;return R.__existingIds.push(t),t}__updateDescriptionEl(){if(this.__itemDescription){let t=this.shadowRoot.querySelector("data-item-description");t||(t=document.createElement("p"),t.dataset.itemDescription="true",this.__addSlottedEl(t)),t.innerText=this.__itemDescription}else{const t=this.shadowRoot.querySelector("data-item-description");t&&t.remove()}}__addSlottedEl(t){const e=this.shadowRoot.querySelector("article");e&&e.appendChild(t)}__setCode(){this.code||(this.code=`RAND${Math.random()}`)}__createItems(t){t.forEach((t=>{const e=document.createElement(this.tagName);e.value=t,e.currency=this.currency,e.__computeTotalPrice(),this.__acknowledgeItem(e),this.appendChild(e)}))}__setTotalPrice(){this.total=this.__computeTotalPrice()}__computeTotalPrice(){if(!this.__childPrices)return this.price?this.price*this.quantity:0;let t=0;return this.__childPrices.forEach((e=>{t+=e})),t+=this.price,t*=this.quantity,t}__isValid(){const t=[];return this.name&&this.name.length||t.push("The name attribute of an item is required."),this.price||0===this.price||t.push("The price attribute of an item is required."),this.price&&this.price<0&&t.push("Item added with negative price."),this.quantity_min&&this.quantity&&this.quantity<this.quantity_min&&t.push("Quantity amount is less than minimum quantity."),this.quantity_max&&this.quantity&&this.quantity>this.quantity_max&&t.push("Quantity amount is more than maximum quantity."),console.error(...t),!t.length}__translateAmount(t){return this.currency?t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"}):""}__observeItems(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.nodeType===Node.DOCUMENT_NODE&&this.__acknowledgeItem(t)}))})),this.__setTotalPrice()}__acknowledgeChildItems(){var t;null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t))),this.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t)))}__acknowledgeItem(t){t.addEventListener("change",this.__changedChildItem.bind(this)),t.currency=this.currency,t.isItem=!1,t.isChildItem=!0,this.code&&(t.parent_code=this.code)}__changedChildItem(){const t=[],e=[];let i=0;this.__onEachChildItem([e=>{void 0!==e.total&&t.push(e.total)},t=>{e.push(t.getImageDescription())},()=>i+=1]),this.image&&0===e.length&&e.push(this.getImageDescription()),this.__childPrices=t,this.__images=e,this.__childrenCount=i,this.__setTotalPrice()}__onEachChildItem(t){const e=this.querySelectorAll("[data-bundled]");for(const i of e)for(const e of t)e(i)}}R.__existingIds=[];let z,Q,W,J,U,X,G=t=>t;class K extends P{constructor(){super("items-form"),this.readonly=!1,this.target="_top",this.cart="checkout",this.sub_modify="replace",this.sub_restart="auto",this.frequencies=[],this.handleSubmit={handleEvent:()=>{null!==this.__data&&this.dispatchEvent(new m(this.__data))&&this.shadowRoot.querySelector("form").submit()}},this.__hasValidItems=!1,this.__total=0,this.__handleFrequency={handleEvent:t=>{const e=t.detail.replace(/([wydm])\w*/,"$1").replace(/ /g,"").replace(/^0/,"");K.__validFrequency(e)?this.sub_frequency=e:this.sub_frequency="",this.__updateData()}},this.__data=new FormData,this.__childItemsObserver=new MutationObserver(this.__observeChildren.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}))}static get scopedElements(){return{"x-error-screen":c,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":l,"x-item":R}}static get properties(){return t(t({},super.properties),{},{currency:{type:String},readonly:{type:Boolean},cart:{type:String,converter:t=>t&&!["checkout","add"].includes(t)?null:t},target:{type:String},store:{type:String,attribute:"store"},sub_frequency:{type:String},sub_startdate:{type:String,converter:t=>K.__validDate(t)?t:(console.error("Invalid start date",t),"")},sub_enddate:{type:String,converter:t=>K.__validDateFuture(t)?t:(console.error("Invalid end date",t),"")},sub_token:{type:String},sub_modify:{type:String,converter:t=>""===t||"append"===t?"":"replace"},sub_restart:{type:String,converter:t=>"true"===t?t:"auto"},frequencies:{converter:t=>{if(!t)return[];const e=JSON.parse(t);if(!Array.isArray(e))return console.error("Invalid frequency","Frequency options must be an array."),[];for(const t of e)if(!K.__validFrequency(t))return console.error("Invalid frequency","Invalid frequency option.\n Please, check https://wiki.foxycart.com/v/2.0/products#subscription_product_options for possible values.\n Each frequency must be a in the format:\n - 1d (a number followed by d, for day)\n - 1w (a number followed by w, for week)\n - 1m (a number followed by m, for month)\n - 1y (a number followed by y, for year)\n or .5m (no other decimals are allowed, and this is only for months)\n ",t),[];return e.filter(K.__validFrequency)}},items:{type:Array},__hasValidItems:{attribute:!1},__total:{attribute:!1},__data:{attribute:!1}})}get items(){const t=[];return this.__itemElements.forEach((e=>{const i=new Proxy(e,{set:function(t,e,i){const s=Object.keys(t.value);return!("string"!=typeof e||!s.includes(e))&&(t[e]=i,!0)},get:function(t,e){return t.value[e]}});t.push(i)})),t}set items(t){this.__removeItems(),this.__createItemsFromItemArray(t)}get total(){return this.__total}render(){var t;return this.store&&this.currency?s(Q||(Q=G` <div> <form class="overflow-hidden" method="POST" target="${0}" action="https://${0}/cart" data-testid="form" class="hidden" hidden> ${0} </form> <section class="items"> <slot></slot> </section> ${0} </div> `),this.target,this.store,this.__data?s(W||(W=G` ${0}`),[...this.__data.entries()].map((([t,e])=>s(J||(J=G`<input type="hidden" name="${0}" value="${0}">`),t,e)))):"",this.readonly?"":s(U||(U=G` <section class="actions flex flex-wrap justify-end m-m"> ${0} <vaadin-button class="m-s w-full sm-w-auto" theme="primary" data-testid="submit" ?disabled="${0}" @click="${0}"> <span class="total"> ${0} </span> </vaadin-button> </section> `),this.frequencies&&this.frequencies.length?s(X||(X=G` <x-dropdown type="text" name="frequency" class="subscription m-s w-full sm-w-auto" lang="${0}" .value="${0}" .items="${0}" .getText="${0}" @change="${0}"> </x-dropdown> `),this.lang,null!==(t=this.sub_frequency)&&void 0!==t?t:"0",this.frequencies.concat(["0"]),this.__translateFrequency.bind(this),this.__handleFrequency):"",!this.__hasValidItems,this.handleSubmit,this.__submitBtnText(this.__translateAmount(this.total)))):s(z||(z=G`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`))}addItems(t){for(const e of t){const t=this.createItem(e);this.appendChild(t),this.__acknowledgeItemElement(t)}}removeItems(t){this.__removeItems((e=>t.includes(e.pid)))}updated(){this.dispatchEvent(new u(this.__data))}createItem(t){const e=this.constructor.getScopedTagName("x-item"),i=document.createElement(e);return i.value=t,i.currency=this.currency,i.readonly=this.readonly,i}__submitBtnText(t){if(this.sub_frequency&&"0"!=this.sub_frequency){const e=r(this.sub_frequency);return 1===e.count?this._t("checkout.subscribe_single_unit",{value:t,period:this._t(e.units).toLowerCase()}):this._t("checkout.subscribe_muiltiple_units",{value:t,period:this.__translateFrequency(this.sub_frequency).toLowerCase()})}return this._t("checkout.buy",{value:t})}get __itemElements(){return this.querySelectorAll("[data-item]")}__createItemsFromItemArray(t){this.addItems(t)}__removeItems(t=(()=>!0)){this.__itemElements.forEach((e=>{t(e)&&e.remove()}))}__addSignature(t,e,i){return`${t}||${e}${i?"||open":""}`}__formDataFill(t){let e=0;return this.__itemElements.forEach((i=>{e+=this.__formDataAddItem(t,i)})),this.__formDataAddCartWideSubscriptionFields(t),e}__formDataCustomInputs(t){this.querySelectorAll("[name]").forEach((e=>{const i=e;"INPUT"==i.tagName&&["checkbox","radio"].includes(i.type)&&!i.checked||"OPTION"!=i.tagName&&i.value&&["number","string"].includes(typeof i.value)&&t.set(i.name,i.value)}))}__isAttributeReserved(t){return["alt","currency","description","isChildren","isItem","items","open","pid","signatures","slot","total"].includes(t)}__formDataAddItem(t,e,i=null){let s=0;if(this.__validItem(e)){if(!e.value.pid)throw new Error("Attempt to convert a item without a propper ID");i&&i.getAttribute("code")&&e.setAttribute("parent_code",i.getAttribute("code"));for(let s=0;s<e.attributes.length;s++){const r=e.attributes[s];if(!this.__isAttributeReserved(r.name)&&!r.name.startsWith("data-")){let s=e[r.name];e.code&&["string","number"].includes(typeof s)&&(i&&"quantity"==r.name&&(s=Number(r.value)*i.quantity),t.set(e.signedName(r.name),s.toString()))}}s+=1,this.__formDataAddSubscriptionFields(t,e)}const r=e.querySelectorAll("[data-bundled]");if(r&&e.quantity>0)for(const i of r)s+=this.__formDataAddItem(t,i,e);return s}__formDataAddSubscriptionFields(t,e){if(this.sub_frequency)for(const i of["sub_frequency","sub_startdate","sub_enddate"])this[i]&&t.set(e.signedName(i),this[i])}__formDataAddCartWideSubscriptionFields(t){this.sub_frequency&&(this.sub_token&&t.set(this.signedName("sub_token"),this.sub_token),t.set(this.signedName("sub_modify"),this.sub_modify),t.set(this.signedName("sub_restart"),this.sub_restart))}__formDataAddCartFields(t){this.cart?t.set("cart",this.cart):t.delete("cart")}static __validDate(t){return null!=t&&(t.match(/^(\d{1,2}|\d{8})$/)?!(t.match(/^\d{2}$/)&&Number(t)>31):!(t.match(/^\.5m/)||!K.__validFrequency(t)))}static __validDateFuture(t){let e=!1;if(K.__validDate(t))if(t.match(/^\d{8}/)){e=(new Date).toISOString().replace(/(-|T.*)/g,"")<=t}else e=!0;return e}static __validFrequency(t){return!!t&&!!t.match(/^(\.5m|\d+[dwmy])$/)}__observeChildren(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.addEventListener("change",this.__itemChange.bind(this))}))})),this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}__itemChange(){this.__computeTotalPrice(),this.__updateData()}__computeTotalPrice(){let t=0;this.__itemElements.forEach((e=>{const i=e;i.total&&(t+=Number(i.total))})),this.__total=Number(t.toFixed(2))}__acknowledgeItemElements(){this.__itemElements.forEach((t=>{const e=t;this.__acknowledgeItemElement(e)}))}__acknowledgeItemElement(t){t.addEventListener("change",this.__itemChange.bind(this)),t.currency=this.currency}__validItem(t){const e=t.getAttribute("pid"),i=Number(t.getAttribute("quantity")),s=Number(t.getAttribute("price"));return!!(e&&i>0&&s>=0)}__translateFrequency(t){if(t.startsWith("0"))return this._t("frequency_once");if(".5m"===t)return this._t("frequency_0_5m");const{count:e,units:i}=r(t);return this._t("frequency",{units:this._t(i,{count:e}),count:e})}__translateAmount(t){return t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"})}__updateData(){this.__data=null;if(!this.shadowRoot.querySelector("form"))return;const t=new FormData,e=this.__formDataFill(t);this.__hasValidItems=!!e,this.__formDataAddCartFields(t),this.__formDataCustomInputs(t),this.__data=t}}customElements.define("foxy-items-form",K),customElements.define("foxy-item",R);export{K as I,j as P,R as a};
@@ -1,4 +1,4 @@
1
- import{T as t}from"./shared-85bcfcde.js";import{a as s}from"./shared-b4865438.js";let e,n,a,o,l,i,r=t=>t;class c extends(s(t,"transactions-table")){constructor(){super(...arguments),this.columns=[c.priceColumn,c.summaryColumn,c.statusColumn,c.idColumn,c.dateColumn,c.receiptColumn]}}c.priceColumn={cell:t=>t.html(e||(e=r`
1
+ import{T as t}from"./shared-974bec9a.js";import{T as s}from"./shared-5155696f.js";let e,n,a,o,l,i,r=t=>t;class c extends(s(t,"transactions-table")){constructor(){super(...arguments),this.columns=[c.priceColumn,c.summaryColumn,c.statusColumn,c.idColumn,c.dateColumn,c.receiptColumn]}}c.priceColumn={cell:t=>t.html(e||(e=r`
2
2
  <foxy-i18n
3
3
  data-testclass="i18n totals"
4
4
  class="text-m font-semibold font-tnum"
@@ -1,4 +1,4 @@
1
- import{_ as e}from"./shared-ca0f14c1.js";import{a as t,E as s,T as i,C as n}from"./shared-ea418c18.js";import{T as r}from"./shared-07834676.js";import{O as o,I as a}from"./shared-63e71a69.js";import{h as l,D as d,t as A,P as h}from"./shared-833a8b4e.js";import{F as c,P as m,a as u}from"./shared-09d39b25.js";import{z as p,w as g,y as v}from"./shared-b4865438.js";import{c as _,L as y,h as b}from"./shared-7f33a83a.js";import{D as f}from"./shared-b4d0adff.js";class x extends CustomEvent{constructor(e){super("change",{detail:e})}}class w extends x{}const E=l`<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
1
+ import{a as e,E as t,T as i,C as s}from"./shared-75ec4e1a.js";import{T as o}from"./shared-76daf1fb.js";import{O as n,I as l}from"./shared-5fd9d45d.js";import{h as A,D as r,t as a,P as d}from"./shared-cf2b9cc3.js";import{F as h,P as u,a as m}from"./shared-26502fca.js";import"./shared-1b38c44f.js";const c=A`<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
2
2
  <template>
3
3
  <style>
4
4
  :host {
@@ -76,23 +76,23 @@ import{_ as e}from"./shared-ca0f14c1.js";import{a as t,E as s,T as i,C as n}from
76
76
  }
77
77
  </style>
78
78
  </template>
79
- </dom-module>`;document.head.appendChild(E.content);
79
+ </dom-module>`;document.head.appendChild(c.content);
80
80
  /**
81
81
  @license
82
82
  Copyright (c) 2017 Vaadin Ltd.
83
83
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
84
84
  */
85
- const k=e=>class extends e{static get properties(){return{_hasVaadinListMixin:{value:!0},selected:{type:Number,reflectToAttribute:!0,notify:!0},orientation:{type:String,reflectToAttribute:!0,value:""},items:{type:Array,readOnly:!0,notify:!0},_searchBuf:{type:String,value:""}}}static get observers(){return["_enhanceItems(items, orientation, selected, disabled)"]}ready(){super.ready(),this.addEventListener("keydown",(e=>this._onKeydown(e))),this.addEventListener("click",(e=>this._onClick(e))),this._observer=new c(this,(e=>{this._setItems(this._filterItems(Array.from(this.children)))}))}_enhanceItems(e,t,s,i){if(!i&&e){this.setAttribute("aria-orientation",t||"vertical"),this.items.forEach((e=>{t?e.setAttribute("orientation",t):e.removeAttribute("orientation"),e.updateStyles()})),this._setFocusable(s);const i=e[s];e.forEach((e=>e.selected=e===i)),i&&!i.disabled&&this._scrollToItem(s)}}get focused(){return this.getRootNode().activeElement}_filterItems(e){return e.filter((e=>e._hasVaadinItemMixin))}_onClick(e){if(e.metaKey||e.shiftKey||e.ctrlKey||e.defaultPrevented)return;const t=this._filterItems(e.composedPath())[0];let s;t&&!t.disabled&&(s=this.items.indexOf(t))>=0&&(this.selected=s)}_searchKey(e,t){this._searchReset=d.debounce(this._searchReset,A.after(500),(()=>this._searchBuf="")),this._searchBuf+=t.toLowerCase();this.items.some((e=>0===e.textContent.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().indexOf(this._searchBuf)))||(this._searchBuf=t.toLowerCase());const s=1===this._searchBuf.length?e+1:e;return this._getAvailableIndex(s,1,(e=>!(e.disabled||this._isItemHidden(e))&&0===e.textContent.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().indexOf(this._searchBuf)))}get _isRTL(){return!this._vertical&&"rtl"===this.getAttribute("dir")}_onKeydown(e){if(e.metaKey||e.ctrlKey)return;const t=e.key.replace(/^Arrow/,""),s=this.items.indexOf(this.focused);if(/[a-zA-Z0-9]/.test(t)&&1===t.length){const e=this._searchKey(s,t);return void(e>=0&&this._focus(e))}let i,n;const r=this._isRTL?-1:1;this._vertical&&"Up"===t||!this._vertical&&"Left"===t?(n=-r,i=s-r):this._vertical&&"Down"===t||!this._vertical&&"Right"===t?(n=r,i=s+r):"Home"===t?(n=1,i=0):"End"===t&&(n=-1,i=this.items.length-1),i=this._getAvailableIndex(i,n,(e=>!(e.disabled||this._isItemHidden(e)))),i>=0&&(this._focus(i),e.preventDefault())}_getAvailableIndex(e,t,s){const i=this.items.length;for(let n=0;"number"==typeof e&&n<i;n++,e+=t||1){e<0?e=i-1:e>=i&&(e=0);if(s(this.items[e]))return e}return-1}_isItemHidden(e){return"none"===getComputedStyle(e).display}_setFocusable(e){e=this._getAvailableIndex(e,1,(e=>!e.disabled));const t=this.items[e]||this.items[0];this.items.forEach((e=>e.tabIndex=e===t?0:-1))}_focus(e){const t=this.items[e];this.items.forEach((e=>e.focused=e===t)),this._setFocusable(e),this._scrollToItem(e),t.focus()}focus(){this._observer&&this._observer.flush();const e=this.querySelector('[tabindex="0"]')||(this.items?this.items[0]:null);e&&e.focus()}get _scrollerElement(){}_scrollToItem(e){const t=this.items[e];if(!t)return;const s=this._vertical?["top","bottom"]:this._isRTL?["right","left"]:["left","right"],i=this._scrollerElement.getBoundingClientRect(),n=(this.items[e+1]||t).getBoundingClientRect(),r=(this.items[e-1]||t).getBoundingClientRect();let o=0;!this._isRTL&&n[s[1]]>=i[s[1]]||this._isRTL&&n[s[1]]<=i[s[1]]?o=n[s[1]]-i[s[1]]:(!this._isRTL&&r[s[0]]<=i[s[0]]||this._isRTL&&r[s[0]]>=i[s[0]])&&(o=r[s[0]]-i[s[0]]),this._scroll(o)}get _vertical(){return"horizontal"!==this.orientation}_scroll(e){if(this._vertical)this._scrollerElement.scrollTop+=e;else{const s=t.detectScrollType(),i=t.getNormalizedScrollLeft(s,this.getAttribute("dir")||"ltr",this._scrollerElement)+e;t.setNormalizedScrollLeft(s,this.getAttribute("dir")||"ltr",this._scrollerElement,i)}}}
85
+ const p=t=>class extends t{static get properties(){return{_hasVaadinListMixin:{value:!0},selected:{type:Number,reflectToAttribute:!0,notify:!0},orientation:{type:String,reflectToAttribute:!0,value:""},items:{type:Array,readOnly:!0,notify:!0},_searchBuf:{type:String,value:""}}}static get observers(){return["_enhanceItems(items, orientation, selected, disabled)"]}ready(){super.ready(),this.addEventListener("keydown",(e=>this._onKeydown(e))),this.addEventListener("click",(e=>this._onClick(e))),this._observer=new h(this,(e=>{this._setItems(this._filterItems(Array.from(this.children)))}))}_enhanceItems(e,t,i,s){if(!s&&e){this.setAttribute("aria-orientation",t||"vertical"),this.items.forEach((e=>{t?e.setAttribute("orientation",t):e.removeAttribute("orientation"),e.updateStyles()})),this._setFocusable(i);const s=e[i];e.forEach((e=>e.selected=e===s)),s&&!s.disabled&&this._scrollToItem(i)}}get focused(){return this.getRootNode().activeElement}_filterItems(e){return e.filter((e=>e._hasVaadinItemMixin))}_onClick(e){if(e.metaKey||e.shiftKey||e.ctrlKey||e.defaultPrevented)return;const t=this._filterItems(e.composedPath())[0];let i;t&&!t.disabled&&(i=this.items.indexOf(t))>=0&&(this.selected=i)}_searchKey(e,t){this._searchReset=r.debounce(this._searchReset,a.after(500),(()=>this._searchBuf="")),this._searchBuf+=t.toLowerCase();this.items.some((e=>0===e.textContent.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().indexOf(this._searchBuf)))||(this._searchBuf=t.toLowerCase());const i=1===this._searchBuf.length?e+1:e;return this._getAvailableIndex(i,1,(e=>!(e.disabled||this._isItemHidden(e))&&0===e.textContent.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().indexOf(this._searchBuf)))}get _isRTL(){return!this._vertical&&"rtl"===this.getAttribute("dir")}_onKeydown(e){if(e.metaKey||e.ctrlKey)return;const t=e.key.replace(/^Arrow/,""),i=this.items.indexOf(this.focused);if(/[a-zA-Z0-9]/.test(t)&&1===t.length){const e=this._searchKey(i,t);return void(e>=0&&this._focus(e))}let s,o;const n=this._isRTL?-1:1;this._vertical&&"Up"===t||!this._vertical&&"Left"===t?(o=-n,s=i-n):this._vertical&&"Down"===t||!this._vertical&&"Right"===t?(o=n,s=i+n):"Home"===t?(o=1,s=0):"End"===t&&(o=-1,s=this.items.length-1),s=this._getAvailableIndex(s,o,(e=>!(e.disabled||this._isItemHidden(e)))),s>=0&&(this._focus(s),e.preventDefault())}_getAvailableIndex(e,t,i){const s=this.items.length;for(let o=0;"number"==typeof e&&o<s;o++,e+=t||1){e<0?e=s-1:e>=s&&(e=0);if(i(this.items[e]))return e}return-1}_isItemHidden(e){return"none"===getComputedStyle(e).display}_setFocusable(e){e=this._getAvailableIndex(e,1,(e=>!e.disabled));const t=this.items[e]||this.items[0];this.items.forEach((e=>e.tabIndex=e===t?0:-1))}_focus(e){const t=this.items[e];this.items.forEach((e=>e.focused=e===t)),this._setFocusable(e),this._scrollToItem(e),t.focus()}focus(){this._observer&&this._observer.flush();const e=this.querySelector('[tabindex="0"]')||(this.items?this.items[0]:null);e&&e.focus()}get _scrollerElement(){}_scrollToItem(e){const t=this.items[e];if(!t)return;const i=this._vertical?["top","bottom"]:this._isRTL?["right","left"]:["left","right"],s=this._scrollerElement.getBoundingClientRect(),o=(this.items[e+1]||t).getBoundingClientRect(),n=(this.items[e-1]||t).getBoundingClientRect();let l=0;!this._isRTL&&o[i[1]]>=s[i[1]]||this._isRTL&&o[i[1]]<=s[i[1]]?l=o[i[1]]-s[i[1]]:(!this._isRTL&&n[i[0]]<=s[i[0]]||this._isRTL&&n[i[0]]>=s[i[0]])&&(l=n[i[0]]-s[i[0]]),this._scroll(l)}get _vertical(){return"horizontal"!==this.orientation}_scroll(t){if(this._vertical)this._scrollerElement.scrollTop+=t;else{const i=e.detectScrollType(),s=e.getNormalizedScrollLeft(i,this.getAttribute("dir")||"ltr",this._scrollerElement)+t;e.setNormalizedScrollLeft(i,this.getAttribute("dir")||"ltr",this._scrollerElement,s)}}}
86
86
  /**
87
87
  @license
88
88
  Copyright (c) 2019 Vaadin Ltd.
89
89
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
90
- */,C=e=>class extends(k(e)){static get properties(){return{multiple:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_multipleChanged"},selectedValues:{type:Array,notify:!0,value:function(){return[]}}}}static get observers(){return["_enhanceMultipleItems(items, multiple, selected, selectedValues, selectedValues.*)"]}ready(){this.addEventListener("click",(e=>this._onMultipleClick(e))),super.ready()}_enhanceMultipleItems(e,t,s,i){if(e&&t){if(i){const t=i.map((t=>e[t]));e.forEach((e=>e.selected=-1!==t.indexOf(e)))}this._scrollToLastSelectedItem()}}_scrollToLastSelectedItem(){const e=this.selectedValues.slice(-1)[0];e&&!e.disabled&&this._scrollToItem(e)}_onMultipleClick(e){const t=this._filterItems(e.composedPath())[0],s=t&&!t.disabled?this.items.indexOf(t):-1;s<0||!this.multiple||(e.preventDefault(),-1!==this.selectedValues.indexOf(s)?this.selectedValues=this.selectedValues.filter((e=>e!==s)):this.selectedValues=this.selectedValues.concat(s))}_multipleChanged(e,t){!e&&t&&(this.selectedValues=[],this.items.forEach((e=>e.selected=!1))),e&&!t&&void 0!==this.selected&&(this.push("selectedValues",this.selected),this.selected=void 0)}}
90
+ */,v=e=>class extends(p(e)){static get properties(){return{multiple:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_multipleChanged"},selectedValues:{type:Array,notify:!0,value:function(){return[]}}}}static get observers(){return["_enhanceMultipleItems(items, multiple, selected, selectedValues, selectedValues.*)"]}ready(){this.addEventListener("click",(e=>this._onMultipleClick(e))),super.ready()}_enhanceMultipleItems(e,t,i,s){if(e&&t){if(s){const t=s.map((t=>e[t]));e.forEach((e=>e.selected=-1!==t.indexOf(e)))}this._scrollToLastSelectedItem()}}_scrollToLastSelectedItem(){const e=this.selectedValues.slice(-1)[0];e&&!e.disabled&&this._scrollToItem(e)}_onMultipleClick(e){const t=this._filterItems(e.composedPath())[0],i=t&&!t.disabled?this.items.indexOf(t):-1;i<0||!this.multiple||(e.preventDefault(),-1!==this.selectedValues.indexOf(i)?this.selectedValues=this.selectedValues.filter((e=>e!==i)):this.selectedValues=this.selectedValues.concat(i))}_multipleChanged(e,t){!e&&t&&(this.selectedValues=[],this.items.forEach((e=>e.selected=!1))),e&&!t&&void 0!==this.selected&&(this.push("selectedValues",this.selected),this.selected=void 0)}}
91
91
  /**
92
92
  @license
93
93
  Copyright (c) 2017 Vaadin Ltd.
94
94
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
95
- */;class I extends(s(C(i(h)))){static get template(){return l`
95
+ */;class _ extends(t(v(i(d)))){static get template(){return A`
96
96
  <style>
97
97
  :host {
98
98
  display: flex;
@@ -112,7 +112,7 @@ This program is available under Apache License Version 2.0, available at https:/
112
112
  <div part="items">
113
113
  <slot></slot>
114
114
  </div>
115
- `}static get is(){return"vaadin-list-box"}static get version(){return"1.4.0"}static get properties(){return{orientation:{readOnly:!0}}}constructor(){super(),this.focused}ready(){super.ready(),this.setAttribute("role","list"),setTimeout(this._checkImport.bind(this),2e3)}get _scrollerElement(){return this.shadowRoot.querySelector('[part="items"]')}_checkImport(){var e=this.querySelector("vaadin-item");!e||e instanceof h||console.warn("Make sure you have imported the vaadin-item element.")}}customElements.define(I.is,I);const B=l`<dom-module id="lumo-select" theme-for="vaadin-select">
115
+ `}static get is(){return"vaadin-list-box"}static get version(){return"1.4.0"}static get properties(){return{orientation:{readOnly:!0}}}constructor(){super(),this.focused}ready(){super.ready(),this.setAttribute("role","list"),setTimeout(this._checkImport.bind(this),2e3)}get _scrollerElement(){return this.shadowRoot.querySelector('[part="items"]')}_checkImport(){var e=this.querySelector("vaadin-item");!e||e instanceof d||console.warn("Make sure you have imported the vaadin-item element.")}}customElements.define(_.is,_);const g=A`<dom-module id="lumo-select" theme-for="vaadin-select">
116
116
  <template>
117
117
  <style include="lumo-field-button">
118
118
  :host {
@@ -239,7 +239,7 @@ This program is available under Apache License Version 2.0, available at https:/
239
239
  }
240
240
  </style>
241
241
  </template>
242
- </dom-module>`;document.head.appendChild(B.content),
242
+ </dom-module>`;document.head.appendChild(g.content),
243
243
  /**
244
244
  @license
245
245
  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
@@ -250,25 +250,25 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
250
250
  part of the polymer project is also subject to an additional IP rights grant
251
251
  found at http://polymer.github.io/PATENTS.txt
252
252
  */
253
- m({is:"iron-media-query",properties:{queryMatches:{type:Boolean,value:!1,readOnly:!0,notify:!0},query:{type:String,observer:"queryChanged"},full:{type:Boolean,value:!1},_boundMQHandler:{value:function(){return this.queryHandler.bind(this)}},_mq:{value:null}},attached:function(){this.style.display="none",this.queryChanged()},detached:function(){this._remove()},_add:function(){this._mq&&this._mq.addListener(this._boundMQHandler)},_remove:function(){this._mq&&this._mq.removeListener(this._boundMQHandler),this._mq=null},queryChanged:function(){this._remove();var e=this.query;e&&(this.full||"("===e[0]||(e="("+e+")"),this._mq=window.matchMedia(e),this._add(),this.queryHandler(this._mq))},queryHandler:function(e){this._setQueryMatches(e.matches)}});
253
+ u({is:"iron-media-query",properties:{queryMatches:{type:Boolean,value:!1,readOnly:!0,notify:!0},query:{type:String,observer:"queryChanged"},full:{type:Boolean,value:!1},_boundMQHandler:{value:function(){return this.queryHandler.bind(this)}},_mq:{value:null}},attached:function(){this.style.display="none",this.queryChanged()},detached:function(){this._remove()},_add:function(){this._mq&&this._mq.addListener(this._boundMQHandler)},_remove:function(){this._mq&&this._mq.removeListener(this._boundMQHandler),this._mq=null},queryChanged:function(){this._remove();var e=this.query;e&&(this.full||"("===e[0]||(e="("+e+")"),this._mq=window.matchMedia(e),this._add(),this.queryHandler(this._mq))},queryHandler:function(e){this._setQueryMatches(e.matches)}});
254
254
  /**
255
255
  @license
256
256
  Copyright (c) 2017 Vaadin Ltd.
257
257
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
258
258
  */
259
- const S=document.createElement("template");S.innerHTML='<dom-module id="vaadin-select-overlay-styles" theme-for="vaadin-select-overlay">\n <template>\n <style>\n :host {\n align-items: flex-start;\n justify-content: flex-start;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(S.content);class T extends o{static get is(){return"vaadin-select-overlay"}}
259
+ const f=document.createElement("template");f.innerHTML='<dom-module id="vaadin-select-overlay-styles" theme-for="vaadin-select-overlay">\n <template>\n <style>\n :host {\n align-items: flex-start;\n justify-content: flex-start;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(f.content);class y extends n{static get is(){return"vaadin-select-overlay"}}
260
260
  /**
261
261
  @license
262
262
  Copyright (c) 2017 Vaadin Ltd.
263
263
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
264
264
  */
265
- let L;customElements.define(T.is,T);class R extends r{static get is(){return"vaadin-select-text-field"}static get template(){if(super.template.content.querySelector('slot[name="input"]'))return super.template;if(!L){L=super.template.cloneNode(!0);const e=document.createElement("slot");e.setAttribute("name","value");const t=L.content.querySelector("input");t.parentElement.replaceChild(e,t),e.appendChild(t)}return L}get focusElement(){return this.shadowRoot.querySelector("[part=input-field]")}get inputElement(){return this.shadowRoot.querySelector("input")}}customElements.define(R.is,R);
265
+ let b;customElements.define(y.is,y);class E extends o{static get is(){return"vaadin-select-text-field"}static get template(){if(super.template.content.querySelector('slot[name="input"]'))return super.template;if(!b){b=super.template.cloneNode(!0);const e=document.createElement("slot");e.setAttribute("name","value");const t=b.content.querySelector("input");t.parentElement.replaceChild(e,t),e.appendChild(t)}return b}get focusElement(){return this.shadowRoot.querySelector("[part=input-field]")}get inputElement(){return this.shadowRoot.querySelector("input")}}customElements.define(E.is,E);
266
266
  /**
267
267
  @license
268
268
  Copyright (c) 2017 Vaadin Ltd.
269
269
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
270
270
  */
271
- const M=document.createElement("template");M.innerHTML="<custom-style>\n <style>\n @font-face {\n font-family: \"vaadin-select-icons\";\n src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAASEAAsAAAAABDgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIGKmNtYXAAAAFoAAAAVAAAAFQXVtKHZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAHwAAAB8CohkJ2hlYWQAAAJAAAAANgAAADYOavgEaGhlYQAAAngAAAAkAAAAJAarA8ZobXR4AAACnAAAABQAAAAUCAABP2xvY2EAAAKwAAAADAAAAAwAKABSbWF4cAAAArwAAAAgAAAAIAAHABduYW1lAAAC3AAAAYYAAAGGmUoJ+3Bvc3QAAARkAAAAIAAAACAAAwAAAAMEAAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6QADwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOkA//3//wAAAAAAIOkA//3//wAB/+MXBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQE/AUAC6QIVABQAAAEwFx4BFxYxMDc+ATc2MTAjKgEjIgE/ISJPIiEhIk8iIUNCoEJDAhUhIk8iISEiTyIhAAEAAAABAABvL5bdXw889QALBAAAAAAA1jHaeQAAAADWMdp5AAAAAALpAhUAAAAIAAIAAAAAAAAAAQAAA8D/wAAABAAAAAAAAukAAQAAAAAAAAAAAAAAAAAAAAUEAAAAAAAAAAAAAAAAAAAABAABPwAAAAAACgAUAB4APgABAAAABQAVAAEAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEABwAAAAEAAAAAAAIABwBgAAEAAAAAAAMABwA2AAEAAAAAAAQABwB1AAEAAAAAAAUACwAVAAEAAAAAAAYABwBLAAEAAAAAAAoAGgCKAAMAAQQJAAEADgAHAAMAAQQJAAIADgBnAAMAAQQJAAMADgA9AAMAAQQJAAQADgB8AAMAAQQJAAUAFgAgAAMAAQQJAAYADgBSAAMAAQQJAAoANACkaWNvbW9vbgBpAGMAbwBtAG8AbwBuVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwaWNvbW9vbgBpAGMAbwBtAG8AbwBuaWNvbW9vbgBpAGMAbwBtAG8AbwBuUmVndWxhcgBSAGUAZwB1AGwAYQByaWNvbW9vbgBpAGMAbwBtAG8AbwBuRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff');\n font-weight: normal;\n font-style: normal;\n }\n </style>\n</custom-style>",document.head.appendChild(M.content);class Q extends(s(n(i(u(a,h))))){static get template(){return l`
271
+ const w=document.createElement("template");w.innerHTML="<custom-style>\n <style>\n @font-face {\n font-family: \"vaadin-select-icons\";\n src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAASEAAsAAAAABDgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIGKmNtYXAAAAFoAAAAVAAAAFQXVtKHZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAHwAAAB8CohkJ2hlYWQAAAJAAAAANgAAADYOavgEaGhlYQAAAngAAAAkAAAAJAarA8ZobXR4AAACnAAAABQAAAAUCAABP2xvY2EAAAKwAAAADAAAAAwAKABSbWF4cAAAArwAAAAgAAAAIAAHABduYW1lAAAC3AAAAYYAAAGGmUoJ+3Bvc3QAAARkAAAAIAAAACAAAwAAAAMEAAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6QADwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOkA//3//wAAAAAAIOkA//3//wAB/+MXBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQE/AUAC6QIVABQAAAEwFx4BFxYxMDc+ATc2MTAjKgEjIgE/ISJPIiEhIk8iIUNCoEJDAhUhIk8iISEiTyIhAAEAAAABAABvL5bdXw889QALBAAAAAAA1jHaeQAAAADWMdp5AAAAAALpAhUAAAAIAAIAAAAAAAAAAQAAA8D/wAAABAAAAAAAAukAAQAAAAAAAAAAAAAAAAAAAAUEAAAAAAAAAAAAAAAAAAAABAABPwAAAAAACgAUAB4APgABAAAABQAVAAEAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEABwAAAAEAAAAAAAIABwBgAAEAAAAAAAMABwA2AAEAAAAAAAQABwB1AAEAAAAAAAUACwAVAAEAAAAAAAYABwBLAAEAAAAAAAoAGgCKAAMAAQQJAAEADgAHAAMAAQQJAAIADgBnAAMAAQQJAAMADgA9AAMAAQQJAAQADgB8AAMAAQQJAAUAFgAgAAMAAQQJAAYADgBSAAMAAQQJAAoANACkaWNvbW9vbgBpAGMAbwBtAG8AbwBuVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwaWNvbW9vbgBpAGMAbwBtAG8AbwBuaWNvbW9vbgBpAGMAbwBtAG8AbwBuUmVndWxhcgBSAGUAZwB1AGwAYQByaWNvbW9vbgBpAGMAbwBtAG8AbwBuRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff');\n font-weight: normal;\n font-style: normal;\n }\n </style>\n</custom-style>",document.head.appendChild(w.content);class x extends(t(s(i(m(l,d))))){static get template(){return A`
272
272
  <style>
273
273
  :host {
274
274
  display: inline-block;
@@ -301,14 +301,4 @@ const M=document.createElement("template");M.innerHTML="<custom-style>\n <style
301
301
  <vaadin-select-overlay opened="{{opened}}" with-backdrop="[[_phone]]" phone\$="[[_phone]]" theme\$="[[theme]]"></vaadin-select-overlay>
302
302
 
303
303
  <iron-media-query query="[[_phoneMediaQuery]]" query-matches="{{_phone}}"></iron-media-query>
304
- `}static get is(){return"vaadin-select"}static get version(){return"2.4.3"}static get properties(){return{opened:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0,observer:"_openedChanged"},renderer:Function,errorMessage:{type:String,value:""},label:{type:String},value:{type:String,value:"",notify:!0,observer:"_valueChanged"},required:{type:Boolean,reflectToAttribute:!0,observer:"_requiredChanged"},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},name:{type:String,reflectToAttribute:!0},placeholder:{type:String},helperText:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},_phone:Boolean,_phoneMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},_overlayElement:Object,_inputElement:Object,_toggleElement:Object,_items:Object,_contentTemplate:Object,_oldTemplate:Object,_oldRenderer:Object}}static get observers(){return["_updateSelectedItem(value, _items)","_updateAriaExpanded(opened, _toggleElement, _inputElement)","_templateOrRendererChanged(_contentTemplate, renderer, _overlayElement)"]}constructor(){super(),this._boundSetPosition=this._setPosition.bind(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("iron-resize",this._boundSetPosition)}ready(){super.ready(),this._overlayElement=this.shadowRoot.querySelector("vaadin-select-overlay"),this._valueElement=this.shadowRoot.querySelector('[part="value"]'),this._toggleElement=this.shadowRoot.querySelector('[part="toggle-button"]'),this._nativeInput=this.focusElement.shadowRoot.querySelector("input"),this._nativeInput.setAttribute("aria-hidden",!0),this._nativeInput.setAttribute("tabindex",-1),this._nativeInput.style.pointerEvents="none",this.focusElement.addEventListener("click",(e=>{const t=Array.from(e.composedPath()).some((e=>e.nodeType===Node.ELEMENT_NODE&&"helper"===e.getAttribute("slot")));this.opened=!this.readonly&&!t})),this.focusElement.addEventListener("keydown",(e=>this._onKeyDown(e))),this._observer=new c(this,(e=>this._setTemplateFromNodes(e.addedNodes))),this._observer.flush()}_setTemplateFromNodes(e){const t=Array.from(e).filter((e=>e.localName&&"template"===e.localName))[0]||this._contentTemplate;this._overlayElement.template=this._contentTemplate=t,this._setForwardHostProps()}_setForwardHostProps(){if(this._overlayElement.content){const e=this._overlayElement._instance&&this._overlayElement._instance.forwardHostProp;this._overlayElement._instance&&(this._overlayElement._instance.forwardHostProp=(...t)=>{e.apply(this._overlayElement._instance,t),setTimeout((()=>{this._updateValueSlot()}))},this._assignMenuElement())}}render(){this._overlayElement&&(this._overlayElement.render(),this._menuElement&&this._menuElement.items&&this._updateSelectedItem(this.value,this._menuElement.items))}_removeNewRendererOrTemplate(e,t,s,i){e!==t?this._contentTemplate=void 0:s!==i&&(this.renderer=void 0)}_templateOrRendererChanged(e,t,s){if(s){if(e&&t)throw this._removeNewRendererOrTemplate(e,this._oldTemplate,t,this._oldRenderer),new Error("You should only use either a renderer or a template for select content");this._oldTemplate=e,this._oldRenderer=t,t&&(s.setProperties({owner:this,renderer:t}),this.render(),s.content.firstChild&&this._assignMenuElement())}}_assignMenuElement(){this._menuElement=Array.from(this._overlayElement.content.children).filter((e=>"style"!==e.localName))[0],this._menuElement&&(this._menuElement.addEventListener("items-changed",(e=>{this._items=this._menuElement.items,this._items.forEach((e=>e.setAttribute("role","option")))})),this._menuElement.addEventListener("selected-changed",(e=>this._updateValueSlot())),this._menuElement.addEventListener("keydown",(e=>this._onKeyDownInside(e))),this._menuElement.addEventListener("click",(e=>{this.__userInteraction=!0,this.opened=!1}),!0),this._menuElement.setAttribute("role","listbox"))}get focusElement(){return this._inputElement||(this._inputElement=this.shadowRoot.querySelector("vaadin-select-text-field"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("iron-resize",this._boundSetPosition),this.opened=!1}notifyResize(){super.notifyResize(),this.positionTarget&&this.opened&&(this._setPosition(),requestAnimationFrame(this._setPosition.bind(this)))}_requiredChanged(e){this.setAttribute("aria-required",e)}_valueChanged(e,t){""===e?this.focusElement.removeAttribute("has-value"):this.focusElement.setAttribute("has-value",""),""===e&&void 0===t||this.validate()}_onKeyDown(e){if(!this.readonly&&!this.opened)if(/^(Enter|SpaceBar|\s|ArrowDown|Down|ArrowUp|Up)$/.test(e.key))e.preventDefault(),this.opened=!0;else if(/[a-zA-Z0-9]/.test(e.key)&&1===e.key.length){const t=this._menuElement.selected,s=void 0!==t?t:-1,i=this._menuElement._searchKey(s,e.key);i>=0&&(this.__userInteraction=!0,this._updateSelectedItem(this._items[i].value,this._items))}}_onKeyDownInside(e){/^(Tab)$/.test(e.key)&&(this.opened=!1)}_openedChanged(e,t){if(e){if(!this._overlayElement||!this._menuElement||!this._toggleElement||!this.focusElement||this.disabled||this.readonly)return void(this.opened=!1);this._openedWithFocusRing=this.hasAttribute("focus-ring")||this.focusElement.hasAttribute("focus-ring"),this._menuElement.focus(),this._setPosition(),window.addEventListener("scroll",this._boundSetPosition,!0)}else t&&(this.focusElement.focus(),this._openedWithFocusRing&&this.focusElement.setAttribute("focus-ring",""),this.validate(),window.removeEventListener("scroll",this._boundSetPosition,!0))}_hasContent(e){return!!e&&Boolean(e.hasAttribute("label")?e.getAttribute("label"):e.textContent.trim()||e.children.length)}_attachSelectedItem(e){if(!e)return;let t;e.hasAttribute("label")?(t=document.createElement("vaadin-item"),t.textContent=e.getAttribute("label")):t=e.cloneNode(!0),t._sourceItem=e,t.removeAttribute("tabindex"),t.removeAttribute("role"),this._valueElement.appendChild(t),t.selected=!0}_updateAriaExpanded(e,t,s){t&&t.setAttribute("aria-expanded",e),s&&s.focusElement&&s.focusElement.setAttribute("aria-expanded",e)}_updateValueSlot(){this.opened=!1,this._valueElement.innerHTML="";const e=this._items[this._menuElement.selected],t=this._hasContent(e),s=this._inputElement.shadowRoot.querySelector('slot[name="input"]')?"input":"value";this._valueElement.slot=t?s:"",t&&window.ShadyDOM&&window.ShadyDOM.flush(),this._attachSelectedItem(e),!this._valueChanging&&e&&(this._selectedChanging=!0,this.value=e.value||"",this.__userInteraction&&(this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this.__userInteraction=!1),delete this._selectedChanging)}_updateSelectedItem(e,t){t&&(this._menuElement.selected=t.reduce(((t,s,i)=>void 0===t&&s.value===e?i:t),void 0),this._selectedChanging||(this._valueChanging=!0,this._updateValueSlot(),delete this._valueChanging))}_setFocused(e){super._setFocused(this.opened||e),this.focusElement._setFocused(this.hasAttribute("focused")),!this.hasAttribute("focused")&&this.validate()}_setPosition(){const e=this._inputElement.shadowRoot.querySelector('[part~="input-field"]').getBoundingClientRect(),t=Math.min(window.innerHeight,document.documentElement.clientHeight),s=e.top>(t-e.height)/2;"rtl"===this.getAttribute("dir")?this._overlayElement.style.right=document.documentElement.clientWidth-e.right+"px":this._overlayElement.style.left=e.left+"px",s?(this._overlayElement.setAttribute("bottom-aligned",""),this._overlayElement.style.removeProperty("top"),this._overlayElement.style.bottom=t-e.bottom+"px"):(this._overlayElement.removeAttribute("bottom-aligned"),this._overlayElement.style.removeProperty("bottom"),this._overlayElement.style.top=e.top+"px"),this._overlayElement.updateStyles({"--vaadin-select-text-field-width":e.width+"px"})}validate(){return!(this.invalid=!(this.disabled||!this.required||this.value))}}customElements.define(Q.is,Q);let D,q,O=e=>e;p("vaadin-list-box",_(D||(D=O`
305
- [part='items'] ::slotted(vaadin-item.dropdown-divisor){
306
- color:var(--lumo-contrast-40pct);
307
- box-shadow:0 1px var(--lumo-contrast-10pct);
308
- border-radius:0;
309
- }
310
-
311
- [part='items'] ::slotted(vaadin-item.dropdown-sub-item){
312
- margin-left:var(--lumo-space-l);
313
- }
314
- `)));class $ extends y{constructor(){super(),this.disabled=!1,this.label="",this.value=null,this.items=null,this.getText=e=>e,this.__unexistentValue=`@foxy.io/elements#dropdown-${Math.random().toFixed(16).substr(2)}`,this.__renderedItems={},this.__list=document.createElement("vaadin-list-box")}static get properties(){return e(e({},super.properties),{},{disabled:{type:Boolean},getText:{type:Object,attribute:!1},items:{type:Array},label:{type:String},value:{type:String}})}static get styles(){return g.styles}render(){return b(q||(q=O` <vaadin-select class="w-full ${0}" data-testid="select" .label="${0}" .value="${0}" .disabled="${0}" .renderer="${0}" @change="${0}"> </vaadin-select> `),this.label?"-mt-m":"",this.label,null===this.value?this.__unexistentValue:this.value,this.disabled,this.__renderItems.bind(this),this.__handleChange)}__renderItems(e){var t;let s=e.querySelector("vaadin-list-box");null===s&&(e.appendChild(this.__list),s=this.__list);for(const e of Object.values(this.__renderedItems))e.dataset.keep="";const i=null!==(t=this.items)&&void 0!==t?t:[];for(let e=0;e<i.length;++e)if("string"==typeof i[e])this.__addOrKeepItem(i[e],i[e],s).classList.add("dropdown-item");else if(Array.isArray(i[e])){const t=this.__addOrKeepItem(i[e][0],i[e][0],s);t.classList.add("dropdown-item","dropdown-divisor"),t.disabled=!0;for(const t of i[e][1])this.__addOrKeepItem(i[e][0]+": "+t,t,s).classList.add("dropdown-sub-item")}for(const e of Object.values(this.__renderedItems)){const t=e;t.dataset.keep||(e.remove(),delete this.__renderedItems[t.dataset.trackId])}}__addOrKeepItem(e,t,s){let i;return this.__renderedItems[e]?i=this.__renderedItems[e]:(i=document.createElement("vaadin-item"),this.__renderedItems[e]=i,i.value=e,s.appendChild(i)),i.dataset.keep="true",i.dataset.trackId=e,i.textContent=this.getText(t),i}__handleChange(e){const t=e.target.value,s=t===this.__unexistentValue?null:t;this.dispatchEvent(new f(s))}}let P,j,H=e=>e;class V extends y{constructor(){super(...arguments),this.variant=null}static get styles(){return[g.styles,_(P||(P=H`@keyframes blink{from{opacity:.5}to{opacity:1}}.animated{animation:blink .5s infinite alternate}:host{display:inline-block;min-width:4rem}`))]}static get properties(){return e(e({},super.properties),{},{variant:{type:String}})}render(){const e="error"===this.variant?"bg-error-10":"bg-contrast-10",t=null===this.variant?"animated":"";return b(j||(j=H` <div class="relative"> <span class="opacity-0"><slot></slot></span> <div class="${0} ${0} rounded my-xs absolute inset-0"></div> </div> `),e,t)}}let N,z,K,F=e=>e;class G extends v{constructor(){super(...arguments),this.key=""}static get scopedElements(){return{"x-skeleton":V}}static get properties(){return e(e({},super.properties),{},{key:{type:String,reflect:!0},opts:{type:Object}})}static get styles(){return[super.styles,_(N||(N=F`:host{display:inline-block}`))]}get whenReady(){return this._whenI18nReady.then((()=>this.updateComplete))}render(){return this._isI18nReady?b(z||(z=F`${0}<slot></slot>`),this._t(this.key,this.opts)):b(K||(K=F`<x-skeleton class="block">${0}<slot></slot></x-skeleton>`),this.key)}}function W(...e){return e.filter((e=>!!e))}let U,Y,J,Z,X=e=>e;class ee extends v{constructor(){super(...arguments),this.disabled=!1,this.value=[]}static get scopedElements(){return{"x-i18n":G}}static get properties(){return e(e({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=ee._allDays.map((e=>{try{return e.toLocaleString(this.lang,{minimumIntegerDigits:2})}catch(t){return e.toString()}}));return b(U||(U=X` <div class="space-y-s"> <div class="flex flex-wrap -mx-xs -mb-xs" style="max-width:364px;font-feature-settings:'tnum' 1"> ${0} </div> ${0} </div> `),ee._allDays.map(((t,s)=>b(Y||(Y=X` <label class="${0}"> ${0} <input type="checkbox" class="sr-only" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> `),this._getLabelClass(t),e[s],this.disabled,this.value.includes(t),(e=>this._handleChange(e,t))))),W(this.value.length>0&&b(J||(J=X` <p class="text-s text-tertiary leading-s"> <x-i18n key="monthday-picker.hint" .opts="${0}" .lang="${0}"> </x-i18n> ${0} </p> `),{days:this.value},this.lang,W([29,30,31].some((e=>this.value.includes(e)))&&b(Z||(Z=X`<x-i18n key="monthday-picker.warning" .lang="${0}"></x-i18n>`),this.lang)))))}_getLabelClass(e){let t="flex items-center justify-center m-xs p-s rounded text-m font-medium transition duration-200 sm-p-0 sm-h-m sm-w-l ";return this.value.includes(e)||(t+="bg-contrast-5 "),this._isI18nReady&&!this.disabled?(t+="cursor-pointer ",t+=this.value.includes(e)?"text-base ":"hover-bg-primary-10 ",e<29?(t+="focus-within-shadow-outline ",t+=this.value.includes(e)?"bg-primary":"text-body"):(t+="focus-within-shadow-outline-error ",t+=this.value.includes(e)?"bg-error":"text-error")):(t+="text-transparent ",this.value.includes(e)&&(t+=e<29?"bg-primary-50":"bg-error-10")),t}_handleChange(e,t){e.stopPropagation(),this._toggle(t),this._sendChange()}_sendChange(){this.dispatchEvent(new x(this.value))}_toggle(e){const t=this.value.indexOf(e);this.value=-1===t?[...this.value,e]:this.value.filter(((e,s)=>s!==t))}}ee._allDays=Array.from(new Array(31),((e,t)=>t+1));const te=document.createElement("template");function se(e,t,s="long"){const i=new Date;for(;i.getDay()!==e;)i.setDate(i.getDate()+1);return i.toLocaleDateString(t,{weekday:s})}te.innerHTML='<dom-module id="lumo-badge">\n <template>\n <style>\n [theme~="badge"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n padding: 0.4em calc(0.5em + var(--lumo-border-radius-s) / 4);\n color: var(--lumo-primary-text-color);\n background-color: var(--lumo-primary-color-10pct);\n border-radius: var(--lumo-border-radius-s);\n font-family: var(--lumo-font-family);\n font-size: var(--lumo-font-size-s);\n line-height: 1;\n font-weight: 500;\n text-transform: initial;\n letter-spacing: initial;\n min-width: calc(var(--lumo-line-height-xs) * 1em + 0.45em);\n }\n\n /* Ensure proper vertical alignment */\n [theme~="badge"]::before {\n display: inline-block;\n content: "\\2003";\n width: 0;\n }\n\n [theme~="badge"][theme~="small"] {\n font-size: var(--lumo-font-size-xxs);\n line-height: 1;\n }\n\n /* Colors */\n\n [theme~="badge"][theme~="success"] {\n color: var(--lumo-success-text-color);\n background-color: var(--lumo-success-color-10pct);\n }\n\n [theme~="badge"][theme~="error"] {\n color: var(--lumo-error-text-color);\n background-color: var(--lumo-error-color-10pct);\n }\n\n [theme~="badge"][theme~="contrast"] {\n color: var(--lumo-contrast-80pct);\n background-color: var(--lumo-contrast-5pct);\n }\n\n /* Primary */\n\n [theme~="badge"][theme~="primary"] {\n color: var(--lumo-primary-contrast-color);\n background-color: var(--lumo-primary-color);\n }\n\n [theme~="badge"][theme~="success"][theme~="primary"] {\n color: var(--lumo-success-contrast-color);\n background-color: var(--lumo-success-color);\n }\n\n [theme~="badge"][theme~="error"][theme~="primary"] {\n color: var(--lumo-error-contrast-color);\n background-color: var(--lumo-error-color);\n }\n\n [theme~="badge"][theme~="contrast"][theme~="primary"] {\n color: var(--lumo-base-color);\n background-color: var(--lumo-contrast);\n }\n\n /* Links */\n\n [theme~="badge"][href]:hover {\n text-decoration: none;\n }\n\n /* Icon */\n\n [theme~="badge"] iron-icon {\n margin: -0.25em 0;\n --iron-icon-width: 1.5em;\n --iron-icon-height: 1.5em;\n }\n\n [theme~="badge"] iron-icon:first-child {\n margin-left: -0.375em;\n }\n\n [theme~="badge"] iron-icon:last-child {\n margin-right: -0.375em;\n }\n\n [theme~="badge"][icon] {\n min-width: 0;\n padding: 0;\n font-size: 1rem;\n --iron-icon-width: var(--lumo-icon-size-m);\n --iron-icon-height: var(--lumo-icon-size-m);\n }\n\n [theme~="badge"][icon][theme~="small"] {\n --iron-icon-width: var(--lumo-icon-size-s);\n --iron-icon-height: var(--lumo-icon-size-s);\n }\n\n /* Empty */\n\n [theme~="badge"]:not([icon]):empty {\n min-width: 0;\n width: 1em;\n height: 1em;\n padding: 0;\n border-radius: 50%;\n background-color: var(--lumo-primary-color);\n }\n\n [theme~="badge"][theme~="small"]:not([icon]):empty {\n width: 0.75em;\n height: 0.75em;\n }\n\n [theme~="badge"][theme~="contrast"]:not([icon]):empty {\n background-color: var(--lumo-contrast);\n }\n\n [theme~="badge"][theme~="success"]:not([icon]):empty {\n background-color: var(--lumo-success-color);\n }\n\n [theme~="badge"][theme~="error"]:not([icon]):empty {\n background-color: var(--lumo-error-color);\n }\n\n /* Pill */\n\n [theme~="badge"][theme~="pill"] {\n --lumo-border-radius-s: 1em;\n }\n\n /* RTL specific styles */\n\n [dir="rtl"][theme~="badge"] iron-icon:first-child {\n margin-right: -0.375em;\n margin-left: 0;\n }\n\n [dir="rtl"][theme~="badge"] iron-icon:last-child {\n margin-left: -0.375em;\n margin-right: 0;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(te.content);let ie,ne,re,oe=e=>e;class ae extends ee{render(){return b(ie||(ie=oe` <div class="space-y-s"> <div class="flex flex-wrap -mx-xs -mb-xs text-m uppercase"> ${0} </div> ${0} </div> `),ae._allDays.map((e=>b(ne||(ne=oe` <label class="${0}"> ${0} <input type="checkbox" class="sr-only" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> `),this._getLabelClass(e),se(e,this.lang,"short"),this.disabled||!this._isI18nReady,this.value.includes(e),(t=>this._handleChange(t,e))))),W(this.value.length>0&&b(re||(re=oe` <p class="text-s text-tertiary leading-s"> <x-i18n key="weekday-picker.hint" .lang="${0}" .opts="${0}"> </x-i18n> </p> `),this.lang,{days:this.value})))}_getLabelClass(e){let t="flex items-center justify-center m-xs h-m w-xl rounded font-medium transition duration-200 ";return this._isI18nReady&&!this.disabled?(t+="cursor-pointer focus-within-shadow-outline ",t+=this.value.includes(e)?"text-base bg-primary":"bg-contrast-5 hover-bg-contrast-10 text-body"):(t+="text-transparent ",t+=this.value.includes(e)?"bg-primary-50":"bg-contrast-5"),t}_sendChange(){this.dispatchEvent(new w(this.value))}}ae._allDays=new Array(7).fill(0).map(((e,t)=>t));export{$ as D,G as I,ee as M,V as S,ae as W,Q as a,W as c,se as t};
304
+ `}static get is(){return"vaadin-select"}static get version(){return"2.4.3"}static get properties(){return{opened:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0,observer:"_openedChanged"},renderer:Function,errorMessage:{type:String,value:""},label:{type:String},value:{type:String,value:"",notify:!0,observer:"_valueChanged"},required:{type:Boolean,reflectToAttribute:!0,observer:"_requiredChanged"},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},name:{type:String,reflectToAttribute:!0},placeholder:{type:String},helperText:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},_phone:Boolean,_phoneMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},_overlayElement:Object,_inputElement:Object,_toggleElement:Object,_items:Object,_contentTemplate:Object,_oldTemplate:Object,_oldRenderer:Object}}static get observers(){return["_updateSelectedItem(value, _items)","_updateAriaExpanded(opened, _toggleElement, _inputElement)","_templateOrRendererChanged(_contentTemplate, renderer, _overlayElement)"]}constructor(){super(),this._boundSetPosition=this._setPosition.bind(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("iron-resize",this._boundSetPosition)}ready(){super.ready(),this._overlayElement=this.shadowRoot.querySelector("vaadin-select-overlay"),this._valueElement=this.shadowRoot.querySelector('[part="value"]'),this._toggleElement=this.shadowRoot.querySelector('[part="toggle-button"]'),this._nativeInput=this.focusElement.shadowRoot.querySelector("input"),this._nativeInput.setAttribute("aria-hidden",!0),this._nativeInput.setAttribute("tabindex",-1),this._nativeInput.style.pointerEvents="none",this.focusElement.addEventListener("click",(e=>{const t=Array.from(e.composedPath()).some((e=>e.nodeType===Node.ELEMENT_NODE&&"helper"===e.getAttribute("slot")));this.opened=!this.readonly&&!t})),this.focusElement.addEventListener("keydown",(e=>this._onKeyDown(e))),this._observer=new h(this,(e=>this._setTemplateFromNodes(e.addedNodes))),this._observer.flush()}_setTemplateFromNodes(e){const t=Array.from(e).filter((e=>e.localName&&"template"===e.localName))[0]||this._contentTemplate;this._overlayElement.template=this._contentTemplate=t,this._setForwardHostProps()}_setForwardHostProps(){if(this._overlayElement.content){const e=this._overlayElement._instance&&this._overlayElement._instance.forwardHostProp;this._overlayElement._instance&&(this._overlayElement._instance.forwardHostProp=(...t)=>{e.apply(this._overlayElement._instance,t),setTimeout((()=>{this._updateValueSlot()}))},this._assignMenuElement())}}render(){this._overlayElement&&(this._overlayElement.render(),this._menuElement&&this._menuElement.items&&this._updateSelectedItem(this.value,this._menuElement.items))}_removeNewRendererOrTemplate(e,t,i,s){e!==t?this._contentTemplate=void 0:i!==s&&(this.renderer=void 0)}_templateOrRendererChanged(e,t,i){if(i){if(e&&t)throw this._removeNewRendererOrTemplate(e,this._oldTemplate,t,this._oldRenderer),new Error("You should only use either a renderer or a template for select content");this._oldTemplate=e,this._oldRenderer=t,t&&(i.setProperties({owner:this,renderer:t}),this.render(),i.content.firstChild&&this._assignMenuElement())}}_assignMenuElement(){this._menuElement=Array.from(this._overlayElement.content.children).filter((e=>"style"!==e.localName))[0],this._menuElement&&(this._menuElement.addEventListener("items-changed",(e=>{this._items=this._menuElement.items,this._items.forEach((e=>e.setAttribute("role","option")))})),this._menuElement.addEventListener("selected-changed",(e=>this._updateValueSlot())),this._menuElement.addEventListener("keydown",(e=>this._onKeyDownInside(e))),this._menuElement.addEventListener("click",(e=>{this.__userInteraction=!0,this.opened=!1}),!0),this._menuElement.setAttribute("role","listbox"))}get focusElement(){return this._inputElement||(this._inputElement=this.shadowRoot.querySelector("vaadin-select-text-field"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("iron-resize",this._boundSetPosition),this.opened=!1}notifyResize(){super.notifyResize(),this.positionTarget&&this.opened&&(this._setPosition(),requestAnimationFrame(this._setPosition.bind(this)))}_requiredChanged(e){this.setAttribute("aria-required",e)}_valueChanged(e,t){""===e?this.focusElement.removeAttribute("has-value"):this.focusElement.setAttribute("has-value",""),""===e&&void 0===t||this.validate()}_onKeyDown(e){if(!this.readonly&&!this.opened)if(/^(Enter|SpaceBar|\s|ArrowDown|Down|ArrowUp|Up)$/.test(e.key))e.preventDefault(),this.opened=!0;else if(/[a-zA-Z0-9]/.test(e.key)&&1===e.key.length){const t=this._menuElement.selected,i=void 0!==t?t:-1,s=this._menuElement._searchKey(i,e.key);s>=0&&(this.__userInteraction=!0,this._updateSelectedItem(this._items[s].value,this._items))}}_onKeyDownInside(e){/^(Tab)$/.test(e.key)&&(this.opened=!1)}_openedChanged(e,t){if(e){if(!this._overlayElement||!this._menuElement||!this._toggleElement||!this.focusElement||this.disabled||this.readonly)return void(this.opened=!1);this._openedWithFocusRing=this.hasAttribute("focus-ring")||this.focusElement.hasAttribute("focus-ring"),this._menuElement.focus(),this._setPosition(),window.addEventListener("scroll",this._boundSetPosition,!0)}else t&&(this.focusElement.focus(),this._openedWithFocusRing&&this.focusElement.setAttribute("focus-ring",""),this.validate(),window.removeEventListener("scroll",this._boundSetPosition,!0))}_hasContent(e){return!!e&&Boolean(e.hasAttribute("label")?e.getAttribute("label"):e.textContent.trim()||e.children.length)}_attachSelectedItem(e){if(!e)return;let t;e.hasAttribute("label")?(t=document.createElement("vaadin-item"),t.textContent=e.getAttribute("label")):t=e.cloneNode(!0),t._sourceItem=e,t.removeAttribute("tabindex"),t.removeAttribute("role"),this._valueElement.appendChild(t),t.selected=!0}_updateAriaExpanded(e,t,i){t&&t.setAttribute("aria-expanded",e),i&&i.focusElement&&i.focusElement.setAttribute("aria-expanded",e)}_updateValueSlot(){this.opened=!1,this._valueElement.innerHTML="";const e=this._items[this._menuElement.selected],t=this._hasContent(e),i=this._inputElement.shadowRoot.querySelector('slot[name="input"]')?"input":"value";this._valueElement.slot=t?i:"",t&&window.ShadyDOM&&window.ShadyDOM.flush(),this._attachSelectedItem(e),!this._valueChanging&&e&&(this._selectedChanging=!0,this.value=e.value||"",this.__userInteraction&&(this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this.__userInteraction=!1),delete this._selectedChanging)}_updateSelectedItem(e,t){t&&(this._menuElement.selected=t.reduce(((t,i,s)=>void 0===t&&i.value===e?s:t),void 0),this._selectedChanging||(this._valueChanging=!0,this._updateValueSlot(),delete this._valueChanging))}_setFocused(e){super._setFocused(this.opened||e),this.focusElement._setFocused(this.hasAttribute("focused")),!this.hasAttribute("focused")&&this.validate()}_setPosition(){const e=this._inputElement.shadowRoot.querySelector('[part~="input-field"]').getBoundingClientRect(),t=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.top>(t-e.height)/2;"rtl"===this.getAttribute("dir")?this._overlayElement.style.right=document.documentElement.clientWidth-e.right+"px":this._overlayElement.style.left=e.left+"px",i?(this._overlayElement.setAttribute("bottom-aligned",""),this._overlayElement.style.removeProperty("top"),this._overlayElement.style.bottom=t-e.bottom+"px"):(this._overlayElement.removeAttribute("bottom-aligned"),this._overlayElement.style.removeProperty("bottom"),this._overlayElement.style.top=e.top+"px"),this._overlayElement.updateStyles({"--vaadin-select-text-field-width":e.width+"px"})}validate(){return!(this.invalid=!(this.disabled||!this.required||this.value))}}customElements.define(x.is,x);export{x as S};
@@ -1 +1 @@
1
- import"./foxy-collection-page.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-8ec9793b.js";import{I as e}from"./shared-f4056083.js";import"./shared-44f45339.js";import"./shared-09d39b25.js";import{I as t,_ as r}from"./shared-ca0f14c1.js";import{L as i,h as s}from"./shared-7f33a83a.js";import{T as o}from"./shared-b4865438.js";import{c as n}from"./shared-4e709717.js";let a,l=e=>e;class c extends(o(t(i))){constructor(){super(...arguments),this.summary=null,this.open=!1}static get properties(){return r(r({},super.properties),{},{summary:{type:String},open:{type:Boolean}})}render(){var e;return s(a||(a=l` <details class="w-full border border-contrast-10 rounded-t-l rounded-b-l" ?open="${0}" @toggle="${0}"> <summary class="${0}"> <div class="flex items-center h-m pl-m pr-s"> <div class="flex items-center flex-1"> <foxy-i18n class="flex items-center text-xs tracking-wide uppercase font-bold text-body" infer="" key="${0}"> </foxy-i18n> <slot name="actions"></slot> </div> <iron-icon class="icon-inline text-xl text-body" icon="icons:expand-${0}"> </iron-icon> </div> </summary> <div class="border-t border-contrast-10"> <slot></slot> </div> </details> `),this.open,(e=>{this.open=e.currentTarget.open}),n({"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"transition-colors cursor-pointer hover-bg-contrast-5":!0,"rounded-t-l":!0,"rounded-b-l":!this.open}),null!==(e=this.summary)&&void 0!==e?e:"",this.open?"less":"more")}}customElements.define("foxy-internal-details",c);let d,f,m,h,p=e=>e;customElements.define("foxy-internal-async-details-control",class extends e{constructor(){super(...arguments),this.related=[],this.limit=20,this.first="",this.form="",this.item="",this.open=!1,this.__cachedCardRenderer=null,this.__itemRenderer=e=>{if(!this.form||!e.data)return this.__cardRenderer(e);const t=this.disabledSelector.matches("card",!0);return s(d||(d=p` <button ?disabled="${0}" class="${0}" @click="${0}"> ${0} </button> `),t,n({"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-left w-full block transition-colors":!0,"hover-bg-contrast-5":!t}),(t=>{const r=t.currentTarget,i=this.__dialog;i.header="header_update",i.href=e.href,i.show(r)}),this.__cardRenderer(e))}}static get properties(){return r(r({},super.properties),{},{related:{type:Array},first:{type:String},limit:{type:Number},form:{type:String},item:{type:String},open:{type:Boolean}})}renderControl(){let e;try{const t=new URL(this.first);t.searchParams.set("limit",String(this.limit)),e=t.toString()}catch(t){e=this.first}return s(f||(f=p` <foxy-internal-details summary="title" infer="" ?open="${0}" @toggle="${0}"> ${0} <foxy-pagination class="px-m pb-s" first="${0}" infer="pagination"> <foxy-collection-page class="-mx-m block divide-y divide-contrast-10 mb-s" infer="card" .related="${0}" .item="${0}"> </foxy-collection-page> </foxy-pagination> </foxy-internal-details> `),this.open,(e=>this.open=e.currentTarget.open),this.form?s(m||(m=p` <foxy-form-dialog parent="${0}" infer="dialog" id="form" .related="${0}" .form="${0}"> </foxy-form-dialog> ${0} `),e,this.related,this.form,this.readonly?"":s(h||(h=p` <button class="h-xs w-xs rounded-full text-success flex items-center justify-center text-l focus-outline-none focus-ring-2 focus-ring-primary-50" slot="actions" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline" icon="icons:add"></iron-icon> </button> `),this.disabled,(e=>{e.preventDefault(),e.stopPropagation();const t=this.__dialog,r=e.currentTarget;t.header="header_create",t.href="",t.show(r)}))):"",e,this.related,this.__itemRenderer)}get __dialog(){return this.renderRoot.querySelector("#form")}get __cardRenderer(){var e;return(null===(e=this.__cachedCardRenderer)||void 0===e?void 0:e.item)!==this.item&&(this.__cachedCardRenderer={item:this.item,render:new Function("ctx",`return ctx.html\`<${this.item} related=\${JSON.stringify(ctx.related)} parent=\${ctx.parent} class="p-m" infer href=\${ctx.href}></${this.item}>\``)}),this.__cachedCardRenderer.render}});
1
+ import"./foxy-collection-page.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-c9d1a2cd.js";import{I as e}from"./shared-ff7a10de.js";import"./shared-eb344bd5.js";import"./shared-26502fca.js";import{I as t,_ as r}from"./shared-e34d2ef1.js";import{L as i,h as s}from"./shared-7f33a83a.js";import{T as o}from"./shared-1b38c44f.js";import{c as n}from"./shared-4e709717.js";let a,c=e=>e;class l extends(o(t(i))){constructor(){super(...arguments),this.summary=null,this.open=!1}static get properties(){return r(r({},super.properties),{},{summary:{type:String},open:{type:Boolean}})}render(){var e;return s(a||(a=c` <details class="w-full border border-contrast-10 rounded-t-l rounded-b-l" ?open="${0}" @toggle="${0}"> <summary class="${0}"> <div class="flex items-center h-m pl-m pr-s"> <div class="flex items-center flex-1"> <foxy-i18n class="flex items-center text-xs tracking-wide uppercase font-bold text-body" infer="" key="${0}"> </foxy-i18n> <slot name="actions"></slot> </div> <iron-icon class="icon-inline text-xl text-body" icon="icons:expand-${0}"> </iron-icon> </div> </summary> <div class="border-t border-contrast-10"> <slot></slot> </div> </details> `),this.open,(e=>{this.open=e.currentTarget.open}),n({"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"transition-colors cursor-pointer hover-bg-contrast-5":!0,"rounded-t-l":!0,"rounded-b-l":!this.open}),null!==(e=this.summary)&&void 0!==e?e:"",this.open?"less":"more")}}customElements.define("foxy-internal-details",l);let d,f,m,h,p=e=>e;customElements.define("foxy-internal-async-details-control",class extends e{constructor(){super(...arguments),this.related=[],this.limit=20,this.first="",this.form="",this.item="",this.open=!1,this.__cachedCardRenderer=null,this.__itemRenderer=e=>{if(!this.form||!e.data)return this.__cardRenderer(e);const t=this.disabledSelector.matches("card",!0);return s(d||(d=p` <button ?disabled="${0}" class="${0}" @click="${0}"> ${0} </button> `),t,n({"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-left w-full block transition-colors":!0,"hover-bg-contrast-5":!t}),(t=>{const r=t.currentTarget,i=this.__dialog;i.header="header_update",i.href=e.href,i.show(r)}),this.__cardRenderer(e))}}static get properties(){return r(r({},super.properties),{},{related:{type:Array},first:{type:String},limit:{type:Number},form:{type:String},item:{type:String},open:{type:Boolean}})}renderControl(){let e;try{const t=new URL(this.first);t.searchParams.set("limit",String(this.limit)),e=t.toString()}catch(t){e=this.first}return s(f||(f=p` <foxy-internal-details summary="title" infer="" ?open="${0}" @toggle="${0}"> ${0} <foxy-pagination class="px-m pb-s" first="${0}" infer="pagination"> <foxy-collection-page class="-mx-m block divide-y divide-contrast-10 mb-s" infer="card" .related="${0}" .item="${0}"> </foxy-collection-page> </foxy-pagination> </foxy-internal-details> `),this.open,(e=>this.open=e.currentTarget.open),this.form?s(m||(m=p` <foxy-form-dialog parent="${0}" infer="dialog" id="form" .related="${0}" .form="${0}"> </foxy-form-dialog> ${0} `),e,this.related,this.form,this.readonly?"":s(h||(h=p` <button class="h-xs w-xs rounded-full text-success flex items-center justify-center text-l focus-outline-none focus-ring-2 focus-ring-primary-50" slot="actions" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline" icon="icons:add"></iron-icon> </button> `),this.disabled,(e=>{e.preventDefault(),e.stopPropagation();const t=this.__dialog,r=e.currentTarget;t.header="header_create",t.href="",t.show(r)}))):"",e,this.related,this.__itemRenderer)}get __dialog(){return this.renderRoot.querySelector("#form")}get __cardRenderer(){var e;return(null===(e=this.__cachedCardRenderer)||void 0===e?void 0:e.item)!==this.item&&(this.__cachedCardRenderer={item:this.item,render:new Function("ctx",`return ctx.html\`<${this.item} related=\${JSON.stringify(ctx.related)} parent=\${ctx.parent} class="p-m" infer href=\${ctx.href}></${this.item}>\``)}),this.__cachedCardRenderer.render}});
@@ -1 +1 @@
1
- import{_ as e}from"./shared-ca0f14c1.js";import{h as t}from"./shared-7f33a83a.js";import{B as r}from"./shared-3a7cf739.js";import{i as s}from"./shared-d3bf9ac0.js";let o,i,n=e=>e;const l=l=>class extends l{constructor(){super(...arguments),this.templates={},this.mode="production",this.readonly=!1,this.readonlyControls=r.False,this.disabled=!1,this.disabledControls=r.False,this.hidden=!1,this.hiddenControls=r.False,this.__observer=new MutationObserver((()=>this.__onMutation()))}static get inferredProperties(){return[...super.inferredProperties,"disabledSelector","readonlySelector","hiddenSelector","templates","disabled","readonly","hidden","mode"]}static get properties(){return e(e({},super.properties),{},{templates:{attribute:!1},mode:{type:String},readonly:{type:Boolean,reflect:!0},readonlyControls:{attribute:"readonlycontrols",converter:{fromAttribute:e=>new r(null!=e?e:"")}},disabled:{type:Boolean,reflect:!0},disabledControls:{attribute:"disabledcontrols",converter:{fromAttribute:e=>new r(null!=e?e:"")}},hidden:{type:Boolean,reflect:!0},hiddenControls:{attribute:"hiddencontrols",converter:{fromAttribute:e=>new r(null!=e?e:"")}}})}get readonlySelector(){return this.readonly?r.True:this.readonlyControls}get disabledSelector(){return this.disabled?r.True:this.disabledControls}get hiddenSelector(){return this.hidden?r.True:this.hiddenControls}connectedCallback(){super.connectedCallback(),"development"===this.mode&&this.__observe()}disconnectedCallback(){super.disconnectedCallback(),this.__observer.disconnect()}firstUpdated(...e){super.firstUpdated(...e),"production"===this.mode&&this.compileTemplates()}updated(e){super.updated(e),this.style.display=this.hidden?"none":"",e.has("mode")&&(this.__observer.disconnect(),"development"===this.mode&&this.__observe())}compileTemplates(t=!1){const r=t?{}:e({},this.templates);Array.from(this.children).forEach((e=>{var t;if("template"!==e.localName)return;const s=null!==(t=e.getAttribute("slot"))&&void 0!==t?t:"default";try{const t=`return html\`${e.innerHTML}\``;r[s]=new Function("html","host",t)}catch(e){console.error(e)}})),this.templates=r}renderTemplateOrSlot(e,r){const l=null!=e?e:"default",d=this.templates[l];if(!d)return t(o||(o=n`<slot name="${0}"></slot>`),s(e));return t(i||(i=n` <foxy-internal-sandbox data-testid="${0}" .render="${0}"> </foxy-internal-sandbox> `),l,(()=>{try{const e=null!=r?r:this,s=new Proxy({},{get:(t,r)=>e[r]});return null==d?void 0:d(t,s)}catch(e){console.error(e)}}))}getNestedTemplates(e){const t={};return Object.entries(this.templates).forEach((([r,s])=>{if(r.startsWith(`${e}:`)){const o=r.replace(`${e}:`,"");t[o]=s}})),t}applyInferredProperties(e){if(super.applyInferredProperties(e),null===this.infer)return;const t=e.get("disabledSelector"),s=e.get("disabled"),o=e.get("readonlySelector"),i=e.get("readonly"),n=e.get("hiddenSelector"),l=e.get("hidden"),d=e.get("templates"),a=e.get("mode"),h=r.True.toString(),c=(e,t)=>e.toString()===h||null!=t&&t,u=e=>{var t;return null!==(t=this.infer?null==e?void 0:e.zoom(this.infer):e)&&void 0!==t?t:r.False};this.disabledControls=u(t),this.disabled=c(this.disabledControls,s),this.readonlyControls=u(o),this.readonly=c(this.readonlyControls,i),this.hiddenControls=u(n),this.hidden=c(this.hiddenControls,l),this.templates=null!=d?d:{},this.infer&&(this.templates=this.getNestedTemplates(this.infer)),this.mode=null!=a?a:"production"}__observe(){this.__observer.observe(this,{characterData:!0,attributes:!0,childList:!0,subtree:!0}),this.__onMutation()}__onMutation(){const e={characterData:!0,attributes:!0,childList:!0,subtree:!0};this.__observer.disconnect(),this.__observer.observe(this,e),Array.from(this.children).forEach((t=>{"template"===t.localName&&t.hasAttribute("slot")&&this.__observer.observe(t.content,e)})),this.compileTemplates(!0)}};export{l as C};
1
+ import{_ as e}from"./shared-e34d2ef1.js";import{h as t}from"./shared-7f33a83a.js";import{B as r}from"./shared-86d0d927.js";import{i as s}from"./shared-d3bf9ac0.js";let o,i,n=e=>e;const l=l=>class extends l{constructor(){super(...arguments),this.templates={},this.mode="production",this.readonly=!1,this.readonlyControls=r.False,this.disabled=!1,this.disabledControls=r.False,this.hidden=!1,this.hiddenControls=r.False,this.__observer=new MutationObserver((()=>this.__onMutation()))}static get inferredProperties(){return[...super.inferredProperties,"disabledSelector","readonlySelector","hiddenSelector","templates","disabled","readonly","hidden","mode"]}static get properties(){return e(e({},super.properties),{},{templates:{attribute:!1},mode:{type:String},readonly:{type:Boolean,reflect:!0},readonlyControls:{attribute:"readonlycontrols",converter:{fromAttribute:e=>new r(null!=e?e:"")}},disabled:{type:Boolean,reflect:!0},disabledControls:{attribute:"disabledcontrols",converter:{fromAttribute:e=>new r(null!=e?e:"")}},hidden:{type:Boolean,reflect:!0},hiddenControls:{attribute:"hiddencontrols",converter:{fromAttribute:e=>new r(null!=e?e:"")}}})}get readonlySelector(){return this.readonly?r.True:this.readonlyControls}get disabledSelector(){return this.disabled?r.True:this.disabledControls}get hiddenSelector(){return this.hidden?r.True:this.hiddenControls}connectedCallback(){super.connectedCallback(),"development"===this.mode&&this.__observe()}disconnectedCallback(){super.disconnectedCallback(),this.__observer.disconnect()}firstUpdated(...e){super.firstUpdated(...e),"production"===this.mode&&this.compileTemplates()}updated(e){super.updated(e),this.style.display=this.hidden?"none":"",e.has("mode")&&(this.__observer.disconnect(),"development"===this.mode&&this.__observe())}compileTemplates(t=!1){const r=t?{}:e({},this.templates);Array.from(this.children).forEach((e=>{var t;if("template"!==e.localName)return;const s=null!==(t=e.getAttribute("slot"))&&void 0!==t?t:"default";try{const t=`return html\`${e.innerHTML}\``;r[s]=new Function("html","host",t)}catch(e){console.error(e)}})),this.templates=r}renderTemplateOrSlot(e,r){const l=null!=e?e:"default",d=this.templates[l];if(!d)return t(o||(o=n`<slot name="${0}"></slot>`),s(e));return t(i||(i=n` <foxy-internal-sandbox data-testid="${0}" .render="${0}"> </foxy-internal-sandbox> `),l,(()=>{try{const e=null!=r?r:this,s=new Proxy({},{get:(t,r)=>e[r]});return null==d?void 0:d(t,s)}catch(e){console.error(e)}}))}getNestedTemplates(e){const t={};return Object.entries(this.templates).forEach((([r,s])=>{if(r.startsWith(`${e}:`)){const o=r.replace(`${e}:`,"");t[o]=s}})),t}applyInferredProperties(e){if(super.applyInferredProperties(e),null===this.infer)return;const t=e.get("disabledSelector"),s=e.get("disabled"),o=e.get("readonlySelector"),i=e.get("readonly"),n=e.get("hiddenSelector"),l=e.get("hidden"),d=e.get("templates"),a=e.get("mode"),h=r.True.toString(),c=(e,t)=>e.toString()===h||null!=t&&t,u=e=>{var t;return null!==(t=this.infer?null==e?void 0:e.zoom(this.infer):e)&&void 0!==t?t:r.False};this.disabledControls=u(t),this.disabled=c(this.disabledControls,s),this.readonlyControls=u(o),this.readonly=c(this.readonlyControls,i),this.hiddenControls=u(n),this.hidden=c(this.hiddenControls,l),this.templates=null!=d?d:{},this.infer&&(this.templates=this.getNestedTemplates(this.infer)),this.mode=null!=a?a:"production"}__observe(){this.__observer.observe(this,{characterData:!0,attributes:!0,childList:!0,subtree:!0}),this.__onMutation()}__onMutation(){const e={characterData:!0,attributes:!0,childList:!0,subtree:!0};this.__observer.disconnect(),this.__observer.observe(this,e),Array.from(this.children).forEach((t=>{"template"===t.localName&&t.hasAttribute("slot")&&this.__observer.observe(t.content,e)})),this.compileTemplates(!0)}};export{l as C};
@@ -1 +1 @@
1
- import{I as e,_ as t}from"./shared-ca0f14c1.js";import{L as s}from"./shared-7f33a83a.js";import{t as r,m as i,a as n,b as o,R as h,F as a}from"./shared-3a7cf739.js";import{A as u}from"./shared-9b392ba8.js";import{U as _}from"./shared-7684cb05.js";import{i as d}from"./shared-4c0520f6.js";function c(e,t){let s=null;return r(t).forEach((function(){var t,r,i,n,o,h,a,u,_,d,c;if(null===(i=null===(r=null===(t=this.node)||void 0===t?void 0:t._links)||void 0===r?void 0:r.self)||void 0===i?void 0:i.href){const t=null===(h=null===(o=null===(n=this.node)||void 0===n?void 0:n._links)||void 0===o?void 0:o.self)||void 0===h?void 0:h.href,r=new URL(null===(_=null===(u=null===(a=this.node)||void 0===a?void 0:a._links)||void 0===u?void 0:u.self)||void 0===_?void 0:_.href);if(r.searchParams.delete("zoom"),e===t||e===r.toString())return s=JSON.stringify(this.node),void this.stop()}Object.entries(null!==(c=null===(d=this.node)||void 0===d?void 0:d._links)&&void 0!==c?c:{}).some((([t,r])=>{var i,n;if(r.href!==e)return!1;const o=null===(n=null===(i=this.node)||void 0===i?void 0:i._embedded)||void 0===n?void 0:n[t];if(!o||!Array.isArray(o))return!1;const h=o.length<20?o.length:21,a=new URL(e),u=new URL(e);return a.searchParams.set("offset",o.length.toString()),u.searchParams.set("offset",h.toString()),s=JSON.stringify({returned_items:o.length,total_items:h,offset:0,limit:20,_embedded:{[t]:o},_links:{curies:this.node._links.curies,first:{href:e},last:{href:u.toString()},prev:{href:e},next:{href:a.toString()},self:{href:e}}}),this.stop(),!0}))})),new Response(s,{status:s?200:404})}class l extends(e(s)){constructor(){super(),this.lang="",this.parent="",this.related=[],this.__href="",this.__group="",this.__fetchEventQueue=[],this.__service=d(n.withConfig({services:{sendDelete:()=>this._sendDelete(),sendPatch:({edits:e})=>this._sendPatch(e),sendPost:({edits:e})=>this._sendPost(e),sendGet:()=>this._sendGet()},actions:{validate:o({errors:e=>{const s=this.constructor.v8n,r=t(t({},e.data),e.edits);return s.map((e=>e(r))).filter((e=>"string"==typeof e)).filter(((e,t,s)=>s.indexOf(e)===t))}})}})),this.__createService()}static get inferredProperties(){return[...super.inferredProperties,"group","lang"]}static get properties(){return{__state:{type:String,reflect:!0,attribute:"state"},related:{type:Array},parent:{type:String},group:{type:String,noAccessor:!0},href:{type:String,noAccessor:!0},lang:{type:String}}}static get v8n(){return[]}get failure(){return this.__service.state.context.failure}get errors(){return this.__service.state.context.errors}get form(){const{data:e,edits:s}=this.__service.state.context;return t(t({},e),s)}get data(){return this.__service.state.context.data}set data(e){var t;this.__service.send({type:"SET_DATA",data:e}),this.__href=null!==(t=null==e?void 0:e._links.self.href)&&void 0!==t?t:""}get group(){return this.__group}set group(e){this.__group=e,this.__destroyRumour(),this.__createRumour()}get href(){return this.__href}set href(e){this.__href=e,e?this.__service.send({type:"FETCH"}):this.__service.send({type:"SET_DATA",data:null})}in(e){return this.__service.state.matches(e)}undo(){this.__service.send({type:"UNDO"})}edit(e){this.__service.send({type:"EDIT",data:e})}submit(){this.__service.send({type:"SUBMIT"})}delete(){this.__service.send({type:"DELETE"})}refresh(){this.__service.send({type:"REFRESH"})}connectedCallback(){super.connectedCallback(),this.href&&this.refresh(),this.__createRumour(),this.__createServer(),this.__processFetchEventQueue()}disconnectedCallback(){super.disconnectedCallback(),this.__destroyRumour(),this.__destroyServer(),this.__flushFetchEventQueue("parent element was disconnected")}applyInferredProperties(e){var t,s;super.applyInferredProperties(e),null!==this.infer&&(this.group=null!==(t=e.get("group"))&&void 0!==t?t:"",this.lang=null!==(s=e.get("lang"))&&void 0!==s?s:"")}async _fetch(...e){const t=await new u(this).fetch(...e);if(!t.ok)throw t;return t.json()}async _sendPost(e){this.__destroyRumour();const t=JSON.stringify(e),s=await this._fetch(this.parent,{body:t,method:"POST"}),r=l.Rumour(this.group),i=[...this.related,this.parent];return r.share({data:s,related:i,source:s._links.self.href}),this.__createRumour(),s}async _sendGet(){this.__destroyRumour();const e=await this._fetch(this.href);return l.Rumour(this.group).share({data:e,source:this.href}),this.__createRumour(),e}async _sendPatch(e){this.__destroyRumour();const t=JSON.stringify(e),s=await this._fetch(this.href,{body:t,method:"PATCH"});return l.Rumour(this.group).share({data:s,source:this.href,related:this.related}),this.__createRumour(),s}async _sendDelete(){this.__destroyRumour();const e=await this._fetch(this.href,{method:"DELETE"}),t=l.Rumour(this.group),s=[...this.related,this.parent];return t.share({data:null,source:this.href,related:s}),this.__createRumour(),e}get __state(){const e=this.__service.state.toStrings().reduce(((e,t)=>[...e,...t.split(".")]),[]);return[...new Set(e)].join(" ")}__createService(){this.__service.onTransition((e=>{e.changed&&(this.requestUpdate(),this.dispatchEvent(new _),e.matches("busy")||this.__processFetchEventQueue())})),this.__service.onChange((()=>{this.requestUpdate(),this.dispatchEvent(new _)})),this.__service.start()}__createRumour(){const e=l.Rumour(this.group);this.__unsubscribeFromRumour=e.track((e=>this.__handleRumourUpdate(e)))}__destroyRumour(){var e;null===(e=this.__unsubscribeFromRumour)||void 0===e||e.call(this)}__createServer(){this.__fetchEventHandler=this.__handleFetchEvent.bind(this),this.addEventListener("fetch",this.__fetchEventHandler)}__destroyServer(){this.removeEventListener("fetch",this.__fetchEventHandler)}__handleRumourUpdate(e){var t;try{const s=null===(t=this.__service.state)||void 0===t?void 0:t.context.data;if(!s)return;const r=e(s);r!==s&&this.__service.send({data:r,type:"SET_DATA"})}catch(e){if(!(e instanceof h.UpdateError))throw e;this.__service.send({type:"REFRESH"})}}__processFetchEventQueue(){const e=new l.API(this);this.__fetchEventQueue.forEach((t=>{const s=t.request,r=c(s.url,this.data),i=r.ok?r:e.fetch(s);t.respondWith(Promise.resolve(i)),r.ok&&console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${s.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;","")})),this.__fetchEventQueue=[]}__flushFetchEventQueue(e){this.__fetchEventQueue.forEach((t=>{t.respondWith(Promise.reject(new Error(e)))})),this.__fetchEventQueue=[]}__handleFetchEvent(e){e instanceof a&&(e.defaultPrevented||"GET"===e.request.method&&(e.request.url.startsWith("foxy://")||e.composedPath()[0]!==this&&(e.preventDefault(),this.__fetchEventQueue.push(e),this.in("busy")||this.__processFetchEventQueue())))}}l.UpdateEvent=_,l.Rumour=i((()=>new h)),l.API=u;export{l as N,c as s};
1
+ import{I as e,_ as t}from"./shared-e34d2ef1.js";import{L as s}from"./shared-7f33a83a.js";import{t as r,m as i,a as n,b as o,R as h,F as a}from"./shared-86d0d927.js";import{A as u}from"./shared-565feb2f.js";import{U as _}from"./shared-7684cb05.js";import{i as d}from"./shared-bfca826a.js";function c(e,t){let s=null;return r(t).forEach((function(){var t,r,i,n,o,h,a,u,_,d,c;if(null===(i=null===(r=null===(t=this.node)||void 0===t?void 0:t._links)||void 0===r?void 0:r.self)||void 0===i?void 0:i.href){const t=null===(h=null===(o=null===(n=this.node)||void 0===n?void 0:n._links)||void 0===o?void 0:o.self)||void 0===h?void 0:h.href,r=new URL(null===(_=null===(u=null===(a=this.node)||void 0===a?void 0:a._links)||void 0===u?void 0:u.self)||void 0===_?void 0:_.href);if(r.searchParams.delete("zoom"),e===t||e===r.toString())return s=JSON.stringify(this.node),void this.stop()}Object.entries(null!==(c=null===(d=this.node)||void 0===d?void 0:d._links)&&void 0!==c?c:{}).some((([t,r])=>{var i,n;if(r.href!==e)return!1;const o=null===(n=null===(i=this.node)||void 0===i?void 0:i._embedded)||void 0===n?void 0:n[t];if(!o||!Array.isArray(o))return!1;const h=o.length<20?o.length:21,a=new URL(e),u=new URL(e);return a.searchParams.set("offset",o.length.toString()),u.searchParams.set("offset",h.toString()),s=JSON.stringify({returned_items:o.length,total_items:h,offset:0,limit:20,_embedded:{[t]:o},_links:{curies:this.node._links.curies,first:{href:e},last:{href:u.toString()},prev:{href:e},next:{href:a.toString()},self:{href:e}}}),this.stop(),!0}))})),new Response(s,{status:s?200:404})}class l extends(e(s)){constructor(){super(),this.lang="",this.parent="",this.related=[],this.__href="",this.__group="",this.__fetchEventQueue=[],this.__service=d(n.withConfig({services:{sendDelete:()=>this._sendDelete(),sendPatch:({edits:e})=>this._sendPatch(e),sendPost:({edits:e})=>this._sendPost(e),sendGet:()=>this._sendGet()},actions:{validate:o({errors:e=>{const s=this.constructor.v8n,r=t(t({},e.data),e.edits);return s.map((e=>e(r))).filter((e=>"string"==typeof e)).filter(((e,t,s)=>s.indexOf(e)===t))}})}})),this.__createService()}static get inferredProperties(){return[...super.inferredProperties,"group","lang"]}static get properties(){return{__state:{type:String,reflect:!0,attribute:"state"},related:{type:Array},parent:{type:String},group:{type:String,noAccessor:!0},href:{type:String,noAccessor:!0},lang:{type:String}}}static get v8n(){return[]}get failure(){return this.__service.state.context.failure}get errors(){return this.__service.state.context.errors}get form(){const{data:e,edits:s}=this.__service.state.context;return t(t({},e),s)}get data(){return this.__service.state.context.data}set data(e){var t;this.__service.send({type:"SET_DATA",data:e}),this.__href=null!==(t=null==e?void 0:e._links.self.href)&&void 0!==t?t:""}get group(){return this.__group}set group(e){this.__group=e,this.__destroyRumour(),this.__createRumour()}get href(){return this.__href}set href(e){this.__href=e,e?this.__service.send({type:"FETCH"}):this.__service.send({type:"SET_DATA",data:null})}in(e){return this.__service.state.matches(e)}undo(){this.__service.send({type:"UNDO"})}edit(e){this.__service.send({type:"EDIT",data:e})}submit(){this.__service.send({type:"SUBMIT"})}delete(){this.__service.send({type:"DELETE"})}refresh(){this.__service.send({type:"REFRESH"})}connectedCallback(){super.connectedCallback(),this.href&&this.refresh(),this.__createRumour(),this.__createServer(),this.__processFetchEventQueue()}disconnectedCallback(){super.disconnectedCallback(),this.__destroyRumour(),this.__destroyServer(),this.__flushFetchEventQueue("parent element was disconnected")}applyInferredProperties(e){var t,s;super.applyInferredProperties(e),null!==this.infer&&(this.group=null!==(t=e.get("group"))&&void 0!==t?t:"",this.lang=null!==(s=e.get("lang"))&&void 0!==s?s:"")}async _fetch(...e){const t=await new u(this).fetch(...e);if(!t.ok)throw t;return t.json()}async _sendPost(e){this.__destroyRumour();const t=JSON.stringify(e),s=await this._fetch(this.parent,{body:t,method:"POST"}),r=l.Rumour(this.group),i=[...this.related,this.parent];return r.share({data:s,related:i,source:s._links.self.href}),this.__createRumour(),s}async _sendGet(){this.__destroyRumour();const e=await this._fetch(this.href);return l.Rumour(this.group).share({data:e,source:this.href}),this.__createRumour(),e}async _sendPatch(e){this.__destroyRumour();const t=JSON.stringify(e),s=await this._fetch(this.href,{body:t,method:"PATCH"});return l.Rumour(this.group).share({data:s,source:this.href,related:this.related}),this.__createRumour(),s}async _sendDelete(){this.__destroyRumour();const e=await this._fetch(this.href,{method:"DELETE"}),t=l.Rumour(this.group),s=[...this.related,this.parent];return t.share({data:null,source:this.href,related:s}),this.__createRumour(),e}get __state(){const e=this.__service.state.toStrings().reduce(((e,t)=>[...e,...t.split(".")]),[]);return[...new Set(e)].join(" ")}__createService(){this.__service.onTransition((e=>{e.changed&&(this.requestUpdate(),this.dispatchEvent(new _),e.matches("busy")||this.__processFetchEventQueue())})),this.__service.onChange((()=>{this.requestUpdate(),this.dispatchEvent(new _)})),this.__service.start()}__createRumour(){const e=l.Rumour(this.group);this.__unsubscribeFromRumour=e.track((e=>this.__handleRumourUpdate(e)))}__destroyRumour(){var e;null===(e=this.__unsubscribeFromRumour)||void 0===e||e.call(this)}__createServer(){this.__fetchEventHandler=this.__handleFetchEvent.bind(this),this.addEventListener("fetch",this.__fetchEventHandler)}__destroyServer(){this.removeEventListener("fetch",this.__fetchEventHandler)}__handleRumourUpdate(e){var t;try{const s=null===(t=this.__service.state)||void 0===t?void 0:t.context.data;if(!s)return;const r=e(s);r!==s&&this.__service.send({data:r,type:"SET_DATA"})}catch(e){if(!(e instanceof h.UpdateError))throw e;this.__service.send({type:"REFRESH"})}}__processFetchEventQueue(){const e=new l.API(this);this.__fetchEventQueue.forEach((t=>{const s=t.request,r=c(s.url,this.data),i=r.ok?r:e.fetch(s);t.respondWith(Promise.resolve(i)),r.ok&&console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${s.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;","")})),this.__fetchEventQueue=[]}__flushFetchEventQueue(e){this.__fetchEventQueue.forEach((t=>{t.respondWith(Promise.reject(new Error(e)))})),this.__fetchEventQueue=[]}__handleFetchEvent(e){e instanceof a&&(e.defaultPrevented||"GET"===e.request.method&&(e.request.url.startsWith("foxy://")||e.composedPath()[0]!==this&&(e.preventDefault(),this.__fetchEventQueue.push(e),this.in("busy")||this.__processFetchEventQueue())))}}l.UpdateEvent=_,l.Rumour=i((()=>new h)),l.API=u;export{l as N,c as s};
@@ -1,4 +1,4 @@
1
- import{S as t,i as e,e as n,f as r,r as i,h as o,j as a,c as s,a as c,g as u,d as l}from"./shared-ca0f14c1.js";class f extends Event{constructor(t,e){super(t,e),this.request=e.request,this.__reject=e.reject,this.__resolve=e.resolve}respondWith(t){this.preventDefault(),this.stopImmediatePropagation(),t.then(this.__resolve).catch(this.__reject)}}
1
+ import{S as t,i as e,a as n,f as r,r as i,h as o,j as a,c as s,b as c,g as u,e as l}from"./shared-e34d2ef1.js";class f extends Event{constructor(t,e){super(t,e),this.request=e.request,this.__reject=e.reject,this.__resolve=e.resolve}respondWith(t){this.preventDefault(),this.stopImmediatePropagation(),t.then(this.__resolve).catch(this.__reject)}}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -1 +1 @@
1
- import"./shared-8ec9793b.js";import{I as e}from"./shared-f4056083.js";import{h as t,c as i}from"./shared-7f33a83a.js";import{Q as n}from"./shared-3a7cf739.js";import"./shared-cbb340fa.js";import{_ as r}from"./shared-ca0f14c1.js";import"./shared-977dcc25.js";import"./foxy-spinner.js";import{C as s}from"./shared-240700a9.js";import{T as a}from"./shared-b4865438.js";import{N as o}from"./shared-d4d44ca4.js";import{c as l}from"./shared-4e709717.js";let d,c=e=>e;customElements.define("foxy-internal-delete-control",class extends e{constructor(){super(...arguments),this.theme="primary error"}static get properties(){return r(r({},super.properties),{},{theme:{type:String}})}renderControl(){return t(d||(d=c` <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" infer="" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button data-testid="delete" theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="delete"></foxy-i18n> </vaadin-button> `),(e=>{var t;return!e.detail.cancelled&&(null===(t=this.nucleon)||void 0===t?void 0:t.delete())}),this.theme,this.disabled||this.readonly,(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}))}});let m,f=e=>e;customElements.define("foxy-internal-create-control",class extends e{constructor(){super(...arguments),this.theme="primary success"}static get properties(){return r(r({},super.properties),{},{theme:{type:String}})}renderControl(){return t(m||(m=f` <vaadin-button class="w-full" theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="create"></foxy-i18n> </vaadin-button> `),this.theme,this.disabled||this.__isInvalid,(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.submit()}))}get __isCleanTemplateInvalid(){var e;return!!(null===(e=this.nucleon)||void 0===e?void 0:e.in({idle:{template:{clean:"invalid"}}}))}get __isDirtyTemplateInvalid(){var e;return!!(null===(e=this.nucleon)||void 0===e?void 0:e.in({idle:{template:{dirty:"invalid"}}}))}get __isCleanSnapshotInvalid(){var e;return!!(null===(e=this.nucleon)||void 0===e?void 0:e.in({idle:{snapshot:{clean:"invalid"}}}))}get __isDirtySnapshotInvalid(){var e;return!!(null===(e=this.nucleon)||void 0===e?void 0:e.in({idle:{snapshot:{dirty:"invalid"}}}))}get __isTemplateInvalid(){return this.__isCleanTemplateInvalid||this.__isDirtyTemplateInvalid}get __isSnapshotInvalid(){return this.__isCleanSnapshotInvalid||this.__isDirtySnapshotInvalid}get __isInvalid(){return this.__isSnapshotInvalid||this.__isTemplateInvalid}});let p,y,u=e=>e;customElements.define("foxy-internal-timestamps-control",class extends e{static get styles(){return[super.styles,i(p||(p=u`.max-w-0{max-width:0}`))]}renderControl(){return t(y||(y=u` <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"> <foxy-i18n infer="" key="date_created"></foxy-i18n> </td> <td class="max-w-0 truncate py-s text-body w-2-3"> <foxy-i18n options="${0}" infer="" key="date"> </foxy-i18n> </td> </tr> <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m"> <foxy-i18n infer="" key="date_modified"></foxy-i18n> </td> <td class="max-w-0 truncate py-s text-body w-2-3"> <foxy-i18n options="${0}" infer="" key="date"> </foxy-i18n> </td> </tr> </tbody> </table> `),JSON.stringify({value:n(this,"nucleon.form.date_created")}),JSON.stringify({value:n(this,"nucleon.form.date_modified")}))}});let h,v,x,_=e=>e;const b=s(a(o));class g extends b{renderBody(){return this.data?t(h||(h=_` <foxy-internal-timestamps-control infer="timestamps"></foxy-internal-timestamps-control> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `)):t(v||(v=_`<foxy-internal-create-control infer="create"></foxy-internal-create-control>`))}render(){const e=!(this.in("idle")||this.in({busy:"fetching"})&&this.data);return t(x||(x=_` <div aria-busy="${0}" aria-live="polite" class="relative"> <div class="${0}"> ${0} </div> <div data-testid="spinner" class="${0}"> <foxy-spinner layout="${0}" class="m-auto" state="${0}" infer="spinner"> </foxy-spinner> </div> </div> `),this.in("busy"),l({"grid grid-cols-1 gap-m":!0,"transition-opacity":!0,"opacity-0 pointer-events-none":e}),this.renderBody(),l({"transition-opacity absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!e}),this.in("fail")?"vertical":"no-label",this.in("fail")?"error":"busy")}}customElements.define("foxy-internal-form",g);export{g as I};
1
+ import"./shared-c9d1a2cd.js";import{I as e}from"./shared-ff7a10de.js";import{h as t,c as i}from"./shared-7f33a83a.js";import{Q as n}from"./shared-86d0d927.js";import"./shared-90119584.js";import{_ as r}from"./shared-e34d2ef1.js";import"./shared-7976580a.js";import"./foxy-spinner.js";import{C as s}from"./shared-84b5d8f0.js";import{T as a}from"./shared-1b38c44f.js";import{N as o}from"./shared-85cd6cfb.js";import{c as l}from"./shared-4e709717.js";let d,c=e=>e;customElements.define("foxy-internal-delete-control",class extends e{constructor(){super(...arguments),this.theme="primary error"}static get properties(){return r(r({},super.properties),{},{theme:{type:String}})}renderControl(){return t(d||(d=c` <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" infer="" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button data-testid="delete" theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="delete"></foxy-i18n> </vaadin-button> `),(e=>{var t;return!e.detail.cancelled&&(null===(t=this.nucleon)||void 0===t?void 0:t.delete())}),this.theme,this.disabled||this.readonly,(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}))}});let m,f=e=>e;customElements.define("foxy-internal-create-control",class extends e{constructor(){super(...arguments),this.theme="primary success"}static get properties(){return r(r({},super.properties),{},{theme:{type:String}})}renderControl(){return t(m||(m=f` <vaadin-button class="w-full" theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="create"></foxy-i18n> </vaadin-button> `),this.theme,this.disabled||this.__isInvalid,(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.submit()}))}get __isCleanTemplateInvalid(){var e;return!!(null===(e=this.nucleon)||void 0===e?void 0:e.in({idle:{template:{clean:"invalid"}}}))}get __isDirtyTemplateInvalid(){var e;return!!(null===(e=this.nucleon)||void 0===e?void 0:e.in({idle:{template:{dirty:"invalid"}}}))}get __isCleanSnapshotInvalid(){var e;return!!(null===(e=this.nucleon)||void 0===e?void 0:e.in({idle:{snapshot:{clean:"invalid"}}}))}get __isDirtySnapshotInvalid(){var e;return!!(null===(e=this.nucleon)||void 0===e?void 0:e.in({idle:{snapshot:{dirty:"invalid"}}}))}get __isTemplateInvalid(){return this.__isCleanTemplateInvalid||this.__isDirtyTemplateInvalid}get __isSnapshotInvalid(){return this.__isCleanSnapshotInvalid||this.__isDirtySnapshotInvalid}get __isInvalid(){return this.__isSnapshotInvalid||this.__isTemplateInvalid}});let p,y,u=e=>e;customElements.define("foxy-internal-timestamps-control",class extends e{static get styles(){return[super.styles,i(p||(p=u`.max-w-0{max-width:0}`))]}renderControl(){return t(y||(y=u` <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"> <foxy-i18n infer="" key="date_created"></foxy-i18n> </td> <td class="max-w-0 truncate py-s text-body w-2-3"> <foxy-i18n options="${0}" infer="" key="date"> </foxy-i18n> </td> </tr> <tr> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m"> <foxy-i18n infer="" key="date_modified"></foxy-i18n> </td> <td class="max-w-0 truncate py-s text-body w-2-3"> <foxy-i18n options="${0}" infer="" key="date"> </foxy-i18n> </td> </tr> </tbody> </table> `),JSON.stringify({value:n(this,"nucleon.form.date_created")}),JSON.stringify({value:n(this,"nucleon.form.date_modified")}))}});let h,v,x,_=e=>e;const b=s(a(o));class g extends b{renderBody(){return this.data?t(h||(h=_` <foxy-internal-timestamps-control infer="timestamps"></foxy-internal-timestamps-control> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `)):t(v||(v=_`<foxy-internal-create-control infer="create"></foxy-internal-create-control>`))}render(){const e=!(this.in("idle")||this.in({busy:"fetching"})&&this.data);return t(x||(x=_` <div aria-busy="${0}" aria-live="polite" class="relative"> <div class="${0}"> ${0} </div> <div data-testid="spinner" class="${0}"> <foxy-spinner layout="${0}" class="m-auto" state="${0}" infer="spinner"> </foxy-spinner> </div> </div> `),this.in("busy"),l({"grid grid-cols-1 gap-m":!0,"transition-opacity":!0,"opacity-0 pointer-events-none":e}),this.renderBody(),l({"transition-opacity absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!e}),this.in("fail")?"vertical":"no-label",this.in("fail")?"error":"busy")}}customElements.define("foxy-internal-form",g);export{g as I};
@@ -1,4 +1,4 @@
1
- import{E as t,C as e,T as o}from"./shared-ea418c18.js";import{h as r,G as i,P as a,b as s}from"./shared-833a8b4e.js";const n=r`<dom-module id="lumo-button" theme-for="vaadin-button">
1
+ import{E as t,C as e,T as o}from"./shared-75ec4e1a.js";import{h as r,G as i,P as a,b as s}from"./shared-cf2b9cc3.js";const n=r`<dom-module id="lumo-button" theme-for="vaadin-button">
2
2
  <template>
3
3
  <style>
4
4
  :host {
@@ -1,4 +1,4 @@
1
- import"./shared-09d39b25.js";import{h as c}from"./shared-833a8b4e.js";
1
+ import"./shared-26502fca.js";import{h as c}from"./shared-cf2b9cc3.js";
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
@@ -1 +1 @@
1
- import{L as r,h as s}from"./shared-7f33a83a.js";import{w as e}from"./shared-b4865438.js";let t,o=r=>r;class n extends r{static get styles(){return e.styles}render(){return s(t||(t=o` <p class="flex text-s border border-contrast-10 rounded-t-l rounded-b-l p-s text-body leading-s"> <iron-icon icon="lumo:error" class="text-error flex-shrink-0 mr-s"></iron-icon> <slot></slot> </p> `))}}function a(r){const[s,e,t]=r.split("-").map((r=>parseInt(r,10)));return[s,e,t].some((r=>"number"!=typeof r||isNaN(r)))?null:new Date(s,e-1,t)}export{n as W,a as p};
1
+ import{L as r,h as s}from"./shared-7f33a83a.js";import{t as e}from"./shared-1b38c44f.js";let t,o=r=>r;class n extends r{static get styles(){return e.styles}render(){return s(t||(t=o` <p class="flex text-s border border-contrast-10 rounded-t-l rounded-b-l p-s text-body leading-s"> <iron-icon icon="lumo:error" class="text-error flex-shrink-0 mr-s"></iron-icon> <slot></slot> </p> `))}}function a(r){const[s,e,t]=r.split("-").map((r=>parseInt(r,10)));return[s,e,t].some((r=>"number"!=typeof r||isNaN(r)))?null:new Date(s,e-1,t)}export{n as W,a as p};
@@ -0,0 +1 @@
1
+ import{_ as e}from"./shared-e34d2ef1.js";import{h as t}from"./shared-7f33a83a.js";import{C as l}from"./shared-84b5d8f0.js";import"./foxy-nucleon-element.js";import{R as s,T as a}from"./shared-1b38c44f.js";import{T as i}from"./shared-5155696f.js";import{c as r}from"./shared-4e709717.js";import{N as d}from"./shared-85cd6cfb.js";let n,o,h,c,m,u=e=>e;const b=l(s(a(i(d))));class p extends b{constructor(){super(...arguments),this.templates={},this.columns=[]}static get properties(){return e(e({},super.properties),{},{columns:{attribute:!1}})}render(){var e,l;const s=this.columns.some((e=>!!e.header));return t(n||(n=u` <div data-testid="wrapper" aria-busy="${0}" aria-live="polite" class="relative font-lumo text-m"> <table class="table-fixed w-full" data-testid="table"> <thead class="${0}"> <tr> ${0} </tr> </thead> <tbody class="divide-y divide-contrast-10"> ${0} </tbody> </table> ${0} </div> ${0} `),this.in("busy"),s?"border-b border-contrast-10":"sr-only",this.columns.map(((e,l)=>{var s;return t(o||(o=u` <th class="${0}"> ${0} </th> `),r({"truncate h-l text-tertiary text-m text-left font-medium":!0,"text-right":l===this.columns.length-1,"hidden sm-table-cell":"sm"===e.hideBelow,"hidden md-table-cell":"md"===e.hideBelow,"hidden lg-table-cell":"lg"===e.hideBelow,"hidden xl-table-cell":"xl"===e.hideBelow}),null===(s=e.header)||void 0===s?void 0:s.call(e,{html:t,lang:this.lang,data:this.data,ns:this.ns}))})),this.__rows.map((e=>{var l;return t(h||(h=u` <tr class="h-l"> ${0} </tr> `),null===(l=this.columns)||void 0===l?void 0:l.map(((l,s)=>{var a;return t(c||(c=u` <td class="${0}"> ${0} </td> `),r({"text-right":s===this.columns.length-1,"hidden sm-table-cell":"sm"===l.hideBelow,"hidden md-table-cell":"md"===l.hideBelow,"hidden lg-table-cell":"lg"===l.hideBelow,"hidden xl-table-cell":"xl"===l.hideBelow,"truncate h-l text-body":!0}),e?null===(a=l.cell)||void 0===a?void 0:a.call(l,{html:t,lang:this.lang,data:e,ns:this.ns}):"")})))})),this.in({idle:"snapshot"})?"":t(m||(m=u` <div class="absolute inset-0 flex items-center justify-center"> <foxy-spinner data-testid="spinner" layout="vertical" state="${0}" class="p-m bg-base shadow-xs rounded-t-l rounded-b-l" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> `),this.in("busy")?"busy":this.in("idle")?"empty":"error",this.lang,this.ns,null!==(l=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==l?l:""),this.renderTemplateOrSlot())}get __rows(){var e,t,l;const s=Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e._embedded)&&void 0!==t?t:{}).reduce(((e,t)=>[...e,...t]),[]);let a;if(0===s.length)try{const e=new URL(null!==(l=this.href)&&void 0!==l?l:"").searchParams.get("limit"),t=parseInt(null!=e?e:"");a=isNaN(t)?20:t}catch(e){a=20}else a=s.length;return new Array(a).fill(null).map(((e,t)=>{var l;return null!==(l=s[t])&&void 0!==l?l:e}))}}export{p as T};
@@ -1,4 +1,4 @@
1
- import{T as A}from"./shared-07834676.js";import"./shared-ea418c18.js";import{h as e}from"./shared-833a8b4e.js";import{D as t}from"./shared-b4865438.js";const s=e`<dom-module id="lumo-password-field" theme-for="vaadin-password-field">
1
+ import{T as A}from"./shared-76daf1fb.js";import"./shared-75ec4e1a.js";import{h as e}from"./shared-cf2b9cc3.js";import{D as t}from"./shared-1b38c44f.js";const s=e`<dom-module id="lumo-password-field" theme-for="vaadin-password-field">
2
2
  <template>
3
3
  <style>
4
4
  [part="reveal-button"]::before {
@@ -0,0 +1 @@
1
+ import{I as e}from"./shared-ff7a10de.js";import{_ as t}from"./shared-e34d2ef1.js";class r extends e{constructor(){super(...arguments),this.getValue=()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.form[this.property]},this.setValue=e=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.edit({[this.property]:e})},this.__placeholder=null,this.__helperText=null,this.__v8nPrefix=null,this.__property=null,this.__label=null}static get properties(){return t(t({},super.properties),{},{placeholder:{type:String,noAccessor:!0},helperText:{type:String,attribute:"helper-text",noAccessor:!0},v8nPrefix:{type:String,attribute:"v8n-prefix",noAccessor:!0},getValue:{attribute:!1},setValue:{attribute:!1},property:{type:String,noAccessor:!0},label:{type:String,noAccessor:!0}})}get placeholder(){return"string"==typeof this.__placeholder?this.__placeholder:this.t("placeholder")}set placeholder(e){this.requestUpdate("placeholder",this.__placeholder),this.__placeholder=e}get helperText(){return"string"==typeof this.__helperText?this.__helperText:this.t("helper_text")}set helperText(e){this.requestUpdate("helperText",this.__helperText),this.__helperText=e}get v8nPrefix(){return"string"==typeof this.__v8nPrefix?this.__v8nPrefix:"string"==typeof this.infer?`${this.infer}:`:""}set v8nPrefix(e){this.requestUpdate("v8nPrefix",this.__v8nPrefix),this.__v8nPrefix=e}get property(){return"string"==typeof this.__property?this.__property:"string"==typeof this.infer?this.infer.replace(/-/g,"_"):""}set property(e){this.requestUpdate("property",this.__property),this.__property=e}get label(){return"string"==typeof this.__label?this.__label:this.t("label")}set label(e){this.requestUpdate("label",this.__label),this.__label=e}resetPlaceholder(){this.requestUpdate("placeholder",this.__placeholder),this.__placeholder=null}resetHelperText(){this.requestUpdate("helperText",this.__helperText),this.__helperText=null}resetV8nPrefix(){this.requestUpdate("v8nPrefix",this.__v8nPrefix),this.__v8nPrefix=null}resetProperty(){this.requestUpdate("property",this.__property),this.__property=null}resetLabel(){this.requestUpdate("label",this.__label),this.__label=null}get _value(){return this.getValue()}set _value(e){const t=new CustomEvent("change",{cancelable:!0,detail:e});this.dispatchEvent(t)&&this.setValue(e)}get _error(){var e;return null===(e=this.nucleon)||void 0===e?void 0:e.errors.find((e=>e.startsWith(this.v8nPrefix)))}get _errorMessage(){return this._error?this.t(this._error.substring(this.v8nPrefix.length)):void 0}get _checkValidity(){return()=>!this._error}}customElements.define("foxy-internal-editable-control",r);export{r as I};