@foxy.io/elements 1.15.0-beta.7 → 1.16.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  5. package/dist/cdn/foxy-attribute-card.js +1 -1
  6. package/dist/cdn/foxy-attribute-form.js +1 -1
  7. package/dist/cdn/foxy-cancellation-form.js +1 -1
  8. package/dist/cdn/foxy-collection-page.js +1 -1
  9. package/dist/cdn/foxy-collection-pages.js +1 -1
  10. package/dist/cdn/foxy-coupon-card.js +1 -1
  11. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  12. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  13. package/dist/cdn/foxy-coupon-form.js +1 -1
  14. package/dist/cdn/foxy-custom-field-card.js +1 -1
  15. package/dist/cdn/foxy-custom-field-form.js +1 -1
  16. package/dist/cdn/foxy-customer-card.js +1 -1
  17. package/dist/cdn/foxy-customer-form.js +1 -1
  18. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  19. package/dist/cdn/foxy-customer-portal.js +13 -13
  20. package/dist/cdn/foxy-customer.js +7 -7
  21. package/dist/cdn/foxy-customers-table.js +1 -1
  22. package/dist/cdn/foxy-discount-card.js +1 -1
  23. package/dist/cdn/foxy-donation.js +1 -1
  24. package/dist/cdn/foxy-email-template-form.js +1 -1
  25. package/dist/cdn/foxy-error-entry-card.js +1 -1
  26. package/dist/cdn/foxy-form-dialog.js +1 -1
  27. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  28. package/dist/cdn/foxy-gift-card-card.js +1 -1
  29. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  30. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  31. package/dist/cdn/foxy-gift-card-form.js +1 -1
  32. package/dist/cdn/foxy-i18n.js +1 -1
  33. package/dist/cdn/foxy-items-form.js +1 -1
  34. package/dist/cdn/foxy-pagination.js +1 -1
  35. package/dist/cdn/foxy-payment-card.js +1 -1
  36. package/dist/cdn/foxy-payment-method-card.js +1 -1
  37. package/dist/cdn/foxy-query-builder.js +1 -1
  38. package/dist/cdn/foxy-report-form.js +195 -0
  39. package/dist/cdn/foxy-reports-table.js +41 -0
  40. package/dist/cdn/foxy-sign-in-form.js +1 -1
  41. package/dist/cdn/foxy-spinner.js +1 -1
  42. package/dist/cdn/foxy-subscription-card.js +1 -1
  43. package/dist/cdn/foxy-subscription-form.js +5 -5
  44. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  45. package/dist/cdn/foxy-table.js +1 -1
  46. package/dist/cdn/foxy-tax-card.js +1 -1
  47. package/dist/cdn/foxy-tax-form.js +1 -1
  48. package/dist/cdn/foxy-template-config-form.js +1 -1
  49. package/dist/cdn/foxy-template-form.js +1 -1
  50. package/dist/cdn/foxy-transaction-card.js +1 -1
  51. package/dist/cdn/foxy-transactions-table.js +1 -1
  52. package/dist/cdn/foxy-user-form.js +1 -1
  53. package/dist/cdn/foxy-users-table.js +1 -1
  54. package/dist/cdn/{shared-e209cb55.js → shared-061f64fc.js} +1 -1
  55. package/dist/cdn/{shared-4dc6d228.js → shared-15f2aeb5.js} +1 -1
  56. package/dist/cdn/{shared-f4ad24f4.js → shared-24064bd3.js} +1 -1
  57. package/dist/cdn/{shared-46ee137f.js → shared-278a8b9d.js} +1 -1
  58. package/dist/cdn/{shared-ff79f3f9.js → shared-29db2caa.js} +1 -1
  59. package/dist/cdn/{shared-b5754a42.js → shared-2a89f737.js} +1 -1
  60. package/dist/cdn/{shared-0f38a631.js → shared-31166bdc.js} +1 -1
  61. package/dist/cdn/{shared-a7b6feb2.js → shared-312fdfb6.js} +1 -1
  62. package/dist/cdn/{shared-60126eee.js → shared-3821923d.js} +1 -1
  63. package/dist/cdn/shared-385ab830.js +1 -0
  64. package/dist/cdn/{shared-c5de42f7.js → shared-4190da71.js} +1 -1
  65. package/dist/cdn/{shared-07049bfe.js → shared-4792a0b8.js} +1 -1
  66. package/dist/cdn/{shared-dcc9c325.js → shared-56646cd3.js} +1 -1
  67. package/dist/cdn/{shared-1934524e.js → shared-5d169043.js} +2 -2
  68. package/dist/cdn/{shared-5a54a9bc.js → shared-666e8a90.js} +1 -1
  69. package/dist/cdn/{shared-223508ae.js → shared-7f463a38.js} +7 -7
  70. package/dist/cdn/{shared-66633ff7.js → shared-9783e5ce.js} +1 -1
  71. package/dist/cdn/{shared-8b20bc23.js → shared-9da4822a.js} +1 -1
  72. package/dist/cdn/{shared-b9f18aaa.js → shared-a81a95e8.js} +1 -1
  73. package/dist/cdn/shared-b07ef791.js +1 -0
  74. package/dist/cdn/{shared-65dfd512.js → shared-b20f463a.js} +1 -1
  75. package/dist/cdn/{shared-073cb8e9.js → shared-bf6c685e.js} +1 -1
  76. package/dist/cdn/{shared-1a67bc75.js → shared-cb71ddbc.js} +4 -4
  77. package/dist/cdn/{shared-a040d79d.js → shared-d9aed64e.js} +1 -1
  78. package/dist/cdn/{shared-02945b27.js → shared-da709e9d.js} +1 -1
  79. package/dist/cdn/{shared-a23cf7c8.js → shared-db4aacb2.js} +1 -1
  80. package/dist/cdn/shared-dd4971b5.js +1 -0
  81. package/dist/cdn/{shared-fab8c705.js → shared-e367b5fc.js} +2 -2
  82. package/dist/cdn/{shared-08c63028.js → shared-e5937698.js} +2 -2
  83. package/dist/cdn/{shared-20b9ce70.js → shared-e8abe6c6.js} +5 -5
  84. package/dist/cdn/shared-e94c2670.js +1 -0
  85. package/dist/cdn/{shared-09069d7c.js → shared-edfe5274.js} +1 -1
  86. package/dist/cdn/{shared-e2c878c7.js → shared-ee53f7e5.js} +1 -1
  87. package/dist/cdn/translations/access-recovery-form/en.json +12 -0
  88. package/dist/cdn/translations/address-card/en.json +11 -0
  89. package/dist/cdn/translations/address-form/en.json +27 -0
  90. package/dist/cdn/translations/applied-tax-card/en.json +9 -0
  91. package/dist/cdn/translations/attribute-card/en.json +7 -0
  92. package/dist/cdn/translations/attribute-form/en.json +22 -0
  93. package/dist/cdn/translations/cancellation-form/en.json +10 -0
  94. package/dist/cdn/translations/country/pl.json +251 -0
  95. package/dist/cdn/translations/coupon-card/en.json +36 -0
  96. package/dist/cdn/translations/coupon-code-form/en.json +17 -0
  97. package/dist/cdn/translations/coupon-codes-form/en.json +20 -0
  98. package/dist/cdn/translations/coupon-form/en.json +186 -0
  99. package/dist/cdn/translations/custom-field-card/en.json +7 -0
  100. package/dist/cdn/translations/custom-field-form/en.json +19 -0
  101. package/dist/cdn/translations/customer/en.json +247 -0
  102. package/dist/cdn/translations/customer-card/en.json +7 -0
  103. package/dist/cdn/translations/customer-form/en.json +21 -0
  104. package/dist/cdn/translations/customer-portal/de.json +202 -14
  105. package/dist/cdn/translations/customer-portal/en.json +202 -14
  106. package/dist/cdn/translations/customer-portal/es.json +202 -14
  107. package/dist/cdn/translations/customer-portal/pl.json +223 -0
  108. package/dist/cdn/translations/customer-portal/zh-hk.json +202 -14
  109. package/dist/cdn/translations/customers-table/en.json +9 -0
  110. package/dist/cdn/translations/discount-card/en.json +8 -0
  111. package/dist/cdn/translations/email-template-form/en.json +25 -0
  112. package/dist/cdn/translations/error-entry-card/en.json +7 -0
  113. package/dist/cdn/translations/generate-codes-form/en.json +19 -0
  114. package/dist/cdn/translations/gift-card-card/en.json +9 -0
  115. package/dist/cdn/translations/gift-card-code-form/en.json +19 -0
  116. package/dist/cdn/translations/gift-card-codes-form/en.json +25 -0
  117. package/dist/cdn/translations/gift-card-form/en.json +314 -0
  118. package/dist/cdn/translations/pagination/en.json +7 -0
  119. package/dist/cdn/translations/payment-card/en.json +12 -0
  120. package/dist/cdn/translations/payment-method-card/en.json +13 -0
  121. package/dist/cdn/translations/query-builder/en.json +32 -0
  122. package/dist/cdn/translations/report-form/en.json +26 -0
  123. package/dist/cdn/translations/reports-table/en.json +21 -0
  124. package/dist/cdn/translations/sign-in-form/en.json +21 -0
  125. package/dist/cdn/translations/spinner/en.json +7 -0
  126. package/dist/cdn/translations/subscription-card/en.json +26 -0
  127. package/dist/cdn/translations/subscription-form/en.json +76 -0
  128. package/dist/cdn/translations/subscriptions-table/en.json +26 -0
  129. package/dist/cdn/translations/tax-card/en.json +11 -0
  130. package/dist/cdn/translations/tax-form/en.json +38 -0
  131. package/dist/cdn/translations/template-config-form/en.json +107 -0
  132. package/dist/cdn/translations/template-form/en.json +23 -0
  133. package/dist/cdn/translations/transaction-card/en.json +25 -0
  134. package/dist/cdn/translations/transactions-table/en.json +22 -0
  135. package/dist/cdn/translations/user-form/en.json +26 -0
  136. package/dist/cdn/translations/users-table/en.json +44 -0
  137. package/dist/elements/private/Choice/Choice.js +1 -0
  138. package/dist/elements/private/Choice/Choice.js.map +1 -1
  139. package/dist/elements/private/FrequencyInput/FrequencyInput.d.ts +5 -5
  140. package/dist/elements/private/FrequencyInput/FrequencyInput.js +7 -22
  141. package/dist/elements/private/FrequencyInput/FrequencyInput.js.map +1 -1
  142. package/dist/elements/public/AccessRecoveryForm/AccessRecoveryForm.js +1 -1
  143. package/dist/elements/public/AccessRecoveryForm/AccessRecoveryForm.js.map +1 -1
  144. package/dist/elements/public/AttributeCard/types.d.ts +3 -3
  145. package/dist/elements/public/AttributeCard/types.js.map +1 -1
  146. package/dist/elements/public/AttributeForm/AttributeForm.js +2 -1
  147. package/dist/elements/public/AttributeForm/AttributeForm.js.map +1 -1
  148. package/dist/elements/public/AttributeForm/types.d.ts +3 -3
  149. package/dist/elements/public/AttributeForm/types.js.map +1 -1
  150. package/dist/elements/public/CouponCard/CouponCard.js +2 -1
  151. package/dist/elements/public/CouponCard/CouponCard.js.map +1 -1
  152. package/dist/elements/public/CouponCodeForm/CouponCodeForm.js +5 -5
  153. package/dist/elements/public/CouponCodeForm/CouponCodeForm.js.map +1 -1
  154. package/dist/elements/public/CouponCodesForm/CouponCodesForm.js +6 -3
  155. package/dist/elements/public/CouponCodesForm/CouponCodesForm.js.map +1 -1
  156. package/dist/elements/public/CouponForm/CouponForm.js +199 -164
  157. package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
  158. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.d.ts +4 -3
  159. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js +5 -4
  160. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js.map +1 -1
  161. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.d.ts +3 -4
  162. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js +3 -4
  163. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js.map +1 -1
  164. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.d.ts +3 -4
  165. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js +3 -2
  166. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js.map +1 -1
  167. package/dist/elements/public/CustomFieldForm/CustomFieldForm.js +2 -1
  168. package/dist/elements/public/CustomFieldForm/CustomFieldForm.js.map +1 -1
  169. package/dist/elements/public/Customer/Customer.js +1 -1
  170. package/dist/elements/public/Customer/Customer.js.map +1 -1
  171. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +18 -5
  172. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
  173. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js +20 -6
  174. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js.map +1 -1
  175. package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js +2 -1
  176. package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js.map +1 -1
  177. package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.js +2 -1
  178. package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.js.map +1 -1
  179. package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js +6 -6
  180. package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js.map +1 -1
  181. package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +6 -6
  182. package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
  183. package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.js +8 -3
  184. package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.js.map +1 -1
  185. package/dist/elements/public/GiftCardForm/GiftCardForm.js +103 -85
  186. package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
  187. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.d.ts +1 -1
  188. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.js +3 -3
  189. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.js.map +1 -1
  190. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.d.ts +1 -3
  191. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.js +2 -4
  192. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.js.map +1 -1
  193. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.d.ts +1 -3
  194. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.js +2 -2
  195. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.js.map +1 -1
  196. package/dist/elements/public/I18n/format/discount.js +2 -2
  197. package/dist/elements/public/I18n/format/discount.js.map +1 -1
  198. package/dist/elements/public/Pagination/Pagination.js +4 -0
  199. package/dist/elements/public/Pagination/Pagination.js.map +1 -1
  200. package/dist/elements/public/ReportForm/ReportForm.d.ts +48 -0
  201. package/dist/elements/public/ReportForm/ReportForm.js +305 -0
  202. package/dist/elements/public/ReportForm/ReportForm.js.map +1 -0
  203. package/dist/elements/public/ReportForm/index.d.ts +8 -0
  204. package/dist/elements/public/ReportForm/index.js +10 -0
  205. package/dist/elements/public/ReportForm/index.js.map +1 -0
  206. package/dist/elements/public/ReportForm/types.d.ts +19 -0
  207. package/dist/elements/public/ReportForm/types.js +2 -0
  208. package/dist/elements/public/ReportForm/types.js.map +1 -0
  209. package/dist/elements/public/ReportsTable/ReportsTable.d.ts +21 -0
  210. package/dist/elements/public/ReportsTable/ReportsTable.js +101 -0
  211. package/dist/elements/public/ReportsTable/ReportsTable.js.map +1 -0
  212. package/dist/elements/public/ReportsTable/index.d.ts +4 -0
  213. package/dist/elements/public/ReportsTable/index.js +6 -0
  214. package/dist/elements/public/ReportsTable/index.js.map +1 -0
  215. package/dist/elements/public/ReportsTable/types.d.ts +3 -0
  216. package/dist/elements/public/ReportsTable/types.js +2 -0
  217. package/dist/elements/public/ReportsTable/types.js.map +1 -0
  218. package/dist/elements/public/SignInForm/SignInForm.js +1 -1
  219. package/dist/elements/public/SignInForm/SignInForm.js.map +1 -1
  220. package/dist/elements/public/SubscriptionForm/SubscriptionForm.js +1 -1
  221. package/dist/elements/public/SubscriptionForm/SubscriptionForm.js.map +1 -1
  222. package/dist/elements/public/TaxForm/TaxForm.js +16 -14
  223. package/dist/elements/public/TaxForm/TaxForm.js.map +1 -1
  224. package/dist/elements/public/TemplateForm/TemplateForm.js +1 -1
  225. package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -1
  226. package/dist/elements/public/UserForm/UserForm.js +2 -1
  227. package/dist/elements/public/UserForm/UserForm.js.map +1 -1
  228. package/dist/elements/public/UsersTable/UsersTable.d.ts +5 -1
  229. package/dist/elements/public/UsersTable/UsersTable.js +2 -1
  230. package/dist/elements/public/UsersTable/UsersTable.js.map +1 -1
  231. package/dist/elements/public/index.d.ts +2 -0
  232. package/dist/elements/public/index.defined.d.ts +2 -0
  233. package/dist/elements/public/index.defined.js +2 -0
  234. package/dist/elements/public/index.defined.js.map +1 -1
  235. package/dist/elements/public/index.js +2 -0
  236. package/dist/elements/public/index.js.map +1 -1
  237. package/dist/mixins/themeable.js +22 -0
  238. package/dist/mixins/themeable.js.map +1 -1
  239. package/dist/mixins/translatable.js +1 -1
  240. package/dist/mixins/translatable.js.map +1 -1
  241. package/package.json +3 -3
  242. package/dist/cdn/shared-11708514.js +0 -1
  243. package/dist/cdn/shared-253e59d2.js +0 -1
  244. package/dist/cdn/shared-805d18a2.js +0 -1
  245. package/dist/cdn/shared-e68b9c83.js +0 -1
  246. package/dist/cdn/translations/shared/de.json +0 -271
  247. package/dist/cdn/translations/shared/en.json +0 -557
  248. package/dist/cdn/translations/shared/es.json +0 -272
  249. package/dist/cdn/translations/shared/zh-hk.json +0 -179
@@ -1 +1 @@
1
- import{e,r as t,S as s,n as i,L as a,_ as n,h as r,j as l}from"./shared-63eaded9.js";import"./shared-46ee137f.js";import{B as o}from"./shared-5a54a9bc.js";import{E as d,F as c}from"./shared-dcc9c325.js";import"./shared-8b20bc23.js";import"./shared-073cb8e9.js";import{t as u,b as h,c as _,d as g}from"./shared-e68b9c83.js";import{a as p,D as v,b as m,C as x,c as y}from"./shared-223508ae.js";import"./shared-66633ff7.js";import{a as f,I as b,D as $,S as w,M as k,W as j,c as E,t as C}from"./shared-e2c878c7.js";import{I as S}from"./shared-65dfd512.js";import"./shared-a040d79d.js";import"./shared-fab8c705.js";import{p as I}from"./shared-11708514.js";import{c as R}from"./shared-4e709717.js";import"./shared-60126eee.js";import{P as V}from"./shared-0f38a631.js";import{a9 as M,aa as A,ab as O,ac as q,ad as N,ae as D,af as T,ag as F,ah as U,ai as L,aj as B,ak as P,al as z,am as Q,an as J,ao as W,ap as H,aq as G,ar as Y,as as X,at as K,au as Z,av as ee}from"./shared-5535f38f.js";import{G as te}from"./shared-02945b27.js";import{j as se}from"./shared-59e44f29.js";import{p as ie,W as ae}from"./shared-07049bfe.js";import{D as ne}from"./shared-1934524e.js";import{i as re}from"./shared-756034e4.js";import"./shared-ff79f3f9.js";import"./shared-b0f0e8b5.js";import"./shared-7f0a9790.js";import"./shared-df730f90.js";import"./shared-6d45a07b.js";function le(e){return e?Infinity===(e=u(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function oe(e){return e}var de=Object.create,ce=function(){function t(){}return function(s){if(!e(s))return{};if(de)return de(s);t.prototype=s;var i=new t;return t.prototype=void 0,i}}();var ue=function(){try{var e=M(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();function he(e,t,s){"__proto__"==t&&ue?ue(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}var _e=Object.prototype.hasOwnProperty;function ge(e,t,s){var i=e[t];_e.call(e,t)&&A(i,s)&&(void 0!==s||t in e)||he(e,t,s)}function pe(e,t,s,i){var a=!s;s||(s={});for(var n=-1,r=t.length;++n<r;){var l=t[n],o=i?i(s[l],e[l],l,s,e):void 0;void 0===o&&(o=e[l]),a?he(s,l,o):ge(s,l,o)}return s}var ve=Object.prototype.hasOwnProperty;function me(t){if(!e(t))return function(e){var t=[];if(null!=e)for(var s in Object(e))t.push(s);return t}(t);var s=N(t),i=[];for(var a in t)("constructor"!=a||!s&&ve.call(t,a))&&i.push(a);return i}function xe(e){return O(e)?D(e,!0):me(e)}var ye=T(Object.getPrototypeOf,Object);var fe="object"==typeof exports&&exports&&!exports.nodeType&&exports,be=fe&&"object"==typeof module&&module&&!module.nodeType&&module,$e=be&&be.exports===fe?t.Buffer:void 0,we=$e?$e.allocUnsafe:void 0;var ke=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)B(t,U(e)),e=ye(e);return t}:L;function je(e){return P(e,xe,ke)}var Ee=Object.prototype.hasOwnProperty;function Ce(e){var t=new e.constructor(e.byteLength);return new z(t).set(new z(e)),t}var Se=/\w*$/;var Ie=s?s.prototype:void 0,Re=Ie?Ie.valueOf:void 0;function Ve(e,t,s){var i,a,n,r=e.constructor;switch(t){case"[object ArrayBuffer]":return Ce(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return function(e,t){var s=t?Ce(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}(e,s);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var s=t?Ce(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}(e,s);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return(n=new(a=e).constructor(a.source,Se.exec(a))).lastIndex=a.lastIndex,n;case"[object Symbol]":return i=e,Re?Object(Re.call(i)):{}}}var Me=J&&J.isMap,Ae=Me?W(Me):function(e){return i(e)&&"[object Map]"==Q(e)};var Oe=J&&J.isSet,qe=Oe?W(Oe):function(e){return i(e)&&"[object Set]"==Q(e)},Ne={};function De(t,s,i,a,n,r){var l,o=1&s,d=2&s,c=4&s;if(i&&(l=n?i(t,a,n,r):i(t)),void 0!==l)return l;if(!e(t))return t;var u=H(t);if(u){if(l=function(e){var t=e.length,s=new e.constructor(t);return t&&"string"==typeof e[0]&&Ee.call(e,"index")&&(s.index=e.index,s.input=e.input),s}(t),!o)return function(e,t){var s=-1,i=e.length;for(t||(t=Array(i));++s<i;)t[s]=e[s];return t}(t,l)}else{var h=Q(t),_="[object Function]"==h||"[object GeneratorFunction]"==h;if(G(t))return function(e,t){if(t)return e.slice();var s=e.length,i=we?we(s):new e.constructor(s);return e.copy(i),i}(t,o);if("[object Object]"==h||"[object Arguments]"==h||_&&!n){if(l=d||_?{}:function(e){return"function"!=typeof e.constructor||N(e)?{}:ce(ye(e))}(t),!o)return d?function(e,t){return pe(e,ke(e),t)}(t,function(e,t){return e&&pe(t,xe(t),e)}(l,t)):function(e,t){return pe(e,U(e),t)}(t,function(e,t){return e&&pe(t,F(t),e)}(l,t))}else{if(!Ne[h])return n?t:{};l=Ve(t,h,o)}}r||(r=new Y);var g=r.get(t);if(g)return g;r.set(t,l),qe(t)?t.forEach((function(e){l.add(De(e,s,i,e,t,r))})):Ae(t)&&t.forEach((function(e,a){l.set(a,De(e,s,i,a,t,r))}));var p=u?void 0:(c?d?je:X:d?xe:F)(t);return function(e,t){for(var s=-1,i=null==e?0:e.length;++s<i&&!1!==t(e[s],s,e););}(p||t,(function(e,a){p&&(e=t[a=e]),ge(l,a,De(e,s,i,a,t,r))})),l}Ne["[object Arguments]"]=Ne["[object Array]"]=Ne["[object ArrayBuffer]"]=Ne["[object DataView]"]=Ne["[object Boolean]"]=Ne["[object Date]"]=Ne["[object Float32Array]"]=Ne["[object Float64Array]"]=Ne["[object Int8Array]"]=Ne["[object Int16Array]"]=Ne["[object Int32Array]"]=Ne["[object Map]"]=Ne["[object Number]"]=Ne["[object Object]"]=Ne["[object RegExp]"]=Ne["[object Set]"]=Ne["[object String]"]=Ne["[object Symbol]"]=Ne["[object Uint8Array]"]=Ne["[object Uint8ClampedArray]"]=Ne["[object Uint16Array]"]=Ne["[object Uint32Array]"]=!0,Ne["[object Error]"]=Ne["[object Function]"]=Ne["[object WeakMap]"]=!1;var Te=Math.floor,Fe=Math.random;var Ue=parseFloat,Le=Math.min,Be=Math.random;function Pe(t,s,i){if(i&&"boolean"!=typeof i&&function(t,s,i){if(!e(i))return!1;var a=typeof s;return!!("number"==a?O(i)&&q(s,i.length):"string"==a&&s in i)&&A(i[s],t)}(t,s,i)&&(s=i=void 0),void 0===i&&("boolean"==typeof s?(i=s,s=void 0):"boolean"==typeof t&&(i=t,t=void 0)),void 0===t&&void 0===s?(t=0,s=1):(t=le(t),void 0===s?(s=t,t=0):s=le(s)),t>s){var a=t;t=s,s=a}if(i||t%1||s%1){var n=Be();return Le(t+n*(s-t+Ue("1e-"+((n+"").length-1))),s)}return function(e,t){return e+Te(Fe()*(t-e+1))}(t,s)}var ze=Math.min;function Qe(e,t){if(e=function(e){var t=le(e),s=t%1;return t==t?s?t-s:t:0}(e),e<1||e>9007199254740991)return[];var s,i=4294967295,a=ze(e,4294967295);e-=4294967295;for(var n=K(a,t="function"==typeof(s=t)?s:oe);++i<e;)t(i);return n}class Je extends CustomEvent{constructor(e){super("change",{detail:e})}}let We,He,Ge=e=>e;class Ye extends a{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return h.styles}render(){return r(We||(We=Ge` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>r(He||(He=Ge` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new Je(this.value))}}let Xe,Ke,Ze=e=>e;class et extends a{static get styles(){return[h.styles,l(Xe||(Xe=Ze`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return r(Ke||(Ke=Ze` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let tt,st,it=e=>e;class at extends a{static get styles(){return[h.styles,l(tt||(tt=it`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return r(st||(st=it` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-bold text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let nt,rt,lt=e=>e;class ot extends at{static get styles(){return[super.styles,l(nt||(nt=lt`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return r(rt||(rt=lt` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-semibold text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let dt,ct=e=>e;class ut extends CustomEvent{constructor(e){super("change",{detail:e})}}class ht extends a{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return h.styles}render(){return r(dt||(dt=ct` <label class="${0}"> <span class="text-body text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),R({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),R({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),R({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new ut(this.checked))}))}}class _t extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class gt extends CustomEvent{static emit(e){return new Promise(((t,s)=>{const i=new gt(n({resolve:t,reject:s},e));e.source.dispatchEvent(i)&&s(new _t)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}let pt,vt=e=>e;class mt extends CustomEvent{constructor(e){super("change",{detail:e})}}class xt extends _{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":S,"vaadin-custom-field":p,"vaadin-select":f,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return r(pt||(pt=vt` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),R({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new mt({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let yt,ft=e=>e;class bt extends CustomEvent{constructor(e){super("change",{detail:e})}}class $t extends _{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":V,"vaadin-button":o,"iron-icon":customElements.get("iron-icon"),"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return r(yt||(yt=ft` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=Qe(72,(()=>Pe(35).toString(36))).join(""),this.dispatchEvent(new bt({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new bt({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function wt(e){return t=>{t.preventDefault(),e(t)}}class kt extends v{}let jt,Et=e=>e;class Ct extends _{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=Ct.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":$}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return r(jt||(jt=Et` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return I(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return I(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new kt(this.value))}}Ct.defaultValue="1w";class St extends Je{}let It,Rt,Vt,Mt,At=e=>e;class Ot extends _{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=Ct.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":Ct,"x-skeleton":w,"x-list":Ye,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return r(It||(It=At` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?r(Rt||(Rt=At`<span slot="${0}">${0}</span>`),t,this.__getText(e)):r(Vt||(Vt=At`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?r(Mt||(Mt=At` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,R({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=Ct.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new St(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class qt extends m{}let Nt,Dt,Tt=e=>e;class Ft extends _{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=g((e=>{try{se(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":x,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return r(Nt||(Nt=Tt` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?r(Dt||(Dt=Tt` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new qt(this.value))}}class Ut extends CustomEvent{constructor(e){super("change",{detail:e})}}class Lt extends CustomEvent{constructor(){super("remove")}}let Bt,Pt,zt=e=>e;class Qt extends _{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":Ot,"x-jsonata-input":Ft,"iron-icon":customElements.get("iron-icon"),"x-group":te,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return r(Bt||(Bt=zt` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),R({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,wt((()=>{this.dispatchEvent(new Lt)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=I(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return r(Pt||(Pt=zt` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=n(n({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new Ut(this.value))}}class Jt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Wt,Ht,Gt=e=>e;class Yt extends _{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":Qt,"vaadin-button":customElements.get("vaadin-button"),"x-section":ot,"iron-icon":customElements.get("iron-icon"),"x-group":te,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return r(Wt||(Wt=Gt` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.subtitle" slot="subtitle" class="mr-xl"></x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>r(Ht||(Ht=Gt` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,R({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new Jt(this.value))}}function Xt(e,t){const s=(new Date).getFullYear(),i={month:"long",day:"numeric"};return e.split("..").map((e=>{const a=ie(e),r=(null==a?void 0:a.getFullYear())===s?void 0:"numeric";return null==a?void 0:a.toLocaleDateString(t,n({year:r},i))})).join(" – ")}class Kt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Zt,es,ts,ss=e=>e;class is extends _{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":k,"x-weekday-picker":j,"x-choice":x,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return r(Zt||(Zt=ss` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?r(es||(es=ss` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?r(ts||(ts=ss` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new Kt(this.value))}}class as extends Je{}let ns,rs,ls,os,ds=e=>e;class cs extends _{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":ne,"vaadin-button":o,"x-skeleton":w,"iron-icon":customElements.get("iron-icon"),"x-i18n":b,"x-list":Ye}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return r(ns||(ns=ds` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?r(rs||(rs=ds`<span slot="${0}" class="truncate">${0}</span>`),t,Xt(e,this.lang)):r(ls||(ls=ds`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?r(os||(os=ds` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,R({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=ie(this.__endValue),s=ie(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new as(this.value))}}class us extends CustomEvent{constructor(e){super("change",{detail:e})}}let hs,_s,gs=e=>e;class ps extends _{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":Ct,"x-choice":x,"x-group":te,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return r(hs||(hs=gs` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?r(_s||(_s=gs` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=I(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new us(this.value))}}class vs extends CustomEvent{constructor(e){super("change",{detail:e})}}class ms extends CustomEvent{constructor(){super("remove")}}let xs,ys,fs,bs,$s,ws,ks,js,Es,Cs=e=>e;class Ss extends _{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":cs,"x-jsonata-input":Ft,"x-offset-input":ps,"x-allowed-days":is,"iron-icon":customElements.get("iron-icon"),"x-warning":ae,"x-group":te,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:t,allowedDays:s,jsonataQuery:i,disallowedDates:a}=this.value,l=e||t,o=s&&s.days.length>0,d=a&&a.length>0,c=this.open?"":"rounded-b-l";return r(xs||(xs=Cs` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),R({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),c,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",l||o||d?r(ys||(ys=Cs` <div> ${0} </div> `),E(l&&this.__renderMinMaxSummary(e,t),o&&this.__renderAllowedSummary(s),d&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,wt((()=>this.dispatchEvent(new ms))),this.ns,this.lang,this.ns,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,t,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,t)?r(fs||(fs=Cs` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=a?a:[],this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new vs(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=I(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return r(bs||(bs=Cs` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return r($s||($s=Cs` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return r(ws||(ws=Cs`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return r(ks||(ks=Cs` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} &mdash; ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?I(e):void 0),this.__renderMinMaxContent(t?I(t):void 0))}__renderAllowedSummary({type:e,days:t}){return r(js||(js=Cs` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>C(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return r(Es||(Es=Cs` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>Xt(e,this.lang))).join("; "))}}class Is extends CustomEvent{constructor(e){super("change",{detail:e})}}let Rs,Vs,Ms,As=e=>e;class Os extends _{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":Ss,"vaadin-button":customElements.get("vaadin-button"),"x-section":ot,"iron-icon":customElements.get("iron-icon"),"x-switch":ht,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return r(Rs||(Rs=As` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?r(Vs||(Vs=As` ${0} `),this.__normalizedValue.map(((e,t,s)=>r(Ms||(Ms=As` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,R({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Is(this.value))}}class qs extends Je{}let Ns,Ds,Ts,Fs=e=>e;class Us extends _{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":w,"iron-icon":customElements.get("iron-icon"),"x-group":te,"x-list":Ye,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return r(Ns||(Ns=Fs` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?r(Ds||(Ds=Fs` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):r(Ts||(Ts=Fs`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,R({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new qs(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}class Ls extends CustomEvent{constructor(e){super("change",{detail:e})}}let Bs,Ps=e=>e;class zs extends _{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":ot,"x-switch":ht,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return r(Bs||(Bs=Ps` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sso.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="sso.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang)}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ls(this.value))}}const Qs=y.assign({error:(e,t)=>t.data.type}),Js=y.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),Ws=y.assign({oldResource:e=>e.newResource}),Hs=y.assign({invalid:[],newResource:({oldResource:e})=>e}),Gs=y.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:Qe(72,(()=>Pe(35).toString(36))).join(""),sessionLifespanInMinutes:40320,sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),Ys=y.assign({newResource:null}),Xs=y.assign({error:"setup_needed"}),Ks=y.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{allowedOrigins:s})}}),Zs=y.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowFrequencyModification:s})})}}),ei=y.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowNextDateModification:s})})}}),ti=y.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sessionLifespanInMinutes:s})}}),si=y.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{jwtSharedSecret:s})}}),ii=y.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),ai=y.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sso:s})}}),ni={SET_SSO:{target:"#cps.idle",actions:"setSSO"},SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},ri={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},li=Z({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:ni},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:n({on:ni},ri),updated:n({on:ni},ri),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>ee(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:Zs,setNextDateModification:ei,setOrigins:Ks,setSession:ti,setSecret:si,setHref:ii,setSSO:ai,handleLoadingSuccess:Js,handleSavingSuccess:Ws,handleError:Qs,create:Gs,reset:Hs,remove:Ys,requireSetup:Xs}});let oi,di,ci,ui,hi=e=>e;function _i(e){if(!e.ok)throw new c(401===e.status?"unauthorized":"unknown")}class gi extends CustomEvent{constructor(){super("ready")}}class pi extends CustomEvent{constructor(){super("update")}}class vi extends _{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=li.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=re(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":Yt,"x-next-date-modification":Os,"x-session-duration":xt,"x-session-secret":$t,"x-loading-screen":et,"x-error-screen":d,"x-origins-list":Us,"x-sso-switch":zs,"x-skeleton":w,"x-section":ot,"x-switch":ht,"x-i18n":b,"x-page":at}}static get properties(){return n(n({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,t,s,i,a,l;if(this.__service.state.matches("error"))return r(oi||(oi=hi` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:o}=this.__service.state.context,d=this.__service.state.matches("idle.dirty.created"),c=this.__service.state.matches("idle.dirty.deleted"),u=this.__service.state.matches("idle.dirty.updated"),h=this.__service.state.matches("idle.clean.enabled"),_=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return r(di||(di=hi` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-sso-switch data-testid="sso" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-sso-switch> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,h||d||u,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==o?void 0:o.allowedOrigins)&&void 0!==e?e:[],!o,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==o?void 0:o.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!o,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==o?void 0:o.subscriptions.allowNextDateModification)&&void 0!==s&&s,!o,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==o?void 0:o.sso)&&void 0!==i&&i,!o,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!o||!this._isI18nReady,null!==(a=null==o?void 0:o.sessionLifespanInMinutes)&&void 0!==a?a:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SESSION"},e))}),!o||!this._isI18nReady,null!==(l=null==o?void 0:o.jwtSharedSecret)&&void 0!==l?l:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?r(ci||(ci=hi` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),c?"error":"success",_,(()=>this.__service.send("SAVE")),this.lang,this.ns,d?"create":c?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?r(ui||(ui=hi`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new c("setup_needed");try{await this.updateComplete;const e=await gt.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await gt.emit({source:this,init:["/"]});_i(e);const i=(await e.json())._links["fx:store"].href,a=await gt.emit({source:this,init:[i]});_i(a),s=await a.json()}else{_i(e),t=await e.json();const i=t._links["fx:store"].href,a=await gt.emit({source:this,init:[i]});_i(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof c)throw e;if(e instanceof _t)throw new c("setup_needed");throw new c("unknown")}finally{await this.updateComplete,this.dispatchEvent(new gi)}}async __save(){try{const e=this.__service.state.context,t=De(e.newResource,5),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};_i(await gt.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof c)throw e;if(e instanceof _t)throw new c("setup_needed");throw new c("unknown")}finally{await this.updateComplete,this.dispatchEvent(new pi)}}}customElements.define("foxy-customer-portal-settings",vi);export{vi as CustomerPortalSettings};
1
+ import{e,r as t,S as s,n as i,L as a,_ as n,h as r,j as l}from"./shared-63eaded9.js";import"./shared-278a8b9d.js";import{B as o}from"./shared-666e8a90.js";import{E as d,F as c}from"./shared-56646cd3.js";import"./shared-9da4822a.js";import"./shared-bf6c685e.js";import{t as u,b as h,c as _,d as g}from"./shared-385ab830.js";import{a as p,D as v,b as m,C as x,c as y}from"./shared-7f463a38.js";import"./shared-9783e5ce.js";import{a as f,I as b,D as $,S as w,M as k,W as j,c as E,t as C}from"./shared-ee53f7e5.js";import{I as S}from"./shared-b20f463a.js";import"./shared-d9aed64e.js";import"./shared-e367b5fc.js";import{p as I}from"./shared-b07ef791.js";import{c as R}from"./shared-4e709717.js";import"./shared-3821923d.js";import{P as V}from"./shared-31166bdc.js";import{a9 as M,aa as A,ab as O,ac as q,ad as N,ae as D,af as T,ag as F,ah as U,ai as L,aj as B,ak as P,al as z,am as Q,an as J,ao as W,ap as H,aq as G,ar as Y,as as X,at as K,au as Z,av as ee}from"./shared-5535f38f.js";import{G as te}from"./shared-da709e9d.js";import{j as se}from"./shared-59e44f29.js";import{p as ie,W as ae}from"./shared-4792a0b8.js";import{D as ne}from"./shared-5d169043.js";import{i as re}from"./shared-756034e4.js";import"./shared-29db2caa.js";import"./shared-b0f0e8b5.js";import"./shared-7f0a9790.js";import"./shared-df730f90.js";import"./shared-6d45a07b.js";function le(e){return e?Infinity===(e=u(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function oe(e){return e}var de=Object.create,ce=function(){function t(){}return function(s){if(!e(s))return{};if(de)return de(s);t.prototype=s;var i=new t;return t.prototype=void 0,i}}();var ue=function(){try{var e=M(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();function he(e,t,s){"__proto__"==t&&ue?ue(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}var _e=Object.prototype.hasOwnProperty;function ge(e,t,s){var i=e[t];_e.call(e,t)&&A(i,s)&&(void 0!==s||t in e)||he(e,t,s)}function pe(e,t,s,i){var a=!s;s||(s={});for(var n=-1,r=t.length;++n<r;){var l=t[n],o=i?i(s[l],e[l],l,s,e):void 0;void 0===o&&(o=e[l]),a?he(s,l,o):ge(s,l,o)}return s}var ve=Object.prototype.hasOwnProperty;function me(t){if(!e(t))return function(e){var t=[];if(null!=e)for(var s in Object(e))t.push(s);return t}(t);var s=N(t),i=[];for(var a in t)("constructor"!=a||!s&&ve.call(t,a))&&i.push(a);return i}function xe(e){return O(e)?D(e,!0):me(e)}var ye=T(Object.getPrototypeOf,Object);var fe="object"==typeof exports&&exports&&!exports.nodeType&&exports,be=fe&&"object"==typeof module&&module&&!module.nodeType&&module,$e=be&&be.exports===fe?t.Buffer:void 0,we=$e?$e.allocUnsafe:void 0;var ke=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)B(t,U(e)),e=ye(e);return t}:L;function je(e){return P(e,xe,ke)}var Ee=Object.prototype.hasOwnProperty;function Ce(e){var t=new e.constructor(e.byteLength);return new z(t).set(new z(e)),t}var Se=/\w*$/;var Ie=s?s.prototype:void 0,Re=Ie?Ie.valueOf:void 0;function Ve(e,t,s){var i,a,n,r=e.constructor;switch(t){case"[object ArrayBuffer]":return Ce(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return function(e,t){var s=t?Ce(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}(e,s);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var s=t?Ce(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}(e,s);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return(n=new(a=e).constructor(a.source,Se.exec(a))).lastIndex=a.lastIndex,n;case"[object Symbol]":return i=e,Re?Object(Re.call(i)):{}}}var Me=J&&J.isMap,Ae=Me?W(Me):function(e){return i(e)&&"[object Map]"==Q(e)};var Oe=J&&J.isSet,qe=Oe?W(Oe):function(e){return i(e)&&"[object Set]"==Q(e)},Ne={};function De(t,s,i,a,n,r){var l,o=1&s,d=2&s,c=4&s;if(i&&(l=n?i(t,a,n,r):i(t)),void 0!==l)return l;if(!e(t))return t;var u=H(t);if(u){if(l=function(e){var t=e.length,s=new e.constructor(t);return t&&"string"==typeof e[0]&&Ee.call(e,"index")&&(s.index=e.index,s.input=e.input),s}(t),!o)return function(e,t){var s=-1,i=e.length;for(t||(t=Array(i));++s<i;)t[s]=e[s];return t}(t,l)}else{var h=Q(t),_="[object Function]"==h||"[object GeneratorFunction]"==h;if(G(t))return function(e,t){if(t)return e.slice();var s=e.length,i=we?we(s):new e.constructor(s);return e.copy(i),i}(t,o);if("[object Object]"==h||"[object Arguments]"==h||_&&!n){if(l=d||_?{}:function(e){return"function"!=typeof e.constructor||N(e)?{}:ce(ye(e))}(t),!o)return d?function(e,t){return pe(e,ke(e),t)}(t,function(e,t){return e&&pe(t,xe(t),e)}(l,t)):function(e,t){return pe(e,U(e),t)}(t,function(e,t){return e&&pe(t,F(t),e)}(l,t))}else{if(!Ne[h])return n?t:{};l=Ve(t,h,o)}}r||(r=new Y);var g=r.get(t);if(g)return g;r.set(t,l),qe(t)?t.forEach((function(e){l.add(De(e,s,i,e,t,r))})):Ae(t)&&t.forEach((function(e,a){l.set(a,De(e,s,i,a,t,r))}));var p=u?void 0:(c?d?je:X:d?xe:F)(t);return function(e,t){for(var s=-1,i=null==e?0:e.length;++s<i&&!1!==t(e[s],s,e););}(p||t,(function(e,a){p&&(e=t[a=e]),ge(l,a,De(e,s,i,a,t,r))})),l}Ne["[object Arguments]"]=Ne["[object Array]"]=Ne["[object ArrayBuffer]"]=Ne["[object DataView]"]=Ne["[object Boolean]"]=Ne["[object Date]"]=Ne["[object Float32Array]"]=Ne["[object Float64Array]"]=Ne["[object Int8Array]"]=Ne["[object Int16Array]"]=Ne["[object Int32Array]"]=Ne["[object Map]"]=Ne["[object Number]"]=Ne["[object Object]"]=Ne["[object RegExp]"]=Ne["[object Set]"]=Ne["[object String]"]=Ne["[object Symbol]"]=Ne["[object Uint8Array]"]=Ne["[object Uint8ClampedArray]"]=Ne["[object Uint16Array]"]=Ne["[object Uint32Array]"]=!0,Ne["[object Error]"]=Ne["[object Function]"]=Ne["[object WeakMap]"]=!1;var Te=Math.floor,Fe=Math.random;var Ue=parseFloat,Le=Math.min,Be=Math.random;function Pe(t,s,i){if(i&&"boolean"!=typeof i&&function(t,s,i){if(!e(i))return!1;var a=typeof s;return!!("number"==a?O(i)&&q(s,i.length):"string"==a&&s in i)&&A(i[s],t)}(t,s,i)&&(s=i=void 0),void 0===i&&("boolean"==typeof s?(i=s,s=void 0):"boolean"==typeof t&&(i=t,t=void 0)),void 0===t&&void 0===s?(t=0,s=1):(t=le(t),void 0===s?(s=t,t=0):s=le(s)),t>s){var a=t;t=s,s=a}if(i||t%1||s%1){var n=Be();return Le(t+n*(s-t+Ue("1e-"+((n+"").length-1))),s)}return function(e,t){return e+Te(Fe()*(t-e+1))}(t,s)}var ze=Math.min;function Qe(e,t){if(e=function(e){var t=le(e),s=t%1;return t==t?s?t-s:t:0}(e),e<1||e>9007199254740991)return[];var s,i=4294967295,a=ze(e,4294967295);e-=4294967295;for(var n=K(a,t="function"==typeof(s=t)?s:oe);++i<e;)t(i);return n}class Je extends CustomEvent{constructor(e){super("change",{detail:e})}}let We,He,Ge=e=>e;class Ye extends a{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return h.styles}render(){return r(We||(We=Ge` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>r(He||(He=Ge` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new Je(this.value))}}let Xe,Ke,Ze=e=>e;class et extends a{static get styles(){return[h.styles,l(Xe||(Xe=Ze`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return r(Ke||(Ke=Ze` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let tt,st,it=e=>e;class at extends a{static get styles(){return[h.styles,l(tt||(tt=it`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return r(st||(st=it` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-bold text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let nt,rt,lt=e=>e;class ot extends at{static get styles(){return[super.styles,l(nt||(nt=lt`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return r(rt||(rt=lt` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-semibold text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let dt,ct=e=>e;class ut extends CustomEvent{constructor(e){super("change",{detail:e})}}class ht extends a{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return h.styles}render(){return r(dt||(dt=ct` <label class="${0}"> <span class="text-body text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),R({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),R({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),R({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new ut(this.checked))}))}}class _t extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class gt extends CustomEvent{static emit(e){return new Promise(((t,s)=>{const i=new gt(n({resolve:t,reject:s},e));e.source.dispatchEvent(i)&&s(new _t)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}let pt,vt=e=>e;class mt extends CustomEvent{constructor(e){super("change",{detail:e})}}class xt extends _{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":S,"vaadin-custom-field":p,"vaadin-select":f,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return r(pt||(pt=vt` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),R({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new mt({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let yt,ft=e=>e;class bt extends CustomEvent{constructor(e){super("change",{detail:e})}}class $t extends _{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":V,"vaadin-button":o,"iron-icon":customElements.get("iron-icon"),"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return r(yt||(yt=ft` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=Qe(72,(()=>Pe(35).toString(36))).join(""),this.dispatchEvent(new bt({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new bt({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function wt(e){return t=>{t.preventDefault(),e(t)}}class kt extends v{}let jt,Et=e=>e;class Ct extends _{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=Ct.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":$}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return r(jt||(jt=Et` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return I(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return I(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new kt(this.value))}}Ct.defaultValue="1w";class St extends Je{}let It,Rt,Vt,Mt,At=e=>e;class Ot extends _{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=Ct.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":Ct,"x-skeleton":w,"x-list":Ye,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return r(It||(It=At` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?r(Rt||(Rt=At`<span slot="${0}">${0}</span>`),t,this.__getText(e)):r(Vt||(Vt=At`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?r(Mt||(Mt=At` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,R({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=Ct.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new St(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class qt extends m{}let Nt,Dt,Tt=e=>e;class Ft extends _{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=g((e=>{try{se(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":x,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return r(Nt||(Nt=Tt` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?r(Dt||(Dt=Tt` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new qt(this.value))}}class Ut extends CustomEvent{constructor(e){super("change",{detail:e})}}class Lt extends CustomEvent{constructor(){super("remove")}}let Bt,Pt,zt=e=>e;class Qt extends _{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":Ot,"x-jsonata-input":Ft,"iron-icon":customElements.get("iron-icon"),"x-group":te,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return r(Bt||(Bt=zt` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),R({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,wt((()=>{this.dispatchEvent(new Lt)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=I(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return r(Pt||(Pt=zt` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=n(n({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new Ut(this.value))}}class Jt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Wt,Ht,Gt=e=>e;class Yt extends _{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":Qt,"vaadin-button":customElements.get("vaadin-button"),"x-section":ot,"iron-icon":customElements.get("iron-icon"),"x-group":te,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return r(Wt||(Wt=Gt` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.subtitle" slot="subtitle" class="mr-xl"></x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>r(Ht||(Ht=Gt` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,R({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new Jt(this.value))}}function Xt(e,t){const s=(new Date).getFullYear(),i={month:"long",day:"numeric"};return e.split("..").map((e=>{const a=ie(e),r=(null==a?void 0:a.getFullYear())===s?void 0:"numeric";return null==a?void 0:a.toLocaleDateString(t,n({year:r},i))})).join(" – ")}class Kt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Zt,es,ts,ss=e=>e;class is extends _{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":k,"x-weekday-picker":j,"x-choice":x,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return r(Zt||(Zt=ss` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?r(es||(es=ss` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?r(ts||(ts=ss` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new Kt(this.value))}}class as extends Je{}let ns,rs,ls,os,ds=e=>e;class cs extends _{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":ne,"vaadin-button":o,"x-skeleton":w,"iron-icon":customElements.get("iron-icon"),"x-i18n":b,"x-list":Ye}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return r(ns||(ns=ds` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?r(rs||(rs=ds`<span slot="${0}" class="truncate">${0}</span>`),t,Xt(e,this.lang)):r(ls||(ls=ds`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?r(os||(os=ds` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,R({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=ie(this.__endValue),s=ie(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new as(this.value))}}class us extends CustomEvent{constructor(e){super("change",{detail:e})}}let hs,_s,gs=e=>e;class ps extends _{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":Ct,"x-choice":x,"x-group":te,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return r(hs||(hs=gs` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?r(_s||(_s=gs` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=I(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new us(this.value))}}class vs extends CustomEvent{constructor(e){super("change",{detail:e})}}class ms extends CustomEvent{constructor(){super("remove")}}let xs,ys,fs,bs,$s,ws,ks,js,Es,Cs=e=>e;class Ss extends _{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":cs,"x-jsonata-input":Ft,"x-offset-input":ps,"x-allowed-days":is,"iron-icon":customElements.get("iron-icon"),"x-warning":ae,"x-group":te,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:t,allowedDays:s,jsonataQuery:i,disallowedDates:a}=this.value,l=e||t,o=s&&s.days.length>0,d=a&&a.length>0,c=this.open?"":"rounded-b-l";return r(xs||(xs=Cs` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),R({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),c,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",l||o||d?r(ys||(ys=Cs` <div> ${0} </div> `),E(l&&this.__renderMinMaxSummary(e,t),o&&this.__renderAllowedSummary(s),d&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,wt((()=>this.dispatchEvent(new ms))),this.ns,this.lang,this.ns,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,t,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,t)?r(fs||(fs=Cs` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=a?a:[],this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new vs(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=I(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return r(bs||(bs=Cs` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return r($s||($s=Cs` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return r(ws||(ws=Cs`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return r(ks||(ks=Cs` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} &mdash; ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?I(e):void 0),this.__renderMinMaxContent(t?I(t):void 0))}__renderAllowedSummary({type:e,days:t}){return r(js||(js=Cs` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>C(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return r(Es||(Es=Cs` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>Xt(e,this.lang))).join("; "))}}class Is extends CustomEvent{constructor(e){super("change",{detail:e})}}let Rs,Vs,Ms,As=e=>e;class Os extends _{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":Ss,"vaadin-button":customElements.get("vaadin-button"),"x-section":ot,"iron-icon":customElements.get("iron-icon"),"x-switch":ht,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return r(Rs||(Rs=As` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?r(Vs||(Vs=As` ${0} `),this.__normalizedValue.map(((e,t,s)=>r(Ms||(Ms=As` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,R({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Is(this.value))}}class qs extends Je{}let Ns,Ds,Ts,Fs=e=>e;class Us extends _{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":w,"iron-icon":customElements.get("iron-icon"),"x-group":te,"x-list":Ye,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return r(Ns||(Ns=Fs` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?r(Ds||(Ds=Fs` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):r(Ts||(Ts=Fs`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,R({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new qs(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}class Ls extends CustomEvent{constructor(e){super("change",{detail:e})}}let Bs,Ps=e=>e;class zs extends _{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":ot,"x-switch":ht,"x-i18n":b}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return r(Bs||(Bs=Ps` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sso.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="sso.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang)}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ls(this.value))}}const Qs=y.assign({error:(e,t)=>t.data.type}),Js=y.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),Ws=y.assign({oldResource:e=>e.newResource}),Hs=y.assign({invalid:[],newResource:({oldResource:e})=>e}),Gs=y.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:Qe(72,(()=>Pe(35).toString(36))).join(""),sessionLifespanInMinutes:40320,sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),Ys=y.assign({newResource:null}),Xs=y.assign({error:"setup_needed"}),Ks=y.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{allowedOrigins:s})}}),Zs=y.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowFrequencyModification:s})})}}),ei=y.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowNextDateModification:s})})}}),ti=y.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sessionLifespanInMinutes:s})}}),si=y.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{jwtSharedSecret:s})}}),ii=y.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),ai=y.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sso:s})}}),ni={SET_SSO:{target:"#cps.idle",actions:"setSSO"},SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},ri={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},li=Z({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:ni},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:n({on:ni},ri),updated:n({on:ni},ri),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>ee(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:Zs,setNextDateModification:ei,setOrigins:Ks,setSession:ti,setSecret:si,setHref:ii,setSSO:ai,handleLoadingSuccess:Js,handleSavingSuccess:Ws,handleError:Qs,create:Gs,reset:Hs,remove:Ys,requireSetup:Xs}});let oi,di,ci,ui,hi=e=>e;function _i(e){if(!e.ok)throw new c(401===e.status?"unauthorized":"unknown")}class gi extends CustomEvent{constructor(){super("ready")}}class pi extends CustomEvent{constructor(){super("update")}}class vi extends _{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=li.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=re(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":Yt,"x-next-date-modification":Os,"x-session-duration":xt,"x-session-secret":$t,"x-loading-screen":et,"x-error-screen":d,"x-origins-list":Us,"x-sso-switch":zs,"x-skeleton":w,"x-section":ot,"x-switch":ht,"x-i18n":b,"x-page":at}}static get properties(){return n(n({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,t,s,i,a,l;if(this.__service.state.matches("error"))return r(oi||(oi=hi` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:o}=this.__service.state.context,d=this.__service.state.matches("idle.dirty.created"),c=this.__service.state.matches("idle.dirty.deleted"),u=this.__service.state.matches("idle.dirty.updated"),h=this.__service.state.matches("idle.clean.enabled"),_=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return r(di||(di=hi` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-sso-switch data-testid="sso" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-sso-switch> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,h||d||u,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==o?void 0:o.allowedOrigins)&&void 0!==e?e:[],!o,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==o?void 0:o.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!o,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==o?void 0:o.subscriptions.allowNextDateModification)&&void 0!==s&&s,!o,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==o?void 0:o.sso)&&void 0!==i&&i,!o,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!o||!this._isI18nReady,null!==(a=null==o?void 0:o.sessionLifespanInMinutes)&&void 0!==a?a:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SESSION"},e))}),!o||!this._isI18nReady,null!==(l=null==o?void 0:o.jwtSharedSecret)&&void 0!==l?l:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?r(ci||(ci=hi` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),c?"error":"success",_,(()=>this.__service.send("SAVE")),this.lang,this.ns,d?"create":c?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?r(ui||(ui=hi`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new c("setup_needed");try{await this.updateComplete;const e=await gt.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await gt.emit({source:this,init:["/"]});_i(e);const i=(await e.json())._links["fx:store"].href,a=await gt.emit({source:this,init:[i]});_i(a),s=await a.json()}else{_i(e),t=await e.json();const i=t._links["fx:store"].href,a=await gt.emit({source:this,init:[i]});_i(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof c)throw e;if(e instanceof _t)throw new c("setup_needed");throw new c("unknown")}finally{await this.updateComplete,this.dispatchEvent(new gi)}}async __save(){try{const e=this.__service.state.context,t=De(e.newResource,5),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};_i(await gt.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof c)throw e;if(e instanceof _t)throw new c("setup_needed");throw new c("unknown")}finally{await this.updateComplete,this.dispatchEvent(new pi)}}}customElements.define("foxy-customer-portal-settings",vi);export{vi as CustomerPortalSettings};
@@ -1,4 +1,4 @@
1
- import"./foxy-customer.js";import"./shared-5a54a9bc.js";import"./shared-60126eee.js";import"./shared-46ee137f.js";import"./shared-9221e6b2.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as e,h as t,L as s,j as r,w as o}from"./shared-63eaded9.js";import{A as i}from"./shared-448781f9.js";import"./shared-59e44f29.js";import{C as n}from"./shared-21419f10.js";import{a,T as l,R as d}from"./shared-e68b9c83.js";import{A as c}from"./shared-7f0a9790.js";import{c as m}from"./shared-4e709717.js";import{C as h}from"./shared-df730f90.js";import{N as p}from"./shared-39e3ae67.js";import{i as u}from"./shared-6d45a07b.js";import"./shared-ff79f3f9.js";import"./foxy-attribute-card.js";import"./shared-11708514.js";import"./shared-5535f38f.js";import"./shared-7684cb05.js";import"./shared-756034e4.js";import"./foxy-attribute-form.js";import"./shared-223508ae.js";import"./shared-8b20bc23.js";import"./shared-073cb8e9.js";import"./shared-65dfd512.js";import"./shared-a040d79d.js";import"./shared-fab8c705.js";import"./shared-b0f0e8b5.js";import"./shared-c5de42f7.js";import"./shared-66633ff7.js";import"./shared-e2c878c7.js";import"./shared-02945b27.js";import"./shared-4dc6d228.js";import"./foxy-customer-form.js";import"./foxy-nucleon-element.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-a23cf7c8.js";import"./shared-20b9ce70.js";import"./shared-805d18a2.js";import"./shared-218ba06e.js";import"./foxy-cancellation-form.js";import"./shared-07049bfe.js";import"./shared-2061be9a.js";import"./shared-a7b6feb2.js";import"./shared-dcc9c325.js";import"./shared-b9f18aaa.js";import"./shared-b710881a.js";import"./shared-1a67bc75.js";import"./shared-0f38a631.js";import"./shared-f4ad24f4.js";let g,f,$=e=>e;class y extends(a(l(n),"customer-portal")){constructor(){super(...arguments),this.group=""}static get properties(){return e(e({},super.properties),{},{group:{type:String}})}render(){return this.api.storage.getItem(i.SESSION)?t(g||(g=$` <foxy-internal-customer-portal-logged-in-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" customer="${0}" group="${0}" class="h-full" lang="${0}" href="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.base,this.group,this.lang,new URL("./customer_portal_settings",this.base).toString(),this.ns,this.templates):t(f||(f=$` <foxy-internal-customer-portal-logged-out-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" group="${0}" class="h-full" lang="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-out-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.group,this.lang,this.ns,this.templates)}}let b,v,S=e=>e;const _=d(l(a(s)));let x,j,T,w,O=e=>e;class k extends(l(s)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return e(e({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=m({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),s=t(x||(x=O` ${0} <slot></slot> `),this.icon?t(j||(j=O`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?t(T||(T=O`<button class="${0}" disabled="disabled">${0}</button>`),e,s):t(w||(w=O` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,s)}}let R,z,E,A,F,I,N,H,U,q,L=e=>e;const P=l(h(a(p)));let C,D,V,J,W,B,G,K,M,Q,X=e=>e;const Y=l(h(a(s)));const Z=["html"],ee=["html"];let te,se,re,oe,ie,ne,ae,le,de,ce,me,he,pe=e=>e;const ue=a(h(l(s)));let ge,fe,$e,ye=e=>e;const be=h(l(a(s,"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends P{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var s,r,o;const i="customer:header:actions:sign-out",n=this.loggingOutState,a=!!(null===(s=this.__customerElement)||void 0===s?void 0:s.in({idle:"snapshot"}));return t(R||(R=L` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="padding:var(--lumo-space-xs);margin:0;border-radius:100%;display:flex" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${i}:before`),this.t("sign_out").toString(),this.disabledSelector.matches(i)||!a||"idle"!==n,(async function(){try{e.loggingOutState="busy",await new c(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===n?t(z||(z=L`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):t(E||(E=L` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> `),"fail"===n?"error":"busy",this.lang,this.ns,null!==(o=null===(r=customElements.get("foxy-customer"))||void 0===r?void 0:r.defaultNS)&&void 0!==o?o:""),this.renderTemplateOrSlot(`${i}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(A||(A=L`
1
+ import"./foxy-customer.js";import"./shared-666e8a90.js";import"./shared-3821923d.js";import"./shared-278a8b9d.js";import"./shared-9221e6b2.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as e,h as t,L as s,j as r,w as o}from"./shared-63eaded9.js";import{A as i}from"./shared-448781f9.js";import"./shared-59e44f29.js";import{C as n}from"./shared-21419f10.js";import{a,T as l,R as d}from"./shared-385ab830.js";import{A as c}from"./shared-7f0a9790.js";import{c as m}from"./shared-4e709717.js";import{C as h}from"./shared-df730f90.js";import{N as u}from"./shared-39e3ae67.js";import{i as p}from"./shared-6d45a07b.js";import"./shared-29db2caa.js";import"./foxy-attribute-card.js";import"./shared-b07ef791.js";import"./shared-5535f38f.js";import"./shared-7684cb05.js";import"./shared-756034e4.js";import"./foxy-attribute-form.js";import"./shared-7f463a38.js";import"./shared-9da4822a.js";import"./shared-bf6c685e.js";import"./shared-b20f463a.js";import"./shared-d9aed64e.js";import"./shared-e367b5fc.js";import"./shared-b0f0e8b5.js";import"./shared-4190da71.js";import"./shared-9783e5ce.js";import"./shared-ee53f7e5.js";import"./shared-da709e9d.js";import"./shared-15f2aeb5.js";import"./foxy-customer-form.js";import"./foxy-nucleon-element.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-db4aacb2.js";import"./shared-e8abe6c6.js";import"./shared-dd4971b5.js";import"./shared-218ba06e.js";import"./foxy-cancellation-form.js";import"./shared-4792a0b8.js";import"./shared-2061be9a.js";import"./shared-312fdfb6.js";import"./shared-56646cd3.js";import"./shared-a81a95e8.js";import"./shared-b710881a.js";import"./shared-cb71ddbc.js";import"./shared-31166bdc.js";import"./shared-24064bd3.js";let f,g,$=e=>e;class y extends(a(l(n),"customer-portal")){constructor(){super(...arguments),this.group=""}static get properties(){return e(e({},super.properties),{},{group:{type:String}})}render(){return this.api.storage.getItem(i.SESSION)?t(f||(f=$` <foxy-internal-customer-portal-logged-in-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" customer="${0}" group="${0}" class="h-full" lang="${0}" href="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.base,this.group,this.lang,new URL("./customer_portal_settings",this.base).toString(),this.ns,this.templates):t(g||(g=$` <foxy-internal-customer-portal-logged-out-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" group="${0}" class="h-full" lang="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-out-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.group,this.lang,this.ns,this.templates)}}let b,v,S=e=>e;const x=d(l(a(s)));let _,j,T,w,O=e=>e;class k extends(l(s)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return e(e({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=m({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),s=t(_||(_=O` ${0} <slot></slot> `),this.icon?t(j||(j=O`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?t(T||(T=O`<button class="${0}" disabled="disabled">${0}</button>`),e,s):t(w||(w=O` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,s)}}let E,R,z,N,A,F,I,H,U,q,L=e=>e;const P=l(h(a(u)));let C,D,V,J,W,B,G,K,M,Q,X=e=>e;const Y=l(h(a(s)));const Z=["html"],ee=["html"];let te,se,re,oe,ie,ne,ae,le,de,ce,me,he,ue=e=>e;const pe=a(h(l(s)));let fe,ge,$e,ye=e=>e;const be=h(l(a(s,"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends P{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var s,r,o,i,n;const a="customer:header:actions:sign-out",l=this.loggingOutState,d=this.disabledSelector.matches(a)||!(null===(s=this.__customerElement)||void 0===s?void 0:s.in({idle:"snapshot"}))||"idle"!==l,m={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:d?"default":"pointer"};return t(E||(E=L` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),this.t("sign_out").toString(),Object.entries(m).reduce(((e,[t,s])=>`${e}${t}:${s};`),""),d,(async function(){try{e.loggingOutState="busy",await new c(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===l?t(R||(R=L`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):t(z||(z=L` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===l?"error":"busy",this.lang,[this.ns,null!==(o=null===(r=customElements.get("foxy-customer"))||void 0===r?void 0:r.defaultNS)&&void 0!==o?o:"",null!==(n=null===(i=customElements.get("foxy-spinner"))||void 0===i?void 0:i.defaultNS)&&void 0!==n?n:""].join(" ")),this.renderTemplateOrSlot(`${a}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(N||(N=L`
2
2
  ${0}
3
3
 
4
4
  <foxy-internal-customer-portal-subscriptions
@@ -15,7 +15,7 @@ import"./foxy-customer.js";import"./shared-5a54a9bc.js";import"./shared-60126eee
15
15
  </foxy-internal-customer-portal-subscriptions>
16
16
 
17
17
  ${0}
18
- `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),this.hiddenSelector.zoom(s).toString(),t.group,t.lang,t.ns,this.getNestedTemplates(s),this.data,t.data,this.renderTemplateOrSlot(`${s}:after`))},this.__renderTransactions=(e,t)=>{const s="customer:transactions";return e(F||(F=L`
18
+ `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),this.hiddenSelector.zoom(s).toString(),t.group,t.lang,t.ns,this.getNestedTemplates(s),this.data,t.data,this.renderTemplateOrSlot(`${s}:after`))},this.__renderTransactions=(e,t)=>{const s="customer:transactions";return e(A||(A=L`
19
19
  ${0}
20
20
 
21
21
  <foxy-internal-customer-portal-transactions
@@ -31,12 +31,12 @@ import"./foxy-customer.js";import"./shared-5a54a9bc.js";import"./shared-60126eee
31
31
  </foxy-internal-customer-portal-transactions>
32
32
 
33
33
  ${0}
34
- `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),this.hiddenSelector.zoom(s).toString(),t.group,t.lang,t.ns,this.getNestedTemplates(s),t.data,this.renderTemplateOrSlot(`${s}:after`))}}static get properties(){return e(e({},super.properties),{},{customer:{type:String},loggingOutState:{attribute:!1},loggingOutStateResetTimeout:{attribute:!1}})}render(){var e,s;const r=this.hiddenSelector.zoom("customer"),o=[...["payment-methods"].filter((e=>r.matches(e))).map((e=>`${e}:${r.zoom(e)}`)),...["attributes","transactions","subscriptions","addresses:actions:create","header:actions:edit:form:delete"].map((e=>{const t=e.split(":");for(let e=0;e<t.length;++e){const s=t.slice(0,e+1).join(":");if(r.matches(s,!0))return s}return e}))],i=this.getNestedTemplates("customer"),n=i["header:actions:after"],a=i["header:actions:edit:form:timestamps:after"],l=i.default;return i["header:actions:after"]=(e,t)=>{const s=r.matches("header:actions:sign-out",!0);return e(I||(I=L`
34
+ `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),this.hiddenSelector.zoom(s).toString(),t.group,t.lang,t.ns,this.getNestedTemplates(s),t.data,this.renderTemplateOrSlot(`${s}:after`))}}static get properties(){return e(e({},super.properties),{},{customer:{type:String},loggingOutState:{attribute:!1},loggingOutStateResetTimeout:{attribute:!1}})}render(){var e,s;const r=this.hiddenSelector.zoom("customer"),o=[...["payment-methods"].filter((e=>r.matches(e))).map((e=>`${e}:${r.zoom(e)}`)),...["attributes","transactions","subscriptions","addresses:actions:create","header:actions:edit:form:delete"].map((e=>{const t=e.split(":");for(let e=0;e<t.length;++e){const s=t.slice(0,e+1).join(":");if(r.matches(s,!0))return s}return e}))],i=this.getNestedTemplates("customer"),n=i["header:actions:after"],a=i["header:actions:edit:form:timestamps:after"],l=i.default;return i["header:actions:after"]=(e,t)=>{const s=r.matches("header:actions:sign-out",!0);return e(F||(F=L`
35
35
  <div style="display:flex">
36
36
  ${0}
37
37
  ${0}
38
38
  </div>
39
- `),s?"":this.__renderHeaderActionsSignOut(),null==n?void 0:n(e,t))},i.default=(e,t)=>{const s=this.__renderSubscriptions,o=this.__renderTransactions;return e(N||(N=L`
39
+ `),s?"":this.__renderHeaderActionsSignOut(),null==n?void 0:n(e,t))},i.default=(e,t)=>{const s=this.__renderSubscriptions,o=this.__renderTransactions;return e(I||(I=L`
40
40
  <style>
41
41
  .space-y-m > :not([hidden]) ~ :not([hidden]) {
42
42
  --tw-space-y-reverse: 0;
@@ -69,7 +69,7 @@ import"./foxy-customer.js";import"./shared-5a54a9bc.js";import"./shared-60126eee
69
69
  </foxy-internal-customer-portal-change-password>
70
70
 
71
71
  ${0}
72
- `),t.renderTemplateOrSlot(`${o}:before`),t.href,null!==(r=null===(s=t.data)||void 0===s?void 0:s.email)&&void 0!==r?r:"",t.lang,t.ns,t.in("busy")||t.disabledSelector.matches(o,!0),t.renderTemplateOrSlot(`${o}:after`)))},t(q||(q=L` <foxy-customer readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="customer" group="${0}" href="${0}" lang="${0}" ns="${0} ${0}" id="customer" .templates="${0}" @update="${0}"> </foxy-customer> `),this.readonlySelector.zoom("customer").toString(),this.disabledSelector.zoom("customer").toString(),o.join(" "),this.group,this.customer,this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-customer"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",i,(()=>this.requestUpdate()))}disconnectedCallback(){super.disconnectedCallback(),this.loggingOutStateResetTimeout&&clearTimeout(this.loggingOutStateResetTimeout)}get __customerElement(){return this.renderRoot.querySelector("#customer")}}),customElements.define("foxy-internal-customer-portal-logged-out-view",class extends Y{constructor(){super(...arguments),this.group="",this.page="sign-in",this.__renderAccessRecoveryHeader=()=>{const{lang:e,ns:s}=this,r=this.renderRoot.querySelector("#access-recovery-form"),o=!!(null==r?void 0:r.in("busy"));return t(C||(C=X` <div class="flex flex-col leading-m font-lumo" data-testid="access-recovery:header"> ${0} <foxy-i18n class="text-xxl font-bold ${0}" lang="${0}" key="recover_access" ns="${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="recover_access_hint" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:header:before"),o?"text-disabled":"text-body",e,s,o?"text-disabled":"text-secondary",e,s,this.renderTemplateOrSlot("access-recovery:header:after"))},this.__renderAccessRecoveryBack=()=>{const e=this.renderRoot.querySelector("#access-recovery-form"),s=this.disabledSelector.zoom("access-recovery");return t(D||(D=X` <div> ${0} <vaadin-button data-testid="access-recovery:back" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="back"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:back:before"),!!(null==e?void 0:e.in("busy"))||s.matches("back",!0),(()=>this.page="sign-in"),this.ns,this.lang,this.renderTemplateOrSlot("access-recovery:back:after"))},this.__renderAccessRecoveryForm=()=>{var e,s;const r="access-recovery:form",o=this.hiddenSelector.zoom(r);return t(V||(V=X` <div> ${0} <foxy-access-recovery-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="access-recovery:form" parent="foxy://customer-api/recover" group="${0}" lang="${0}" ns="${0} ${0}" id="access-recovery-form" .templates="${0}" @update="${0}"> </foxy-access-recovery-form> ${0} </div> `),this.renderTemplateOrSlot(`${r}:before`),this.readonlySelector.zoom(r).toString(),this.disabledSelector.zoom(r).toString(),o.toString(),this.group,this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",this.getNestedTemplates(r),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${r}:after`))},this.__renderAccessRecovery=()=>{const e="access-recovery",s=this.hiddenSelector.zoom(e);return t(J||(J=X` <div class="h-full flex" data-testid="access-recovery"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${e}:before`),s.matches("header",!0)?"":this.__renderAccessRecoveryHeader(),s.matches("form",!0)?"":this.__renderAccessRecoveryForm(),s.matches("back",!0)?"":this.__renderAccessRecoveryBack(),this.renderTemplateOrSlot(`${e}:after`))},this.__renderSignInHeader=()=>{const{lang:e,ns:s}=this,r=this.renderRoot.querySelector("#sign-in-form"),o=!!(null==r?void 0:r.in("busy"));return t(W||(W=X` <div class="flex flex-col leading-m font-lumo" data-testid="sign-in:header"> ${0} <foxy-i18n class="text-xxl font-bold ${0}" lang="${0}" key="sign_in" ns="${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="sign_in_hint" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("sign-in:header:before"),o?"text-disabled":"text-body",e,s,o?"text-disabled":"text-secondary",e,s,this.renderTemplateOrSlot("sign-in:header:after"))},this.__renderSignInRecover=()=>{const e=this.renderRoot.querySelector("#sign-in-form"),s=this.disabledSelector.zoom("sign-in");return t(B||(B=X` <div> ${0} <vaadin-button data-testid="sign-in:recover" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="recover_access"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-in:recover:before"),!!(null==e?void 0:e.in("busy"))||s.matches("recover",!0),(()=>this.page="access-recovery"),this.ns,this.lang,this.renderTemplateOrSlot("sign-in:recover:after"))},this.__renderSignInForm=()=>{var e,s;const r="sign-in:form",o=this.hiddenSelector.zoom(r);return t(G||(G=X` <div> ${0} <foxy-sign-in-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="sign-in:form" parent="foxy://customer-api/session" group="${0}" lang="${0}" id="sign-in-form" ns="${0} ${0}" .templates="${0}" @update="${0}"> </foxy-sign-in-form> ${0} </div> `),this.renderTemplateOrSlot(`${r}:before`),this.readonlySelector.zoom(r).toString(),this.disabledSelector.zoom(r).toString(),o.toString(),this.group,this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",this.getNestedTemplates("sign-in:form"),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${r}:after`))},this.__renderSignIn=()=>{const e="sign-in",s=this.hiddenSelector.zoom(e);return t(K||(K=X` <div class="h-full flex" data-testid="sign-in"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot("sign-in:before"),s.matches("header",!0)?"":this.__renderSignInHeader(),s.matches("form",!0)?"":this.__renderSignInForm(),s.matches("recover",!0)?"":this.__renderSignInRecover(),this.renderTemplateOrSlot("sign-in:after"))}}static get properties(){return e(e({},super.properties),{},{group:{type:String},page:{type:String}})}static get styles(){return[super.styles,r(M||(M=X`.max-w-20rem{max-width:20rem}`))]}render(){const{page:e,hiddenSelector:s}=this;return"access-recovery"!==e||s.matches("access-recovery",!0)?"sign-in"!==e||s.matches("sign-in",!0)?t(Q||(Q=X``)):this.__renderSignIn():this.__renderAccessRecovery()}}),customElements.define("foxy-internal-customer-portal-subscriptions",class extends ue{constructor(){super(...arguments),this.settings=null,this.customer=null,this.group="",this.__renderFormHeaderActionsUpdate=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();let o="";if(!r&&t.in({idle:"snapshot"})){const e=t.data._links["fx:sub_token_url"].href,s=new URL(e);s.searchParams.set("cart","checkout"),s.searchParams.set("sub_restart","auto"),o=s.toString()}return e(te||(te=pe`
72
+ `),t.renderTemplateOrSlot(`${o}:before`),t.href,null!==(r=null===(s=t.data)||void 0===s?void 0:s.email)&&void 0!==r?r:"",t.lang,t.ns,t.in("busy")||t.disabledSelector.matches(o,!0),t.renderTemplateOrSlot(`${o}:after`)))},t(q||(q=L` <foxy-customer readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="customer" group="${0}" href="${0}" lang="${0}" ns="${0} ${0}" id="customer" .templates="${0}" @update="${0}"> </foxy-customer> `),this.readonlySelector.zoom("customer").toString(),this.disabledSelector.zoom("customer").toString(),o.join(" "),this.group,this.customer,this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-customer"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",i,(()=>this.requestUpdate()))}disconnectedCallback(){super.disconnectedCallback(),this.loggingOutStateResetTimeout&&clearTimeout(this.loggingOutStateResetTimeout)}get __customerElement(){return this.renderRoot.querySelector("#customer")}}),customElements.define("foxy-internal-customer-portal-logged-out-view",class extends Y{constructor(){super(...arguments),this.group="",this.page="sign-in",this.__renderAccessRecoveryHeader=()=>{var e,s,r,o;const{lang:i,ns:n}=this,a=this.renderRoot.querySelector("#access-recovery-form"),l=!!(null==a?void 0:a.in("busy"));return t(C||(C=X` <div class="flex flex-col leading-m font-lumo" data-testid="access-recovery:header"> ${0} <foxy-i18n class="text-xxl font-bold ${0}" lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="recover_access_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:header:before"),l?"text-disabled":"text-body",i,n,null!==(s=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",l?"text-disabled":"text-secondary",i,n,null!==(o=null===(r=customElements.get("foxy-access-recovery-form"))||void 0===r?void 0:r.defaultNS)&&void 0!==o?o:"",this.renderTemplateOrSlot("access-recovery:header:after"))},this.__renderAccessRecoveryBack=()=>{var e,s;const r=this.renderRoot.querySelector("#access-recovery-form"),o=this.disabledSelector.zoom("access-recovery");return t(D||(D=X` <div> ${0} <vaadin-button data-testid="access-recovery:back" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="back" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:back:before"),!!(null==r?void 0:r.in("busy"))||o.matches("back",!0),(()=>this.page="sign-in"),this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",this.renderTemplateOrSlot("access-recovery:back:after"))},this.__renderAccessRecoveryForm=()=>{var e,s;const r="access-recovery:form",o=this.hiddenSelector.zoom(r);return t(V||(V=X` <div> ${0} <foxy-access-recovery-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="access-recovery:form" parent="foxy://customer-api/recover" group="${0}" lang="${0}" ns="${0} ${0}" id="access-recovery-form" .templates="${0}" @update="${0}"> </foxy-access-recovery-form> ${0} </div> `),this.renderTemplateOrSlot(`${r}:before`),this.readonlySelector.zoom(r).toString(),this.disabledSelector.zoom(r).toString(),o.toString(),this.group,this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",this.getNestedTemplates(r),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${r}:after`))},this.__renderAccessRecovery=()=>{const e="access-recovery",s=this.hiddenSelector.zoom(e);return t(J||(J=X` <div class="h-full flex" data-testid="access-recovery"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${e}:before`),s.matches("header",!0)?"":this.__renderAccessRecoveryHeader(),s.matches("form",!0)?"":this.__renderAccessRecoveryForm(),s.matches("back",!0)?"":this.__renderAccessRecoveryBack(),this.renderTemplateOrSlot(`${e}:after`))},this.__renderSignInHeader=()=>{var e,s,r,o;const{lang:i,ns:n}=this,a=this.renderRoot.querySelector("#sign-in-form"),l=!!(null==a?void 0:a.in("busy"));return t(W||(W=X` <div class="flex flex-col leading-m font-lumo" data-testid="sign-in:header"> ${0} <foxy-i18n class="text-xxl font-bold ${0}" lang="${0}" key="sign_in" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="sign_in_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("sign-in:header:before"),l?"text-disabled":"text-body",i,n,null!==(s=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",l?"text-disabled":"text-secondary",i,n,null!==(o=null===(r=customElements.get("foxy-sign-in-form"))||void 0===r?void 0:r.defaultNS)&&void 0!==o?o:"",this.renderTemplateOrSlot("sign-in:header:after"))},this.__renderSignInRecover=()=>{var e,s;const r=this.renderRoot.querySelector("#sign-in-form"),o=this.disabledSelector.zoom("sign-in");return t(B||(B=X` <div> ${0} <vaadin-button data-testid="sign-in:recover" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-in:recover:before"),!!(null==r?void 0:r.in("busy"))||o.matches("recover",!0),(()=>this.page="access-recovery"),this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",this.renderTemplateOrSlot("sign-in:recover:after"))},this.__renderSignInForm=()=>{var e,s;const r="sign-in:form",o=this.hiddenSelector.zoom(r);return t(G||(G=X` <div> ${0} <foxy-sign-in-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="sign-in:form" parent="foxy://customer-api/session" group="${0}" lang="${0}" id="sign-in-form" ns="${0} ${0}" .templates="${0}" @update="${0}"> </foxy-sign-in-form> ${0} </div> `),this.renderTemplateOrSlot(`${r}:before`),this.readonlySelector.zoom(r).toString(),this.disabledSelector.zoom(r).toString(),o.toString(),this.group,this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"",this.getNestedTemplates("sign-in:form"),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${r}:after`))},this.__renderSignIn=()=>{const e="sign-in",s=this.hiddenSelector.zoom(e);return t(K||(K=X` <div class="h-full flex" data-testid="sign-in"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot("sign-in:before"),s.matches("header",!0)?"":this.__renderSignInHeader(),s.matches("form",!0)?"":this.__renderSignInForm(),s.matches("recover",!0)?"":this.__renderSignInRecover(),this.renderTemplateOrSlot("sign-in:after"))}}static get properties(){return e(e({},super.properties),{},{group:{type:String},page:{type:String}})}static get styles(){return[super.styles,r(M||(M=X`.max-w-20rem{max-width:20rem}`))]}render(){const{page:e,hiddenSelector:s}=this;return"access-recovery"!==e||s.matches("access-recovery",!0)?"sign-in"!==e||s.matches("sign-in",!0)?t(Q||(Q=X``)):this.__renderSignIn():this.__renderAccessRecovery()}}),customElements.define("foxy-internal-customer-portal-subscriptions",class extends pe{constructor(){super(...arguments),this.settings=null,this.customer=null,this.group="",this.__renderFormHeaderActionsUpdate=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();let o="";if(!r&&t.in({idle:"snapshot"})){const e=t.data._links["fx:sub_token_url"].href,s=new URL(e);s.searchParams.set("cart","checkout"),s.searchParams.set("sub_restart","auto"),o=s.toString()}return e(te||(te=ue`
73
73
  ${0}
74
74
 
75
75
  <foxy-internal-customer-portal-link
@@ -82,7 +82,7 @@ import"./foxy-customer.js";import"./shared-5a54a9bc.js";import"./shared-60126eee
82
82
  </foxy-internal-customer-portal-link>
83
83
 
84
84
  ${0}
85
- `),t.renderTemplateOrSlot("header:actions:update:before"),o,r||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("header:actions:update:after"))},this.__renderFormHeaderActionsEnd=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date);let o="";if(!r&&t.in({idle:"snapshot"})){const e=new URL(t.data._links["fx:sub_token_url"].href);e.searchParams.set("sub_cancel","true"),o=e.toString()}return e(se||(se=pe`
85
+ `),t.renderTemplateOrSlot("header:actions:update:before"),o,r||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("header:actions:update:after"))},this.__renderFormHeaderActionsEnd=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date);let o="";if(!r&&t.in({idle:"snapshot"})){const e=new URL(t.data._links["fx:sub_token_url"].href);e.searchParams.set("sub_cancel","true"),o=e.toString()}return e(se||(se=ue`
86
86
  ${0}
87
87
 
88
88
  <foxy-internal-customer-portal-link
@@ -95,7 +95,7 @@ import"./foxy-customer.js";import"./shared-5a54a9bc.js";import"./shared-60126eee
95
95
  </foxy-internal-customer-portal-link>
96
96
 
97
97
  ${0}
98
- `),t.renderTemplateOrSlot("header:actions:end:before"),o,r||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("header:actions:end:after"))},this.__renderFormHeaderActions=(e,t)=>{const s=t.hiddenSelector.matches("header:actions:update"),r=t.hiddenSelector.matches("header:actions:end");return e(re||(re=pe`
98
+ `),t.renderTemplateOrSlot("header:actions:end:before"),o,r||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("header:actions:end:after"))},this.__renderFormHeaderActions=(e,t)=>{const s=t.hiddenSelector.matches("header:actions:update"),r=t.hiddenSelector.matches("header:actions:end");return e(re||(re=ue`
99
99
  <style>
100
100
  main {
101
101
  display: flex;
@@ -115,7 +115,7 @@ import"./foxy-customer.js";import"./shared-5a54a9bc.js";import"./shared-60126eee
115
115
  </main>
116
116
 
117
117
  ${0}
118
- `),t.renderTemplateOrSlot("header:actions:before"),s?"":this.__renderFormHeaderActionsUpdate(e,t),r?"":this.__renderFormHeaderActionsEnd(e,t),t.renderTemplateOrSlot("header:actions:after"))},this.__renderFormItemsActionsUpdate=(e,t)=>{var s,r,o,i;const n=null!==(o=null===(r=null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"])||void 0===r?void 0:r.href)&&void 0!==o?o:"",a=!!(null===(i=t.data)||void 0===i?void 0:i.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();return e(oe||(oe=pe`
118
+ `),t.renderTemplateOrSlot("header:actions:before"),s?"":this.__renderFormHeaderActionsUpdate(e,t),r?"":this.__renderFormHeaderActionsEnd(e,t),t.renderTemplateOrSlot("header:actions:after"))},this.__renderFormItemsActionsUpdate=(e,t)=>{var s,r,o,i;const n=null!==(o=null===(r=null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"])||void 0===r?void 0:r.href)&&void 0!==o?o:"",a=!!(null===(i=t.data)||void 0===i?void 0:i.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();return e(oe||(oe=ue`
119
119
  ${0}
120
120
 
121
121
  <foxy-internal-customer-portal-link
@@ -128,13 +128,13 @@ import"./foxy-customer.js";import"./shared-5a54a9bc.js";import"./shared-60126eee
128
128
  </foxy-internal-customer-portal-link>
129
129
 
130
130
  ${0}
131
- `),t.renderTemplateOrSlot("items:actions:update:before"),n,a||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("items:actions:update:after"))},this.__renderForm=s=>{const r=e({},s.dialog.templates),o=r["header:after"],i=r["items:actions:after"];return r["header:after"]=(e,t)=>{const s=t.hiddenSelector.matches("header:actions",!0);return e(ie||(ie=pe`
131
+ `),t.renderTemplateOrSlot("items:actions:update:before"),n,a||!t.in("idle"),t.lang,t.ns,t.renderTemplateOrSlot("items:actions:update:after"))},this.__renderForm=s=>{var r,o;const i=e({},s.dialog.templates),n=i["header:after"],a=i["items:actions:after"];return i["header:after"]=(e,t)=>{const s=t.hiddenSelector.matches("header:actions",!0);return e(ie||(ie=ue`
132
132
  ${0}
133
133
  ${0}
134
- `),s?"":this.__renderFormHeaderActions(e,t),null==o?void 0:o(e,t))},r["items:actions:after"]=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"]),o=t.hiddenSelector.matches("items:actions:update",!0);return e(ne||(ne=pe`
134
+ `),s?"":this.__renderFormHeaderActions(e,t),null==n?void 0:n(e,t))},i["items:actions:after"]=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s._links["fx:sub_modification_url"]),o=t.hiddenSelector.matches("items:actions:update",!0);return e(ne||(ne=ue`
135
135
  ${0}
136
136
  ${0}
137
- `),r&&!o?this.__renderFormItemsActionsUpdate(e,t):"",null==i?void 0:i(e,t))},t(ae||(ae=pe` <foxy-subscription-form disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" settings="${0}" parent="${0}" group="${0}" lang="${0}" href="${0}" ns="${0}" id="form" .templates="${0}" @update="${0}" @fetch="${0}"> </foxy-subscription-form> `),s.dialog.disabledControls.toString(),s.dialog.readonlyControls.toString(),s.dialog.hiddenControls.toString(),JSON.stringify(this.settings),s.dialog.parent,s.dialog.group,s.dialog.lang,s.dialog.href,s.dialog.ns,r,s.handleUpdate,s.handleFetch)},this.__renderPageItem=e=>{let{html:t}=e,s=o(e,Z);var r,i;return t(le||(le=pe`
137
+ `),r&&!o?this.__renderFormItemsActionsUpdate(e,t):"",null==a?void 0:a(e,t))},t(ae||(ae=ue` <foxy-subscription-form disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" settings="${0}" parent="${0}" group="${0}" lang="${0}" href="${0}" ns="${0} ${0}" id="form" .templates="${0}" @update="${0}" @fetch="${0}"> </foxy-subscription-form> `),s.dialog.disabledControls.toString(),s.dialog.readonlyControls.toString(),s.dialog.hiddenControls.toString(),JSON.stringify(this.settings),s.dialog.parent,s.dialog.group,s.dialog.lang,s.dialog.href,s.dialog.ns,null!==(o=null===(r=customElements.get("foxy-subscription-form"))||void 0===r?void 0:r.defaultNS)&&void 0!==o?o:"",i,s.handleUpdate,s.handleFetch)},this.__renderPageItem=e=>{let{html:t}=e,s=o(e,Z);var r,i;return t(le||(le=ue`
138
138
  <button
139
139
  class=${0}
140
140
  ?disabled=${0}
@@ -150,7 +150,7 @@ import"./foxy-customer.js";import"./shared-5a54a9bc.js";import"./shared-60126eee
150
150
  >
151
151
  </foxy-subscription-card>
152
152
  </button>
153
- `),m({"block w-full border border-contrast-10 p-m rounded-t-l rounded-b-l":!0,"focus-outline-none focus-border-primary":!0,"hover-border-contrast-30":null!==s.data}),null===s.data,(e=>{const t=new URL(s.href);t.searchParams.set("zoom","last_transaction,transaction_template:items"),this.__subscriptionDialog.href=t.toString(),this.__subscriptionDialog.show(e.currentTarget)}),s.parent,s.group,s.lang,s.href,s.ns,null!==(i=null===(r=customElements.get("foxy-subscription-card"))||void 0===r?void 0:r.defaultNS)&&void 0!==i?i:"",s.templates)},this.__renderPage=e=>{let{html:t}=e,s=o(e,ee);return t(de||(de=pe`
153
+ `),m({"block w-full border border-contrast-10 p-m rounded-t-l rounded-b-l":!0,"focus-outline-none focus-border-primary":!0,"hover-border-contrast-30":null!==s.data}),null===s.data,(e=>{const t=new URL(s.href);t.searchParams.set("zoom","last_transaction,transaction_template:items"),this.__subscriptionDialog.href=t.toString(),this.__subscriptionDialog.show(e.currentTarget)}),s.parent,s.group,s.lang,s.href,s.ns,null!==(i=null===(r=customElements.get("foxy-subscription-card"))||void 0===r?void 0:r.defaultNS)&&void 0!==i?i:"",s.templates)},this.__renderPage=e=>{let{html:t}=e,s=o(e,ee);return t(de||(de=ue`
154
154
  <foxy-collection-page
155
155
  ns=${0}
156
156
  href=${0}
@@ -161,4 +161,4 @@ import"./foxy-customer.js";import"./shared-5a54a9bc.js";import"./shared-60126eee
161
161
  .templates=${0}
162
162
  >
163
163
  </foxy-collection-page>
164
- `),s.ns,s.href,s.lang,s.group,this.__renderPageItem,s.templates)},this.__renderHeader=()=>t(ce||(ce=pe` ${0} <foxy-i18n class="block text-l font-semibold" lang="${0}" key="subscription_plural" ns="${0}"> </foxy-i18n> ${0} `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{var e;const s=this.disabledSelector.zoom("list"),r=this.readonlySelector.zoom("list"),o=[this.hiddenSelector.zoom("list").zoom("form").toString(),"end-date"];return t(me||(me=pe` ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" header="update" parent="${0}" group="${0}" lang="${0}" ns="${0}" id="subscription-dialog" .form="${0}" .templates="${0}"> </foxy-form-dialog> <foxy-collection-pages class="block space-y-m" first="${0}" group="${0}" lang="${0}" ns="${0}" manual .page="${0}" .templates="${0}"> </foxy-collection-pages> ${0} `),this.renderTemplateOrSlot("list:before"),r.zoom("form").toString(),s.zoom("form").toString(),o.join(" ").trim(),u(null===(e=this.customer)||void 0===e?void 0:e._links["fx:subscriptions"].href),this.group,this.lang,this.ns,this.__renderForm,this.getNestedTemplates("list:form"),this.__activeSubscriptionsLink,this.group,this.lang,this.ns,this.__renderPage,this.getNestedTemplates("list:card"),this.renderTemplateOrSlot("list:after"))}}static get properties(){return e(e({},super.properties),{},{settings:{attribute:!1},customer:{attribute:!1},group:{type:String}})}render(){return t(he||(he=pe` <div class="space-y-s" data-testid="subscriptions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(),this.hiddenSelector.matches("list",!0)?"":this.__renderList())}get __subscriptionDialog(){return this.renderRoot.querySelector("#subscription-dialog")}get __activeSubscriptionsLink(){try{const e=new URL(this.customer._links["fx:subscriptions"].href);return e.searchParams.set("zoom","last_transaction,transaction_template:items"),e.toString()}catch(e){return""}}}),customElements.define("foxy-internal-customer-portal-transactions",class extends be{constructor(){super(...arguments),this.customer=null,this.group="",this.__renderHeader=()=>t(ge||(ge=ye` <div> ${0} <foxy-i18n class="text-l font-semibold" lang="${0}" key="transaction_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{let e="";if(this.customer){const t=new URL(this.customer._links["fx:transactions"].href);t.searchParams.set("zoom","items"),e=t.toString()}return t(fe||(fe=ye` <div> ${0} <foxy-collection-pages spinner="foxy-spinner" group="${0}" first="${0}" class="block divide-y divide-contrast-10 px-m border border-contrast-10 rounded-t-l rounded-b-l" page="foxy-transactions-table" lang="${0}" ns="${0}" manual .templates="${0}"> </foxy-collection-pages> ${0} </div> `),this.renderTemplateOrSlot("list:before"),this.group,e,this.lang,this.ns,this.getNestedTemplates("table"),this.renderTemplateOrSlot("list:after"))}}static get properties(){return e(e({},super.properties),{},{customer:{attribute:!1},group:{type:String}})}render(){return t($e||($e=ye` <div class="space-y-s" data-testid="transactions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header")?"":this.__renderHeader(),this.hiddenSelector.matches("list")?"":this.__renderList())}}),customElements.define("foxy-internal-customer-portal-change-password",class extends _{constructor(){super(...arguments),this.isErrorVisible=!1,this.disabled=!1,this.customer="",this.session="",this.email="",this.step=1,this.__handleTriggerClick=e=>{const t=e.currentTarget,s=this.renderRoot.querySelector("#dialog");this.isErrorVisible=!1,this.step=1,s.show(t)},this.__handleSignInFormUpdate=(e,t)=>{var s,r,o,i;t.handleUpdate(e);const n=e.currentTarget;!(null===(s=n.form.credential)||void 0===s?void 0:s.email)&&this.email&&n.edit({type:null!==(r=n.form.type)&&void 0!==r?r:"password",credential:{email:this.email,password:null!==(i=null===(o=n.form.credential)||void 0===o?void 0:o.password)&&void 0!==i?i:""}})},this.__handleSignInFormFetch=e=>{e.defaultPrevented||"POST"===e.request.method&&e.request.url===this.session&&(e.preventDefault(),e.stopImmediatePropagation(),e.respondWith(this.__getResponse(e.request)))},this.__renderSignInForm=e=>{const s=[],r=["email"];let o="bg-primary-10",i="text-primary",n="icons:lock-outline",a="password:before";return 2===this.step&&(r.push("password"),a="new-password:before",n="icons:lock-open"),3===this.step&&(s.push("new-password"),r.push("password","submit"),o="bg-success-10",i="text-success",a="new-password:before",n="icons:done-all"),this.isErrorVisible||r.push("error"),t(b||(b=S` <foxy-sign-in-form readonlycontrols="${0}" hiddencontrols="${0}" parent="${0}" class="mt-s sm-w-narrow-modal" lang="${0}" ns="${0}" @update="${0}" @fetch="${0}"> <div class="mx-auto flex mb-m w-l h-l rounded-t-l rounded-b-l ${0}" slot="${0}"> <iron-icon icon="${0}" class="m-auto ${0}"></iron-icon> </div> <foxy-i18n class="block text-center text-m text-secondary leading-m mb-m" lang="${0}" slot="${0}" key="change_password_step_${0}" ns="${0}"> </foxy-i18n> </foxy-sign-in-form> `),s.join(" "),r.join(" "),this.session,e.dialog.lang,e.dialog.ns,(t=>this.__handleSignInFormUpdate(t,e)),this.__handleSignInFormFetch,o,a,n,i,e.dialog.lang,a,this.step,e.dialog.ns)}}static get properties(){return e(e({},super.properties),{},{isErrorVisible:{attribute:!1},disabled:{type:Boolean},customer:{type:String},session:{type:String},email:{type:String},step:{attribute:!1},fail:{attribute:!1}})}render(){return t(v||(v=S` <foxy-form-dialog hiddencontrols="save-button" header="change_password" lang="${0}" ns="${0}" alert id="dialog" .form="${0}"> </foxy-form-dialog> <vaadin-button class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="change_password" ns="${0}"></foxy-i18n> </vaadin-button> `),this.lang,this.ns,this.__renderSignInForm,this.disabled,this.__handleTriggerClick,this.lang,this.ns)}async __getResponse(e){const t=await e.clone().json(),s=new c(this);if(this.isErrorVisible=!1,1===this.step){const r=await s.fetch(e.url,{method:e.method,body:JSON.stringify(t)});if(r.ok){this.step=2;const e={_embedded:{"fx:errors":[{code:"new_password_required_error"}]}};return new c.WHATWGResponse(JSON.stringify(e),{status:400})}return this.isErrorVisible=!0,r}if(2===this.step){const r=await s.fetch(this.customer,{method:"PATCH",body:JSON.stringify({password:t.credential.new_password,password_old:t.credential.password})});return r.ok?(this.step=3,t._links={self:{href:e.url}},new c.WHATWGResponse(JSON.stringify(t))):(this.isErrorVisible=!0,r)}return s.fetch(e)}}),customElements.define("foxy-internal-customer-portal-link",k),customElements.define("foxy-customer-portal",y);export{y as CustomerPortal};
164
+ `),s.ns,s.href,s.lang,s.group,this.__renderPageItem,s.templates)},this.__renderHeader=()=>t(ce||(ce=ue` ${0} <foxy-i18n class="block text-l font-semibold" lang="${0}" key="subscription_plural" ns="${0}"> </foxy-i18n> ${0} `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{var e;const s=this.disabledSelector.zoom("list"),r=this.readonlySelector.zoom("list"),o=[this.hiddenSelector.zoom("list").zoom("form").toString(),"end-date"];return t(me||(me=ue` ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" header="update" parent="${0}" group="${0}" lang="${0}" ns="${0}" id="subscription-dialog" .form="${0}" .templates="${0}"> </foxy-form-dialog> <foxy-collection-pages class="block space-y-m" first="${0}" group="${0}" lang="${0}" ns="${0}" manual .page="${0}" .templates="${0}"> </foxy-collection-pages> ${0} `),this.renderTemplateOrSlot("list:before"),r.zoom("form").toString(),s.zoom("form").toString(),o.join(" ").trim(),p(null===(e=this.customer)||void 0===e?void 0:e._links["fx:subscriptions"].href),this.group,this.lang,this.ns,this.__renderForm,this.getNestedTemplates("list:form"),this.__activeSubscriptionsLink,this.group,this.lang,this.ns,this.__renderPage,this.getNestedTemplates("list:card"),this.renderTemplateOrSlot("list:after"))}}static get properties(){return e(e({},super.properties),{},{settings:{attribute:!1},customer:{attribute:!1},group:{type:String}})}render(){return t(he||(he=ue` <div class="space-y-s" data-testid="subscriptions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(),this.hiddenSelector.matches("list",!0)?"":this.__renderList())}get __subscriptionDialog(){return this.renderRoot.querySelector("#subscription-dialog")}get __activeSubscriptionsLink(){try{const e=new URL(this.customer._links["fx:subscriptions"].href);return e.searchParams.set("zoom","last_transaction,transaction_template:items"),e.toString()}catch(e){return""}}}),customElements.define("foxy-internal-customer-portal-transactions",class extends be{constructor(){super(...arguments),this.customer=null,this.group="",this.__renderHeader=()=>t(fe||(fe=ye` <div> ${0} <foxy-i18n class="text-l font-semibold" lang="${0}" key="transaction_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.lang,this.ns,this.renderTemplateOrSlot("header:after")),this.__renderList=()=>{let e="";if(this.customer){const t=new URL(this.customer._links["fx:transactions"].href);t.searchParams.set("zoom","items"),e=t.toString()}return t(ge||(ge=ye` <div> ${0} <foxy-collection-pages spinner="foxy-spinner" group="${0}" first="${0}" class="block divide-y divide-contrast-10 px-m border border-contrast-10 rounded-t-l rounded-b-l" page="foxy-transactions-table" lang="${0}" ns="${0}" manual .templates="${0}"> </foxy-collection-pages> ${0} </div> `),this.renderTemplateOrSlot("list:before"),this.group,e,this.lang,this.ns,this.getNestedTemplates("table"),this.renderTemplateOrSlot("list:after"))}}static get properties(){return e(e({},super.properties),{},{customer:{attribute:!1},group:{type:String}})}render(){return t($e||($e=ye` <div class="space-y-s" data-testid="transactions"> ${0} ${0} </div> `),this.hiddenSelector.matches("header")?"":this.__renderHeader(),this.hiddenSelector.matches("list")?"":this.__renderList())}}),customElements.define("foxy-internal-customer-portal-change-password",class extends x{constructor(){super(...arguments),this.isErrorVisible=!1,this.disabled=!1,this.customer="",this.session="",this.email="",this.step=1,this.__handleTriggerClick=e=>{const t=e.currentTarget,s=this.renderRoot.querySelector("#dialog");this.isErrorVisible=!1,this.step=1,s.show(t)},this.__handleSignInFormUpdate=(e,t)=>{var s,r,o,i;t.handleUpdate(e);const n=e.currentTarget;!(null===(s=n.form.credential)||void 0===s?void 0:s.email)&&this.email&&n.edit({type:null!==(r=n.form.type)&&void 0!==r?r:"password",credential:{email:this.email,password:null!==(i=null===(o=n.form.credential)||void 0===o?void 0:o.password)&&void 0!==i?i:""}})},this.__handleSignInFormFetch=e=>{e.defaultPrevented||"POST"===e.request.method&&e.request.url===this.session&&(e.preventDefault(),e.stopImmediatePropagation(),e.respondWith(this.__getResponse(e.request)))},this.__renderSignInForm=e=>{const s=[],r=["email"];let o="bg-primary-10",i="text-primary",n="icons:lock-outline",a="password:before";return 2===this.step&&(r.push("password"),a="new-password:before",n="icons:lock-open"),3===this.step&&(s.push("new-password"),r.push("password","submit"),o="bg-success-10",i="text-success",a="new-password:before",n="icons:done-all"),this.isErrorVisible||r.push("error"),t(b||(b=S` <foxy-sign-in-form readonlycontrols="${0}" hiddencontrols="${0}" parent="${0}" class="mt-s sm-w-narrow-modal" lang="${0}" ns="${0}" @update="${0}" @fetch="${0}"> <div class="mx-auto flex mb-m w-l h-l rounded-t-l rounded-b-l ${0}" slot="${0}"> <iron-icon icon="${0}" class="m-auto ${0}"></iron-icon> </div> <foxy-i18n class="block text-center text-m text-secondary leading-m mb-m" lang="${0}" slot="${0}" key="change_password_step_${0}" ns="${0}"> </foxy-i18n> </foxy-sign-in-form> `),s.join(" "),r.join(" "),this.session,e.dialog.lang,e.dialog.ns,(t=>this.__handleSignInFormUpdate(t,e)),this.__handleSignInFormFetch,o,a,n,i,e.dialog.lang,a,this.step,e.dialog.ns)}}static get properties(){return e(e({},super.properties),{},{isErrorVisible:{attribute:!1},disabled:{type:Boolean},customer:{type:String},session:{type:String},email:{type:String},step:{attribute:!1},fail:{attribute:!1}})}render(){return t(v||(v=S` <foxy-form-dialog hiddencontrols="save-button" header="change_password" lang="${0}" ns="${0}" alert id="dialog" .form="${0}"> </foxy-form-dialog> <vaadin-button class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="change_password" ns="${0}"></foxy-i18n> </vaadin-button> `),this.lang,this.ns,this.__renderSignInForm,this.disabled,this.__handleTriggerClick,this.lang,this.ns)}async __getResponse(e){const t=await e.clone().json(),s=new c(this);if(this.isErrorVisible=!1,1===this.step){const r=await s.fetch(e.url,{method:e.method,body:JSON.stringify(t)});if(r.ok){this.step=2;const e={_embedded:{"fx:errors":[{code:"new_password_required_error"}]}};return new c.WHATWGResponse(JSON.stringify(e),{status:400})}return this.isErrorVisible=!0,r}if(2===this.step){const r=await s.fetch(this.customer,{method:"PATCH",body:JSON.stringify({password:t.credential.new_password,password_old:t.credential.password})});return r.ok?(this.step=3,t._links={self:{href:e.url}},new c.WHATWGResponse(JSON.stringify(t))):(this.isErrorVisible=!0,r)}return s.fetch(e)}}),customElements.define("foxy-internal-customer-portal-link",k),customElements.define("foxy-customer-portal",y);export{y as CustomerPortal};