@foxy.io/elements 1.23.0-beta.1 → 1.23.0-beta.3

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 (195) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-admin-subscription-card.js +1 -1
  5. package/dist/cdn/foxy-api-browser.js +2 -3
  6. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  8. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  9. package/dist/cdn/foxy-attribute-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-form.js +1 -1
  11. package/dist/cdn/foxy-cancellation-form.js +1 -1
  12. package/dist/cdn/foxy-cart-card.js +1 -1
  13. package/dist/cdn/foxy-cart-form.js +1 -1
  14. package/dist/cdn/foxy-collection-page.js +1 -1
  15. package/dist/cdn/foxy-collection-pages.js +1 -1
  16. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  17. package/dist/cdn/foxy-coupon-card.js +1 -1
  18. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  19. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  20. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  21. package/dist/cdn/foxy-coupon-form.js +1 -1
  22. package/dist/cdn/foxy-custom-field-card.js +1 -1
  23. package/dist/cdn/foxy-custom-field-form.js +1 -1
  24. package/dist/cdn/foxy-customer-card.js +1 -1
  25. package/dist/cdn/foxy-customer-form.js +1 -1
  26. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  27. package/dist/cdn/foxy-customer-portal.js +1 -1
  28. package/dist/cdn/foxy-customer.js +1 -1
  29. package/dist/cdn/foxy-customers-table.js +1 -1
  30. package/dist/cdn/foxy-discount-builder.js +1 -1
  31. package/dist/cdn/foxy-discount-card.js +1 -1
  32. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  33. package/dist/cdn/foxy-donation.js +1 -1
  34. package/dist/cdn/foxy-downloadable-card.js +1 -1
  35. package/dist/cdn/foxy-downloadable-form.js +1 -1
  36. package/dist/cdn/foxy-email-template-card.js +1 -1
  37. package/dist/cdn/foxy-email-template-form.js +1 -1
  38. package/dist/cdn/foxy-error-entry-card.js +1 -1
  39. package/dist/cdn/foxy-form-dialog.js +1 -1
  40. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  41. package/dist/cdn/foxy-gift-card-card.js +1 -1
  42. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  43. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  44. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  45. package/dist/cdn/foxy-gift-card-form.js +1 -1
  46. package/dist/cdn/foxy-i18n-editor.js +2 -2
  47. package/dist/cdn/foxy-i18n.js +1 -1
  48. package/dist/cdn/foxy-integration-card.js +1 -1
  49. package/dist/cdn/foxy-integration-form.js +1 -1
  50. package/dist/cdn/foxy-item-card.js +1 -1
  51. package/dist/cdn/foxy-item-category-card.js +1 -1
  52. package/dist/cdn/foxy-item-category-form.js +1 -1
  53. package/dist/cdn/foxy-item-form.js +1 -1
  54. package/dist/cdn/foxy-item-option-card.js +1 -1
  55. package/dist/cdn/foxy-item-option-form.js +1 -1
  56. package/dist/cdn/foxy-items-form.js +1 -1
  57. package/dist/cdn/foxy-pagination.js +1 -1
  58. package/dist/cdn/foxy-payment-card.js +1 -1
  59. package/dist/cdn/foxy-payment-method-card.js +1 -1
  60. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  61. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  62. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  63. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  64. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  65. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  66. package/dist/cdn/foxy-payments-api.js +1 -1
  67. package/dist/cdn/foxy-query-builder.js +1 -1
  68. package/dist/cdn/foxy-report-form.js +1 -1
  69. package/dist/cdn/foxy-reports-table.js +1 -1
  70. package/dist/cdn/foxy-shipment-card.js +1 -1
  71. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  72. package/dist/cdn/foxy-sign-in-form.js +1 -1
  73. package/dist/cdn/foxy-spinner.js +1 -1
  74. package/dist/cdn/foxy-store-card.js +1 -1
  75. package/dist/cdn/foxy-store-form.js +1 -1
  76. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  77. package/dist/cdn/foxy-subscription-card.js +1 -1
  78. package/dist/cdn/foxy-subscription-form.js +3 -3
  79. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  80. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  81. package/dist/cdn/foxy-table.js +1 -1
  82. package/dist/cdn/foxy-tax-card.js +1 -1
  83. package/dist/cdn/foxy-tax-form.js +1 -1
  84. package/dist/cdn/foxy-template-config-form.js +1 -1
  85. package/dist/cdn/foxy-template-form.js +1 -1
  86. package/dist/cdn/foxy-template-set-card.js +1 -1
  87. package/dist/cdn/foxy-template-set-form.js +1 -1
  88. package/dist/cdn/foxy-transaction-card.js +1 -1
  89. package/dist/cdn/foxy-transaction.js +1 -1
  90. package/dist/cdn/foxy-transactions-table.js +1 -1
  91. package/dist/cdn/foxy-user-card.js +1 -1
  92. package/dist/cdn/foxy-user-form.js +1 -1
  93. package/dist/cdn/foxy-users-table.js +1 -1
  94. package/dist/cdn/foxy-webhook-card.js +1 -1
  95. package/dist/cdn/foxy-webhook-form.js +1 -1
  96. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  97. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  98. package/dist/cdn/{shared-5570ac69.js → shared-03b39ec4.js} +1 -1
  99. package/dist/cdn/{shared-df1816e8.js → shared-0543c6e0.js} +1 -1
  100. package/dist/cdn/{shared-14bb06d4.js → shared-068480a3.js} +1 -1
  101. package/dist/cdn/{shared-049d80d0.js → shared-08ff9a8d.js} +1 -1
  102. package/dist/cdn/{shared-b39fce1b.js → shared-0c02b4ee.js} +1 -1
  103. package/dist/cdn/{shared-3d6f0788.js → shared-0dc1d012.js} +1 -1
  104. package/dist/cdn/{shared-04634a6f.js → shared-16b542bc.js} +1 -1
  105. package/dist/cdn/{shared-0dd25feb.js → shared-1e5292a1.js} +1 -1
  106. package/dist/cdn/{shared-faad86eb.js → shared-23923638.js} +1 -1
  107. package/dist/cdn/{shared-bed220d3.js → shared-29aa4bca.js} +1 -1
  108. package/dist/cdn/{shared-a7347e96.js → shared-380db651.js} +1 -1
  109. package/dist/cdn/{shared-7fd77eed.js → shared-39761436.js} +1 -1
  110. package/dist/cdn/{shared-07e32de2.js → shared-3a252ccd.js} +1 -1
  111. package/dist/cdn/{shared-491c9063.js → shared-3a82d3f5.js} +1 -1
  112. package/dist/cdn/{shared-bb226a47.js → shared-43520428.js} +1 -1
  113. package/dist/cdn/shared-49d978e1.js +1 -0
  114. package/dist/cdn/{shared-ac05532a.js → shared-4abfda9b.js} +1 -1
  115. package/dist/cdn/{shared-98eec370.js → shared-4c9f96ec.js} +1 -1
  116. package/dist/cdn/{shared-40638f2c.js → shared-4db2c7b1.js} +4 -4
  117. package/dist/cdn/{shared-f19f05e1.js → shared-53fee01f.js} +1 -1
  118. package/dist/cdn/{shared-50908853.js → shared-5dd31b4e.js} +1 -1
  119. package/dist/cdn/{shared-cf65fcc7.js → shared-61a510d8.js} +1 -1
  120. package/dist/cdn/{shared-0237bfae.js → shared-6b53ef85.js} +2 -2
  121. package/dist/cdn/{shared-163e5fdb.js → shared-6bfa699d.js} +1 -1
  122. package/dist/cdn/{shared-ab69c97b.js → shared-6eb7dc77.js} +1 -1
  123. package/dist/cdn/{shared-4494ebfa.js → shared-6f465111.js} +1 -1
  124. package/dist/cdn/{shared-ec3332b9.js → shared-6fb923d5.js} +1 -1
  125. package/dist/cdn/{shared-f0c8a5bd.js → shared-7a290f36.js} +1 -1
  126. package/dist/cdn/{shared-394c2425.js → shared-7bf46d6d.js} +1 -1
  127. package/dist/cdn/{shared-c7954521.js → shared-7c5754a4.js} +1 -1
  128. package/dist/cdn/{shared-f23627ae.js → shared-8349938a.js} +1 -1
  129. package/dist/cdn/{shared-af7cde22.js → shared-85bc54a6.js} +1 -1
  130. package/dist/cdn/{shared-d1c45954.js → shared-86768244.js} +1 -1
  131. package/dist/cdn/{shared-a959c0d9.js → shared-8b73191b.js} +1 -1
  132. package/dist/cdn/{shared-726c0b56.js → shared-9048c076.js} +1 -1
  133. package/dist/cdn/{shared-539cde4d.js → shared-939fc890.js} +1 -1
  134. package/dist/cdn/{shared-80792dc8.js → shared-9e60ef60.js} +1 -1
  135. package/dist/cdn/{shared-bbb8ec69.js → shared-a6518411.js} +1 -1
  136. package/dist/cdn/{shared-ffd03d7b.js → shared-ad396f3c.js} +1 -1
  137. package/dist/cdn/{shared-64f2d6de.js → shared-aeec3cab.js} +1 -1
  138. package/dist/cdn/{shared-00b50abf.js → shared-b88e35b7.js} +1 -1
  139. package/dist/cdn/{shared-bdd5c908.js → shared-b95ef318.js} +1 -1
  140. package/dist/cdn/{shared-d2384b7b.js → shared-bb009254.js} +1 -1
  141. package/dist/cdn/{shared-694297c2.js → shared-bd81cc08.js} +1 -1
  142. package/dist/cdn/{shared-8ac00abe.js → shared-c3c67413.js} +1 -1
  143. package/dist/cdn/{shared-27d23dfd.js → shared-c40d85dc.js} +1 -1
  144. package/dist/cdn/{shared-313a39ef.js → shared-ca58ef47.js} +1 -1
  145. package/dist/cdn/{shared-025cab8b.js → shared-cb6f2388.js} +1 -1
  146. package/dist/cdn/{shared-520be2e9.js → shared-cd096e97.js} +1 -1
  147. package/dist/cdn/{shared-1e55acbb.js → shared-d493355a.js} +1 -1
  148. package/dist/cdn/{shared-797b6161.js → shared-dcbaa1c5.js} +1 -1
  149. package/dist/cdn/{shared-acda8da2.js → shared-e28f16db.js} +1 -1
  150. package/dist/cdn/{shared-77a700fe.js → shared-e5c19ea3.js} +1 -1
  151. package/dist/cdn/shared-e6066f46.js +2 -0
  152. package/dist/cdn/{shared-e7ce4e47.js → shared-eb4b4597.js} +1 -1
  153. package/dist/cdn/{shared-b34bef61.js → shared-ee13d1a6.js} +1 -1
  154. package/dist/cdn/{shared-7c761c65.js → shared-f3f5e87e.js} +1 -1
  155. package/dist/cdn/{shared-3206f265.js → shared-fbfb0943.js} +1 -1
  156. package/dist/cdn/translations/api-browser/en.json +4 -0
  157. package/dist/cdn/translations/email-template-form/en.json +9 -7
  158. package/dist/cdn/translations/template-form/en.json +9 -7
  159. package/dist/elements/internal/InternalSourceControl/InternalSourceControl.d.ts +18 -0
  160. package/dist/elements/internal/InternalSourceControl/InternalSourceControl.js +160 -0
  161. package/dist/elements/internal/InternalSourceControl/InternalSourceControl.js.map +1 -0
  162. package/dist/elements/internal/InternalSourceControl/index.d.ts +3 -0
  163. package/dist/elements/internal/InternalSourceControl/index.js +5 -0
  164. package/dist/elements/internal/InternalSourceControl/index.js.map +1 -0
  165. package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/InternalApiBrowserResourceForm.d.ts +0 -2
  166. package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/InternalApiBrowserResourceForm.js +27 -43
  167. package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/InternalApiBrowserResourceForm.js.map +1 -1
  168. package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/index.d.ts +1 -0
  169. package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/index.js +1 -0
  170. package/dist/elements/public/ApiBrowser/internal/InternalApiBrowserResourceForm/index.js.map +1 -1
  171. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.d.ts +9 -7
  172. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js +66 -60
  173. package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js.map +1 -1
  174. package/dist/elements/public/EmailTemplateForm/index.d.ts +1 -1
  175. package/dist/elements/public/EmailTemplateForm/index.js +1 -1
  176. package/dist/elements/public/EmailTemplateForm/index.js.map +1 -1
  177. package/dist/elements/public/PaymentsApi/PaymentsApi.d.ts +53 -7
  178. package/dist/elements/public/PaymentsApi/PaymentsApi.js +75 -12
  179. package/dist/elements/public/PaymentsApi/PaymentsApi.js.map +1 -1
  180. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.d.ts +0 -4
  181. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +66 -118
  182. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -1
  183. package/dist/elements/public/TemplateConfigForm/index.d.ts +1 -1
  184. package/dist/elements/public/TemplateConfigForm/index.js +1 -1
  185. package/dist/elements/public/TemplateConfigForm/index.js.map +1 -1
  186. package/dist/elements/public/TemplateForm/TemplateForm.d.ts +4 -3
  187. package/dist/elements/public/TemplateForm/TemplateForm.js +49 -50
  188. package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -1
  189. package/dist/elements/public/TemplateForm/index.d.ts +1 -1
  190. package/dist/elements/public/TemplateForm/index.js +1 -1
  191. package/dist/elements/public/TemplateForm/index.js.map +1 -1
  192. package/dist/mixins/themeable.js +14 -4
  193. package/dist/mixins/themeable.js.map +1 -1
  194. package/package.json +1 -1
  195. package/dist/cdn/shared-44594184.js +0 -1
@@ -1,4 +1,4 @@
1
- import{P as t,h as e}from"./shared-f0c8a5bd.js";import{E as i,T as s}from"./shared-27d23dfd.js";import"./shared-acda8da2.js";import"./shared-4494ebfa.js";import{y as a,S as o,R as n,a as r}from"./shared-04634a6f.js";import{c as l,h as d}from"./shared-7f33a83a.js";import"./shared-df1816e8.js";import"./shared-025cab8b.js";import"./shared-313a39ef.js";import{I as c}from"./shared-ec3332b9.js";import"./shared-5570ac69.js";import"./shared-cf65fcc7.js";import"./foxy-cancellation-form.js";import"./shared-0479553e.js";import"./foxy-transaction-card.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-card.js";import"./foxy-form-dialog.js";import"./foxy-item-card.js";import"./shared-d1c45954.js";import{_ as u,B as h}from"./shared-98755831.js";import{c as m}from"./shared-4e709717.js";import{C as f}from"./shared-b34bef61.js";import"./shared-80792dc8.js";import{S as p}from"./shared-0237bfae.js";import"./shared-64f2d6de.js";import"./shared-bdd5c908.js";import"./shared-7c761c65.js";import"./shared-14bb06d4.js";import{G as _}from"./shared-049d80d0.js";import"./shared-98eec370.js";import{p as y}from"./shared-d2384b7b.js";import{s as v}from"./shared-bc7f58ef.js";import{i as b}from"./shared-d3bf9ac0.js";import{p as g}from"./shared-daf52401.js";import{j as x}from"./shared-b5517c1b.js";import"./shared-40638f2c.js";import"./shared-50908853.js";import"./shared-de790de9.js";import"./shared-a8cf402a.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-64657919.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-3d6f0788.js";import"./foxy-spinner.js";import"./foxy-collection-page.js";import"./shared-d519a301.js";import"./shared-11c2efc8.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-b39fce1b.js";import"./shared-a7347e96.js";import"./shared-77a700fe.js";import"./shared-520be2e9.js";import"./shared-394c2425.js";import"./shared-44594184.js";import"./shared-07e32de2.js";a("vcf-tooltip",l`
1
+ import{P as e,h as t}from"./shared-7a290f36.js";import{E as i,T as s}from"./shared-c40d85dc.js";import"./shared-e28f16db.js";import"./shared-6f465111.js";import{y as a,S as o,R as n,a as r}from"./shared-16b542bc.js";import{c as l,h as d}from"./shared-7f33a83a.js";import"./shared-0543c6e0.js";import"./shared-cb6f2388.js";import"./shared-ca58ef47.js";import{I as c}from"./shared-6fb923d5.js";import"./shared-03b39ec4.js";import"./shared-61a510d8.js";import"./foxy-cancellation-form.js";import"./shared-0479553e.js";import"./foxy-transaction-card.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-card.js";import"./foxy-form-dialog.js";import"./foxy-item-card.js";import"./shared-86768244.js";import{_ as u,B as h}from"./shared-98755831.js";import{c as m}from"./shared-4e709717.js";import{C as f}from"./shared-ee13d1a6.js";import"./shared-9e60ef60.js";import{S as p}from"./shared-6b53ef85.js";import"./shared-aeec3cab.js";import"./shared-b95ef318.js";import"./shared-f3f5e87e.js";import"./shared-068480a3.js";import{G as _}from"./shared-08ff9a8d.js";import"./shared-4c9f96ec.js";import{p as y}from"./shared-bb009254.js";import{s as v}from"./shared-bc7f58ef.js";import{i as b}from"./shared-d3bf9ac0.js";import{p as g}from"./shared-daf52401.js";import{j as x}from"./shared-b5517c1b.js";import"./shared-4db2c7b1.js";import"./shared-5dd31b4e.js";import"./shared-de790de9.js";import"./shared-a8cf402a.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-64657919.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-0dc1d012.js";import"./foxy-spinner.js";import"./foxy-collection-page.js";import"./shared-d519a301.js";import"./shared-11c2efc8.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-0c02b4ee.js";import"./shared-380db651.js";import"./shared-e5c19ea3.js";import"./shared-cd096e97.js";import"./shared-7bf46d6d.js";import"./shared-49d978e1.js";import"./shared-3a252ccd.js";a("vcf-tooltip",l`
2
2
  :host {
3
3
  /* Sizing */
4
4
  --lumo-tooltip-size: var(--lumo-size-m);
@@ -11,7 +11,7 @@ import{P as t,h as e}from"./shared-f0c8a5bd.js";import{E as i,T as s}from"./shar
11
11
  -webkit-font-smoothing: antialiased;
12
12
  -moz-osx-font-smoothing: grayscale;
13
13
  }
14
- `,{include:["lumo-color","lumo-typography"]});class $ extends(i(s(t))){static get template(){return e`
14
+ `,{include:["lumo-color","lumo-typography"]});class $ extends(i(s(e))){static get template(){return t`
15
15
  <style>
16
16
  :host {
17
17
  box-sizing: border-box;
@@ -92,7 +92,7 @@ import{P as t,h as e}from"./shared-f0c8a5bd.js";import{E as i,T as s}from"./shar
92
92
  <iron-icon icon="lumo:cross"></iron-icon>
93
93
  </vaadin-button>
94
94
  </div>
95
- `}static get is(){return"vcf-tooltip"}static get version(){return"1.3.15"}static get properties(){return{for:{type:String},position:{type:String,value:"top"},align:{type:String,value:"center"},hidden:{type:Boolean,value:!0,notify:!0,reflectToAttribute:!0,observer:"_hiddenChanged"},manual:{type:Boolean,value:!1,reflectToAttribute:!0},targetElement:{type:Object,observer:"_attachToTarget"},closeButton:{type:Boolean,value:!1,reflectToAttribute:!0},theme:{type:String,reflectToAttribute:!0}}}static get observers(){return["_setPosition(targetElement, hidden, position, align)","_updateTarget(for)","_manualObserver(manual)"]}constructor(){super(),this._boundShow=this.show.bind(this),this._boundHide=this.hide.bind(this),this._boundOnKeyup=this._onKeyup.bind(this)}connectedCallback(){super.connectedCallback(),this._attachToTarget(),this._setDefaultId()}ready(){super.ready(),window.addEventListener("resize",(()=>{clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const{targetElement:t,hidden:e,position:i}=this;this.hidden||this._setPosition(t,e,i)}),100)})),this.getAttribute("theme")||this.setAttribute("theme","dark")}disconnectedCallback(){super.disconnectedCallback(),this._detachFromTarget()}_manualObserver(){this.manual?this._removeEvents():this._addEvents()}_attachToTarget(t,e){e&&(this._removeTargetEvents(e),e.describedby&&(e.removeAttribute("aria-describedby"),delete e.describedby)),t&&(this._addEvents(),t.getAttribute("aria-describedby")||(t.setAttribute("aria-describedby",this.id),t.describedby=!0))}_addEvents(){this.targetElement&&!this.manual&&(this.targetElement.addEventListener("mouseenter",this._boundShow),this.targetElement.addEventListener("focus",this._boundShow),this.targetElement.addEventListener("mouseleave",this._boundHide),this.targetElement.addEventListener("blur",this._boundHide),this.targetElement.addEventListener("tap",this._boundHide)),this.manual||(this.addEventListener("mouseenter",this._boundShow),this.addEventListener("mouseleave",this._boundHide))}_detachFromTarget(){this.manual||this._removeEvents(),this.targetElement&&this.targetElement.describedby&&(this.targetElement.removeAttribute("aria-describedby"),delete this.targetElement.describedby)}_removeEvents(){this.targetElement&&this._removeTargetEvents(this.targetElement),this.removeEventListener("mouseenter",this._boundShow),this.removeEventListener("mouseleave",this._boundHide)}_removeTargetEvents(t){t.removeEventListener("mouseenter",this._boundShow),t.removeEventListener("focus",this._boundShow),t.removeEventListener("mouseleave",this._boundHide),t.removeEventListener("blur",this._boundHide),t.removeEventListener("tap",this._boundHide)}_updateTarget(){this.targetElement=this.parentNode.querySelector(`#${this.for}`)}_setPosition(t,e,i){if(t&&!e){let t=window.innerHeight,e=window.innerWidth;this.offsetParent&&(t=this.offsetParent.scrollHeight,e=this.offsetParent.scrollWidth);const s=this.targetElement.getBoundingClientRect(),a=this.getBoundingClientRect(),o=(s.width-a.width)/2,n=(s.height-a.height)/2;let r,l,d=s.left,c=s.top,u=window.pageYOffset;switch(this._parentPostioned&&(c=this.targetElement.offsetTop,d=this.targetElement.offsetLeft,u=0),i){case"top":l=c-a.height+u,r=this._calculateLeft(d,s,a,o);break;case"bottom":l=c+s.height+u,r=this._calculateLeft(d,s,a,o);break;case"left":r=d-a.width,l=this._calculateTop(c,s,a,n,u);break;case"right":r=d+s.width,l=this._calculateTop(c,s,a,n,u)}this._setPositionInVisibleBounds(t,e,r,l,a)}}get _parentPostioned(){return"static"!==window.getComputedStyle(this.offsetParent).position}_setPositionInVisibleBounds(t,e,i,s,a){i+a.width>e?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,i)+"px",this.style.right="auto"),s+a.height>t?(this.style.bottom=t+"px",this.style.top="auto"):(this.style.top=Math.max(0,s)+"px",this.style.bottom="auto")}_calculateLeft(t,e,i,s){switch(this.align){case"left":return t;case"right":return e.left+e.width-i.width;default:return t+s}}_calculateTop(t,e,i,s,a){switch(this.align){case"top":return t+a;case"bottom":return t+e.height-i.height+a;default:return t+s+a}}show(){this.hidden=!1}hide(){this.hidden=!0}_hiddenChanged(t){t?(this.setAttribute("aria-hidden",!0),window.removeEventListener("keyup",this._boundOnKeyup)):(this.setAttribute("aria-hidden",!1),window.addEventListener("keyup",this._boundOnKeyup))}_onKeyup(t){27===t.keyCode&&this.hide()}_setDefaultId(){this.id||(Vaadin.tooltipIndex||(Vaadin.tooltipIndex=0),this.id="vcf-tooltip"+ ++Vaadin.tooltipIndex)}}function w(t){return function*(t){const e=[];for(const i of t.settings.subscriptions.allowFrequencyModification)if(x(i.jsonataQuery).evaluate(t.subscription))for(const t of i.values)!e.includes(t)&&(e.push(t),yield t)}({settings:{subscriptions:{allowFrequencyModification:t.settings.subscriptions.allow_frequency_modification.map((t=>({jsonataQuery:t.jsonata_query,values:t.values})))}},subscription:t.subscription})}customElements.define($.is,$),window.Vaadin.VcfTooltip=$;class S extends Error{constructor(t){super(`Invalid frequency "${t}".`)}}function T(t){const e=864e5,i=31*e;if(".5m"===t)return i/2;const s=parseInt(t.substring(0,t.length-1));if(isNaN(s))throw new S(t);if(t.endsWith("y"))return 31536e6*s;if(t.endsWith("m"))return s*i;if(t.endsWith("w"))return 6048e5*s;if(t.endsWith("d"))return s*e;throw new S(t)}function j(t,e){if("boolean"==typeof e)return e;const i=e.filter((e=>Boolean(x(e.jsonataQuery).evaluate(t)))).reduce(((t,e)=>{var i,s,a,o,n;if(e.min){const i=t.min?T(t.min):1/0;T(e.min)<i&&(t.min=e.min)}if(e.max){const i=t.max?T(t.max):-1/0;T(e.max)>i&&(t.max=e.max)}if("day"===(null===(i=e.allowedDays)||void 0===i?void 0:i.type)){const i=[...null!==(s=t.allowedDaysOfWeek)&&void 0!==s?s:[],...e.allowedDays.days];t.allowedDaysOfWeek=Array.from(new Set(i))}if("month"===(null===(a=e.allowedDays)||void 0===a?void 0:a.type)){const i=[...null!==(o=t.allowedDaysOfMonth)&&void 0!==o?o:[],...e.allowedDays.days];t.allowedDaysOfMonth=Array.from(new Set(i))}if(e.disallowedDates){const i=[...null!==(n=t.disallowedDates)&&void 0!==n?n:[],...e.disallowedDates];t.disallowedDates=Array.from(new Set(i))}return t}),{});return 0!==Object.keys(i).length&&i}function E(t){const[e,i,s]=t.split("-").map((t=>parseInt(t)));return new Date(e,i-1,s)}function D(t){const e=t.settings.subscriptions.allow_next_date_modification;let i;return i="boolean"==typeof e?e:e.map((t=>({allowedDays:t.allowed_days,disallowedDates:t.disallowed_dates,jsonataQuery:t.jsonata_query,max:t.max,min:t.min}))),function(t){var e,i;const s=E(t.value),a=s.getTime(),o=j(t.subscription,t.settings.subscriptions.allowNextDateModification);if("boolean"==typeof o)return o;if(!1===(null===(e=o.allowedDaysOfMonth)||void 0===e?void 0:e.includes(s.getDate())))return!1;if(!1===(null===(i=o.allowedDaysOfWeek)||void 0===i?void 0:i.includes(s.getDay())))return!1;if(o.disallowedDates&&o.disallowedDates.find((t=>{const[e,i]=t.split("..").map((t=>E(t).getTime()));return a===e||void 0!==i&&a>=e&&a<=i})))return!1;if(o.min){const t=g(o.min);if(null!==t&&Date.now()+t>=a)return!1}if(o.max){const t=g(o.max);if(null!==t&&Date.now()+t<=a)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:i}},subscription:t.subscription,value:t.value})}let k,q,L,H,I,O,A,C,P,z,N,F,R,V,B,M,U,W,K=t=>t;const Q=o(n(r(c,"subscription-form")));class J extends Q{constructor(){super(...arguments),this.getTransactionPageHref=(t,e)=>null==e?void 0:e._links["fx:receipt"].href,this.getCustomerPageHref=null,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.templates={},this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderHeaderSubtitle=()=>{var t;const{data:e,lang:i,ns:s}=this;if(e){let a,o,n="text-secondary";if(e.first_failed_transaction_date)n="text-error",a=e.first_failed_transaction_date,o="subscription_failed";else if(e.end_date){a=e.end_date;o=new Date(a).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}else a=null!==(t=e.next_transaction_date)&&void 0!==t?t:(new Date).toISOString(),o="subscription_"+(e.is_active?"active":"inactive");const r=d(k||(k=K` <foxy-i18n data-testid="header-subtitle" options="${0}" class="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify({date:a}),n,i,o,s);return e.first_failed_transaction_date?d(q||(q=K` <span id="status" class="flex items-center space-x-xs ${0}"> ${0}<iron-icon icon="icons:info-outline" class="icon-inline"></iron-icon> </span> <vcf-tooltip for="status" position="bottom"> <span class="text-s">${0}</span> </vcf-tooltip> `),n,r,e.error_message):r}return d(L||(L=K`<x-skeleton class="w-full" variant="static">&nbsp;</x-skeleton>`))},this.__renderHeaderTitle=(t,e)=>{const{data:i,lang:s,ns:a}=this;if(i){const o=y(i.frequency),n=this.__transactionTemplate,r=null==n?void 0:n.total_order;return"string"!=typeof t?d(H||(H=K`--`)):d(I||(I=K` <foxy-i18n data-testid="header-title" options="${0}" lang="${0}" key="price_${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(u({},o),{},{amount:`${r} ${t}`,currencyDisplay:e})),s,".5m"===i.frequency?"twice_a_month":"recurring",a)}return d(O||(O=K`<x-skeleton class="w-full" variant="static">&nbsp;</x-skeleton>`))},this.__renderHeader=(t,e)=>d(A||(A=K` <div data-testid="header" class="sm-col-span-2"> ${0} <div class="leading-xs text-xxl font-medium truncate"> ${0} </div> <div class="leading-xs text-l">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.__renderHeaderTitle(t,e),this.__renderHeaderSubtitle(),this.renderTemplateOrSlot("header:after")),this.__renderItemsActions=()=>d(C||(C=K` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-s font-medium text-secondary" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var t;let e;try{const i=this.__transactionTemplate,s=new URL(null!==(t=null==i?void 0:i._links["fx:items"].href)&&void 0!==t?t:"");s.searchParams.set("zoom","item_options"),e=s.toString()}catch(t){e=void 0}return d(P||(P=K` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" limit="5" infer="items" item="foxy-item-card"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),b(e))},this.__renderEndDate=()=>{const{disabledSelector:t,lang:e,ns:i}=this,s=this.hiddenSelector.zoom("end-date:form").toString();return d(z||(z=K` <div class="sm-col-span-2"> ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="save-button ${0}" data-testid="cancellation-form" parent="${0}" header="end_subscription" alert form="foxy-cancellation-form" href="${0}" lang="${0}" id="end-date-form" ns="${0}" .templates="${0}"> </foxy-form-dialog> <vaadin-button data-testid="end-date" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="end_subscription" ns="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),this.readonlySelector.zoom("end-date:form").toString(),t.zoom("end-date:form").toString(),s,this.parent,this.href,e,i,this.getNestedTemplates("end-date:form"),!this.data||t.matches("end-date",!0),(t=>{this.renderRoot.querySelector("#end-date-form").show(t.currentTarget)}),i,e,this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=t=>{const{settings:e,data:i}=this;if(e&&i){return D({value:v(t),settings:e,subscription:i})}return t.getTime()>=Date.now()},this.__checkStartDateAvailability=t=>t.getTime()>=Date.now(),this.__renderStartDate=()=>{const{data:t,lang:e,ns:i}=this;return d(N||(N=K` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),i,e,b(null==t?void 0:t.start_date.substr(0,10)),b(null==t?void 0:t.start_date),e,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(t=>{const e=t.target;this.edit({start_date:e.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:t,lang:e,ns:i}=this,s=!!(null==t?void 0:t.is_active);return d(F||(F=K` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),i,e,b(null==t?void 0:t.next_transaction_date.substr(0,10)),b(null==t?void 0:t.next_transaction_date),e,!s||this.readonlySelector.matches("next-transaction-date",!0),!t||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(t=>{const e=t.target;this.edit({next_transaction_date:e.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:t}=this,e=!!(null==t?void 0:t.is_active),i=this.__frequencies.map((t=>({label:this.t(".5m"===t?"twice_a_month":"frequency",y(t)),value:t})));return d(R||(R=K` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!t||this.disabledSelector.matches("frequency",!0),t&&(!e||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),b(this.form.frequency),i,(t=>{this.edit({frequency:t.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var t;const{data:e,lang:i,ns:s}=this;return d(V||(V=K` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),s,i,s,null===this.settings,this.__frequencies,null!==(t=this.form.frequency)&&void 0!==t?t:null,!e||this.disabledSelector.matches("frequency",!0),e&&(!e.is_active||this.readonlySelector.matches("frequency",!0)),(t=>{this.edit({frequency:t.target.value})}),this.__frequencies.map((t=>d(B||(B=K` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(y(t)),t,i,".5m"===t?"twice_a_month":"frequency",s))))},this.__renderFrequency=()=>d(M||(M=K` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__renderCustomer=()=>{var t,e;const i=null===(t=this.data)||void 0===t?void 0:t._links["fx:customer"].href,s=i?null===(e=this.getCustomerPageHref)||void 0===e?void 0:e.call(this,i):void 0;return d(U||(U=K` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="customer" href="${0}"></foxy-customer-card> </a> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),m({"block rounded transition-colors":!0,"ring-1 ring-contrast-10":!s,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!s,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!s}),b(s),b(i),this.renderTemplateOrSlot("customer:after"))}}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-collection-pages":customElements.get("foxy-collection-pages"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-customer-card":customElements.get("foxy-customer-card"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-form-dialog":customElements.get("foxy-form-dialog"),"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-table":customElements.get("foxy-table"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":p,"x-choice":f,"x-group":_}}static get properties(){return u(u({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},settings:{type:Object},coupons:{}})}get hiddenSelector(){return new h(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}renderBody(){var t,e,i,s,a,o,n,r,l;let c;try{const i=new URL(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:transactions"].href)&&void 0!==e?e:"");i.searchParams.set("order","transaction_date desc"),i.searchParams.set("zoom","items"),c=i.toString()}catch(t){c=void 0}const u=(null===(i=this.__store)||void 0===i?void 0:i.use_international_currency_symbol)?"code":"symbol",h=this.__transactionTemplate;let m=null;if(null==h?void 0:h.currency_code)m=h.currency_code;else{const t=this.__localeCodesHelper,e=null===(a=null!==(s=this.__templateSet)&&void 0!==s?s:this.__defaultTemplateSet)||void 0===a?void 0:a.locale_code,i=e?null==t?void 0:t.values[e]:void 0;i&&(m=null!==(n=null===(o=/Currency: ([A-Z]{3})/g.exec(i))||void 0===o?void 0:o[1])&&void 0!==n?n:null)}return d(W||(W=K` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> ${0} </div> `),b(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),b(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),b(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),b(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),b(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(null!=m?m:void 0,u),this.hiddenSelector.matches("customer",!0)?"":this.__renderCustomer(),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",b(null!=m?m:void 0),b(null===(l=null===(r=this.data)||void 0===r?void 0:r._links["fx:attributes"])||void 0===l?void 0:l.href),b(c),this.getTransactionPageHref,this.hiddenSelector.matches("end-date",!0)?"":this.__renderEndDate())}get __transactionTemplateHref(){var t;const e=this.data;return(null===(t=null==e?void 0:e._embedded)||void 0===t?void 0:t["fx:transaction_template"])||null==e?void 0:e._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var t,e,i;if(""===(null===(t=this.__transactionTemplate)||void 0===t?void 0:t.template_set_uri))try{const t=new URL(null!==(i=null===(e=this.__store)||void 0===e?void 0:e._links["fx:template_sets"].href)&&void 0!==i?i:"");return t.searchParams.set("code","DEFAULT"),t.toString()}catch(t){}}get __localeCodesHelperHref(){var t;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(t=this.localeCodes)&&void 0!==t?t:void 0}get __templateSetHref(){const t=this.__transactionTemplate;if(!(null==t?void 0:t.currency_code))return(null==t?void 0:t.template_set_uri)||void 0}get __storeHref(){var t,e;return null===(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:store"])||void 0===e?void 0:e.href}get __transactionTemplate(){var t,e,i;const s=this.data,a=null===(t=null==s?void 0:s._embedded)||void 0===t?void 0:t["fx:transaction_template"],o=`#${this.__transactionTemplateLoaderId}`;return null!==(i=null!=a?a:null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==i?i:null}get __defaultTemplateSet(){var t,e;const i=`#${this.__defaultTemplateSetLoaderId}`,s=this.renderRoot.querySelector(i);return null!==(e=null===(t=null==s?void 0:s.data)||void 0===t?void 0:t._embedded["fx:template_sets"][0])&&void 0!==e?e:null}get __localeCodesHelper(){var t,e;const i=`#${this.__localeCodesHelperLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}get __templateSet(){var t,e;const i=`#${this.__templateSetLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}get __store(){var t,e;const i=`#${this.__storeLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}get __isNextTransactionDateVisible(){if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;const t=this.settings.subscriptions.allow_next_date_modification;return!!function(t,e){let i;return i="boolean"==typeof e?e:e.map((t=>({allowedDays:t.allowed_days,disallowedDates:t.disallowed_dates,jsonataQuery:t.jsonata_query,max:t.max,min:t.min}))),j(t,i)}(this.data,t)}get __isStartDateVisible(){return!this.hiddenSelector.matches("start-date",!0)&&this.__isNextTransactionDateVisible}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isFrequencyVisible(){if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;return!w({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const t=w({subscription:this.data,settings:this.settings});return Array.from(t)}}let G;a("vcf-tooltip",l(G||(G=(t=>t)`
95
+ `}static get is(){return"vcf-tooltip"}static get version(){return"1.3.15"}static get properties(){return{for:{type:String},position:{type:String,value:"top"},align:{type:String,value:"center"},hidden:{type:Boolean,value:!0,notify:!0,reflectToAttribute:!0,observer:"_hiddenChanged"},manual:{type:Boolean,value:!1,reflectToAttribute:!0},targetElement:{type:Object,observer:"_attachToTarget"},closeButton:{type:Boolean,value:!1,reflectToAttribute:!0},theme:{type:String,reflectToAttribute:!0}}}static get observers(){return["_setPosition(targetElement, hidden, position, align)","_updateTarget(for)","_manualObserver(manual)"]}constructor(){super(),this._boundShow=this.show.bind(this),this._boundHide=this.hide.bind(this),this._boundOnKeyup=this._onKeyup.bind(this)}connectedCallback(){super.connectedCallback(),this._attachToTarget(),this._setDefaultId()}ready(){super.ready(),window.addEventListener("resize",(()=>{clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const{targetElement:e,hidden:t,position:i}=this;this.hidden||this._setPosition(e,t,i)}),100)})),this.getAttribute("theme")||this.setAttribute("theme","dark")}disconnectedCallback(){super.disconnectedCallback(),this._detachFromTarget()}_manualObserver(){this.manual?this._removeEvents():this._addEvents()}_attachToTarget(e,t){t&&(this._removeTargetEvents(t),t.describedby&&(t.removeAttribute("aria-describedby"),delete t.describedby)),e&&(this._addEvents(),e.getAttribute("aria-describedby")||(e.setAttribute("aria-describedby",this.id),e.describedby=!0))}_addEvents(){this.targetElement&&!this.manual&&(this.targetElement.addEventListener("mouseenter",this._boundShow),this.targetElement.addEventListener("focus",this._boundShow),this.targetElement.addEventListener("mouseleave",this._boundHide),this.targetElement.addEventListener("blur",this._boundHide),this.targetElement.addEventListener("tap",this._boundHide)),this.manual||(this.addEventListener("mouseenter",this._boundShow),this.addEventListener("mouseleave",this._boundHide))}_detachFromTarget(){this.manual||this._removeEvents(),this.targetElement&&this.targetElement.describedby&&(this.targetElement.removeAttribute("aria-describedby"),delete this.targetElement.describedby)}_removeEvents(){this.targetElement&&this._removeTargetEvents(this.targetElement),this.removeEventListener("mouseenter",this._boundShow),this.removeEventListener("mouseleave",this._boundHide)}_removeTargetEvents(e){e.removeEventListener("mouseenter",this._boundShow),e.removeEventListener("focus",this._boundShow),e.removeEventListener("mouseleave",this._boundHide),e.removeEventListener("blur",this._boundHide),e.removeEventListener("tap",this._boundHide)}_updateTarget(){this.targetElement=this.parentNode.querySelector(`#${this.for}`)}_setPosition(e,t,i){if(e&&!t){let e=window.innerHeight,t=window.innerWidth;this.offsetParent&&(e=this.offsetParent.scrollHeight,t=this.offsetParent.scrollWidth);const s=this.targetElement.getBoundingClientRect(),a=this.getBoundingClientRect(),o=(s.width-a.width)/2,n=(s.height-a.height)/2;let r,l,d=s.left,c=s.top,u=window.pageYOffset;switch(this._parentPostioned&&(c=this.targetElement.offsetTop,d=this.targetElement.offsetLeft,u=0),i){case"top":l=c-a.height+u,r=this._calculateLeft(d,s,a,o);break;case"bottom":l=c+s.height+u,r=this._calculateLeft(d,s,a,o);break;case"left":r=d-a.width,l=this._calculateTop(c,s,a,n,u);break;case"right":r=d+s.width,l=this._calculateTop(c,s,a,n,u)}this._setPositionInVisibleBounds(e,t,r,l,a)}}get _parentPostioned(){return"static"!==window.getComputedStyle(this.offsetParent).position}_setPositionInVisibleBounds(e,t,i,s,a){i+a.width>t?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,i)+"px",this.style.right="auto"),s+a.height>e?(this.style.bottom=e+"px",this.style.top="auto"):(this.style.top=Math.max(0,s)+"px",this.style.bottom="auto")}_calculateLeft(e,t,i,s){switch(this.align){case"left":return e;case"right":return t.left+t.width-i.width;default:return e+s}}_calculateTop(e,t,i,s,a){switch(this.align){case"top":return e+a;case"bottom":return e+t.height-i.height+a;default:return e+s+a}}show(){this.hidden=!1}hide(){this.hidden=!0}_hiddenChanged(e){e?(this.setAttribute("aria-hidden",!0),window.removeEventListener("keyup",this._boundOnKeyup)):(this.setAttribute("aria-hidden",!1),window.addEventListener("keyup",this._boundOnKeyup))}_onKeyup(e){27===e.keyCode&&this.hide()}_setDefaultId(){this.id||(Vaadin.tooltipIndex||(Vaadin.tooltipIndex=0),this.id="vcf-tooltip"+ ++Vaadin.tooltipIndex)}}function w(e){return function*(e){const t=[];for(const i of e.settings.subscriptions.allowFrequencyModification)if(x(i.jsonataQuery).evaluate(e.subscription))for(const e of i.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}customElements.define($.is,$),window.Vaadin.VcfTooltip=$;class S extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function T(e){const t=864e5,i=31*t;if(".5m"===e)return i/2;const s=parseInt(e.substring(0,e.length-1));if(isNaN(s))throw new S(e);if(e.endsWith("y"))return 31536e6*s;if(e.endsWith("m"))return s*i;if(e.endsWith("w"))return 6048e5*s;if(e.endsWith("d"))return s*t;throw new S(e)}function j(e,t){if("boolean"==typeof t)return t;const i=t.filter((t=>Boolean(x(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var i,s,a,o,n;if(t.min){const i=e.min?T(e.min):1/0;T(t.min)<i&&(e.min=t.min)}if(t.max){const i=e.max?T(e.max):-1/0;T(t.max)>i&&(e.max=t.max)}if("day"===(null===(i=t.allowedDays)||void 0===i?void 0:i.type)){const i=[...null!==(s=e.allowedDaysOfWeek)&&void 0!==s?s:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(i))}if("month"===(null===(a=t.allowedDays)||void 0===a?void 0:a.type)){const i=[...null!==(o=e.allowedDaysOfMonth)&&void 0!==o?o:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(i))}if(t.disallowedDates){const i=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(i))}return e}),{});return 0!==Object.keys(i).length&&i}function E(e){const[t,i,s]=e.split("-").map((e=>parseInt(e)));return new Date(t,i-1,s)}function D(e){const t=e.settings.subscriptions.allow_next_date_modification;let i;return i="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,i;const s=E(e.value),a=s.getTime(),o=j(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof o)return o;if(!1===(null===(t=o.allowedDaysOfMonth)||void 0===t?void 0:t.includes(s.getDate())))return!1;if(!1===(null===(i=o.allowedDaysOfWeek)||void 0===i?void 0:i.includes(s.getDay())))return!1;if(o.disallowedDates&&o.disallowedDates.find((e=>{const[t,i]=e.split("..").map((e=>E(e).getTime()));return a===t||void 0!==i&&a>=t&&a<=i})))return!1;if(o.min){const e=g(o.min);if(null!==e&&Date.now()+e>=a)return!1}if(o.max){const e=g(o.max);if(null!==e&&Date.now()+e<=a)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:i}},subscription:e.subscription,value:e.value})}let k,q,L,H,I,O,A,C,P,z,N,F,R,V,B,M,U,W,K=e=>e;const Q=o(n(r(c,"subscription-form")));class J extends Q{constructor(){super(...arguments),this.getTransactionPageHref=(e,t)=>null==t?void 0:t._links["fx:receipt"].href,this.getCustomerPageHref=null,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.templates={},this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderHeaderSubtitle=()=>{var e;const{data:t,lang:i,ns:s}=this;if(t){let a,o,n="text-secondary";if(t.first_failed_transaction_date)n="text-error",a=t.first_failed_transaction_date,o="subscription_failed";else if(t.end_date){a=t.end_date;o=new Date(a).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}else a=null!==(e=t.next_transaction_date)&&void 0!==e?e:(new Date).toISOString(),o="subscription_"+(t.is_active?"active":"inactive");const r=d(k||(k=K` <foxy-i18n data-testid="header-subtitle" options="${0}" class="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify({date:a}),n,i,o,s);return t.first_failed_transaction_date?d(q||(q=K` <span id="status" class="flex items-center space-x-xs ${0}"> ${0}<iron-icon icon="icons:info-outline" class="icon-inline"></iron-icon> </span> <vcf-tooltip for="status" position="bottom"> <span class="text-s">${0}</span> </vcf-tooltip> `),n,r,t.error_message):r}return d(L||(L=K`<x-skeleton class="w-full" variant="static">&nbsp;</x-skeleton>`))},this.__renderHeaderTitle=(e,t)=>{const{data:i,lang:s,ns:a}=this;if(i){const o=y(i.frequency),n=this.__transactionTemplate,r=null==n?void 0:n.total_order;return"string"!=typeof e?d(H||(H=K`--`)):d(I||(I=K` <foxy-i18n data-testid="header-title" options="${0}" lang="${0}" key="price_${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(u({},o),{},{amount:`${r} ${e}`,currencyDisplay:t})),s,".5m"===i.frequency?"twice_a_month":"recurring",a)}return d(O||(O=K`<x-skeleton class="w-full" variant="static">&nbsp;</x-skeleton>`))},this.__renderHeader=(e,t)=>d(A||(A=K` <div data-testid="header" class="sm-col-span-2"> ${0} <div class="leading-xs text-xxl font-medium truncate"> ${0} </div> <div class="leading-xs text-l">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.__renderHeaderTitle(e,t),this.__renderHeaderSubtitle(),this.renderTemplateOrSlot("header:after")),this.__renderItemsActions=()=>d(C||(C=K` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-s font-medium text-secondary" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var e;let t;try{const i=this.__transactionTemplate,s=new URL(null!==(e=null==i?void 0:i._links["fx:items"].href)&&void 0!==e?e:"");s.searchParams.set("zoom","item_options"),t=s.toString()}catch(e){t=void 0}return d(P||(P=K` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" limit="5" infer="items" item="foxy-item-card"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),b(t))},this.__renderEndDate=()=>{const{disabledSelector:e,lang:t,ns:i}=this,s=this.hiddenSelector.zoom("end-date:form").toString();return d(z||(z=K` <div class="sm-col-span-2"> ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="save-button ${0}" data-testid="cancellation-form" parent="${0}" header="end_subscription" alert form="foxy-cancellation-form" href="${0}" lang="${0}" id="end-date-form" ns="${0}" .templates="${0}"> </foxy-form-dialog> <vaadin-button data-testid="end-date" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="end_subscription" ns="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),this.readonlySelector.zoom("end-date:form").toString(),e.zoom("end-date:form").toString(),s,this.parent,this.href,t,i,this.getNestedTemplates("end-date:form"),!this.data||e.matches("end-date",!0),(e=>{this.renderRoot.querySelector("#end-date-form").show(e.currentTarget)}),i,t,this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:i}=this;if(t&&i){return D({value:v(e),settings:t,subscription:i})}return e.getTime()>=Date.now()},this.__checkStartDateAvailability=e=>e.getTime()>=Date.now(),this.__renderStartDate=()=>{const{data:e,lang:t,ns:i}=this;return d(N||(N=K` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),i,t,b(null==e?void 0:e.start_date.substr(0,10)),b(null==e?void 0:e.start_date),t,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(e=>{const t=e.target;this.edit({start_date:t.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:i}=this,s=!!(null==e?void 0:e.is_active);return d(F||(F=K` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),i,t,b(null==e?void 0:e.next_transaction_date.substr(0,10)),b(null==e?void 0:e.next_transaction_date),t,!s||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),i=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",y(e)),value:e})));return d(R||(R=K` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),b(this.form.frequency),i,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:i,ns:s}=this;return d(V||(V=K` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),s,i,s,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>d(B||(B=K` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(y(e)),e,i,".5m"===e?"twice_a_month":"frequency",s))))},this.__renderFrequency=()=>d(M||(M=K` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__renderCustomer=()=>{var e,t;const i=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,s=i?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,i):void 0;return d(U||(U=K` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="customer" href="${0}"></foxy-customer-card> </a> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),m({"block rounded transition-colors":!0,"ring-1 ring-contrast-10":!s,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!s,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!s}),b(s),b(i),this.renderTemplateOrSlot("customer:after"))}}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-collection-pages":customElements.get("foxy-collection-pages"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-customer-card":customElements.get("foxy-customer-card"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-form-dialog":customElements.get("foxy-form-dialog"),"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-table":customElements.get("foxy-table"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":p,"x-choice":f,"x-group":_}}static get properties(){return u(u({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},settings:{type:Object},coupons:{}})}get hiddenSelector(){return new h(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}renderBody(){var e,t,i,s,a,o,n,r,l;let c;try{const i=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");i.searchParams.set("order","transaction_date desc"),i.searchParams.set("zoom","items"),c=i.toString()}catch(e){c=void 0}const u=(null===(i=this.__store)||void 0===i?void 0:i.use_international_currency_symbol)?"code":"symbol",h=this.__transactionTemplate;let m=null;if(null==h?void 0:h.currency_code)m=h.currency_code;else{const e=this.__localeCodesHelper,t=null===(a=null!==(s=this.__templateSet)&&void 0!==s?s:this.__defaultTemplateSet)||void 0===a?void 0:a.locale_code,i=t?null==e?void 0:e.values[t]:void 0;i&&(m=null!==(n=null===(o=/Currency: ([A-Z]{3})/g.exec(i))||void 0===o?void 0:o[1])&&void 0!==n?n:null)}return d(W||(W=K` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> ${0} </div> `),b(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),b(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),b(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),b(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),b(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(null!=m?m:void 0,u),this.hiddenSelector.matches("customer",!0)?"":this.__renderCustomer(),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",b(null!=m?m:void 0),b(null===(l=null===(r=this.data)||void 0===r?void 0:r._links["fx:attributes"])||void 0===l?void 0:l.href),b(c),this.getTransactionPageHref,this.hiddenSelector.matches("end-date",!0)?"":this.__renderEndDate())}get __transactionTemplateHref(){var e;const t=this.data;return(null===(e=null==t?void 0:t._embedded)||void 0===e?void 0:e["fx:transaction_template"])||null==t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var e,t,i;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(i=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==i?i:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __templateSetHref(){const e=this.__transactionTemplate;if(!(null==e?void 0:e.currency_code))return(null==e?void 0:e.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t,i;const s=this.data,a=null===(e=null==s?void 0:s._embedded)||void 0===e?void 0:e["fx:transaction_template"],o=`#${this.__transactionTemplateLoaderId}`;return null!==(i=null!=a?a:null===(t=this.renderRoot.querySelector(o))||void 0===t?void 0:t.data)&&void 0!==i?i:null}get __defaultTemplateSet(){var e,t;const i=`#${this.__defaultTemplateSetLoaderId}`,s=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const i=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const i=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const i=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __isNextTransactionDateVisible(){if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;const e=this.settings.subscriptions.allow_next_date_modification;return!!function(e,t){let i;return i="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),j(e,i)}(this.data,e)}get __isStartDateVisible(){return!this.hiddenSelector.matches("start-date",!0)&&this.__isNextTransactionDateVisible}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isFrequencyVisible(){if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;return!w({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=w({subscription:this.data,settings:this.settings});return Array.from(e)}}let G;a("vcf-tooltip",l(G||(G=(e=>e)`
96
96
  :host([hidden]) [part='container']{
97
97
  display:none !important;
98
98
  }
@@ -1 +1 @@
1
- import"./shared-797b6161.js";import"./shared-f23627ae.js";import"./shared-bbb8ec69.js";import"./shared-00b50abf.js";import"./shared-0dd25feb.js";import{I as e}from"./shared-ec3332b9.js";import{I as t}from"./shared-b39fce1b.js";import"./shared-d1c45954.js";import{c as s,h as a}from"./shared-7f33a83a.js";import{y as i,a as r}from"./shared-04634a6f.js";import"./shared-1e55acbb.js";import"./shared-27d23dfd.js";import"./shared-f0c8a5bd.js";import"./shared-bdd5c908.js";import"./shared-98eec370.js";import"./shared-acda8da2.js";import"./shared-98755831.js";import"./shared-d3bf9ac0.js";import"./shared-4e709717.js";import"./shared-d519a301.js";import"./shared-f3b35364.js";import"./shared-11c2efc8.js";import"./shared-64f2d6de.js";import"./shared-7c761c65.js";import"./shared-50908853.js";import"./shared-0479553e.js";import"./shared-de790de9.js";import"./shared-a8cf402a.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-64657919.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-025cab8b.js";import"./shared-3d6f0788.js";import"./shared-80792dc8.js";import"./foxy-spinner.js";import"./shared-313a39ef.js";let o,n,l,p=e=>e;let u,d,c=e=>e;const m=s(u||(u=c`:host(.foxy-internal-subscription-settings-form-reattempt-bypass) label{padding-bottom:var(--lumo-space-xs)}:host(.foxy-internal-subscription-settings-form-reattempt-bypass) [part=group-field]{display:flex;border:thin solid var(--lumo-contrast-10pct);border-radius:var(--lumo-border-radius);transition:border-color .15s ease}:host(.foxy-internal-subscription-settings-form-reattempt-bypass:not([disabled]):not([readonly]):hover) [part=group-field]{border-color:var(--lumo-contrast-20pct)}`)),_=s(d||(d=c`:host(.foxy-internal-subscription-settings-form-reattempt-bypass) label{display:flex}:host(.foxy-internal-subscription-settings-form-reattempt-bypass) [part=label]{flex:1}`));customElements.define("foxy-internal-subscription-settings-form-reattempt-bypass",class extends t{constructor(){super(...arguments),this.nucleon=null,this.__getReattemptBypassStringsValue=()=>{var e,t,s;return(null!==(s=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.reattempt_bypass_strings)||void 0===t?void 0:t.split(","))&&void 0!==s?s:[]).map((e=>e.trim())).filter(((e,t,s)=>e&&s.indexOf(e)===t)).map((e=>({value:e})))},this.__setReattemptBypassStringsValue=e=>{var t,s;const a=this.renderRoot.querySelector("vaadin-radio-group"),i=null!==(t=null==a?void 0:a.value)&&void 0!==t?t:"reattempt_if_exists";null===(s=this.nucleon)||void 0===s||s.edit({reattempt_bypass_strings:e.map((({value:e})=>e)).join(),reattempt_bypass_logic:i})}}static get styles(){return[super.styles,s(o||(o=p`.visible-if-checked{display:none}[checked] .visible-if-checked{display:block}`))]}renderControl(){const e=a(n||(n=p` <foxy-internal-editable-list-control infer="reattempt-bypass-strings" class="w-full visible-if-checked" .getValue="${0}" .setValue="${0}" @mousedown="${0}" @mouseup="${0}" @keydown="${0}" @click="${0}"> </foxy-internal-editable-list-control> `),this.__getReattemptBypassStringsValue,this.__setReattemptBypassStringsValue,(e=>e.stopPropagation()),(e=>e.stopPropagation()),(e=>e.stopPropagation()),(e=>(e.preventDefault(),e.stopPropagation())));let t;const s=this.nucleon,i=null==s?void 0:s.form.reattempt_bypass_logic;return(null==s?void 0:s.form.reattempt_bypass_strings)?t=i:"reattempt_if_exists"===i?t="never_reattempt":"skip_if_exists"===i&&(t="always_reattempt"),a(l||(l=p` <vaadin-radio-group helper-text="${0}" label="${0}" class="foxy-internal-subscription-settings-form-reattempt-bypass w-full divide-y divide-contrast-10 group" theme="vertical" ?disabled="${0}" ?readonly="${0}" .value="${0}" @value-changed="${0}"> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="reattempt_if_exists"> <foxy-i18n infer="" key="option_reattempt_if_exists"></foxy-i18n> ${0} </vaadin-radio-button> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="skip_if_exists"> <foxy-i18n infer="" key="option_skip_if_exists"></foxy-i18n> ${0} </vaadin-radio-button> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="always_reattempt"> <foxy-i18n infer="" key="option_always_reattempt"></foxy-i18n> </vaadin-radio-button> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="never_reattempt"> <foxy-i18n infer="" key="option_never_reattempt"></foxy-i18n> </vaadin-radio-button> </vaadin-radio-group> `),this.helperText,this.label,this.disabled,this.readonly,t,this.__handleGroupValueChanged,e,e)}__handleGroupValueChanged(e){const t=e.currentTarget.value,s=this.nucleon;"never_reattempt"!==t&&"always_reattempt"!==t||("never_reattempt"===t?"reattempt_if_exists"!==(null==s?void 0:s.form.reattempt_bypass_logic)&&(null==s||s.edit({reattempt_bypass_logic:"reattempt_if_exists"})):"skip_if_exists"!==(null==s?void 0:s.form.reattempt_bypass_logic)&&(null==s||s.edit({reattempt_bypass_logic:"skip_if_exists"})),(null==s?void 0:s.form.reattempt_bypass_strings)&&(null==s||s.edit({reattempt_bypass_strings:""})))}}),i("vaadin-radio-group",m),i("vaadin-radio-button",_);let h,f,y=e=>e;const g=r(e,"subscription-settings-form");class b extends g{constructor(){super(...arguments),this.templates={},this.__sendEmailReceiptsForAutomatedBillingOptions=[{label:"option_checked",value:"checked"}],this.__automaticallyChargePastDueAmountOptions=[{label:"option_checked",value:"checked"}],this.__clearPastDueAmountsOnSuccessOptions=[{label:"option_checked",value:"checked"}],this.__resetNextDateOnMakeUpPaymentOptions=[{label:"option_checked",value:"checked"}],this.__pastDueAmountHandlingOptions=[{label:"option_increment",value:"increment"},{label:"option_replace",value:"replace"},{label:"option_ignore",value:"ignore"}],this.__positiveIntegerInputParams={type:"number",step:"1",min:"0"},this.__sendEmailReceiptsForAutomatedBillingGetValue=()=>this.form.send_email_receipts_for_automated_billing?["checked"]:[],this.__sendEmailReceiptsForAutomatedBillingSetValue=e=>{this.edit({send_email_receipts_for_automated_billing:e.includes("checked")})},this.__expiringSoonPaymentReminderScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.expiring_soon_payment_reminder_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,s)=>!isNaN(e)&&s.indexOf(e)===t)).sort(((e,t)=>t-e)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__expiringSoonPaymentReminderScheduleSetValue=e=>{this.edit({expiring_soon_payment_reminder_schedule:e.map((({value:e})=>e)).join()})},this.__automaticallyChargePastDueAmountGetValue=()=>this.form.automatically_charge_past_due_amount?["checked"]:[],this.__automaticallyChargePastDueAmountSetValue=e=>{const t=e.includes("checked");this.edit({automatically_charge_past_due_amount:t,clear_past_due_amounts_on_success:!t&&void 0,reset_nextdate_on_makeup_payment:!t&&void 0})},this.__clearPastDueAmountsOnSuccessGetValue=()=>this.form.clear_past_due_amounts_on_success?["checked"]:[],this.__clearPastDueAmountsOnSuccessSetValue=e=>{this.edit({clear_past_due_amounts_on_success:e.includes("checked")})},this.__resetNextDateOnMakeUpPaymentGetValue=()=>this.form.reset_nextdate_on_makeup_payment?["checked"]:[],this.__resetNextDateOnMakeUpPaymentSetValue=e=>{this.edit({reset_nextdate_on_makeup_payment:e.includes("checked")})},this.__reminderEmailScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reminder_email_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,s)=>!isNaN(e)&&s.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reminderEmailScheduleSetValue=e=>{this.edit({reminder_email_schedule:e.map((({value:e})=>e)).join()})},this.__reattemptScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reattempt_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,s)=>!isNaN(e)&&s.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reattemptScheduleSetValue=e=>{this.edit({reattempt_schedule:e.map((({value:e})=>e)).join()})}}static get v8n(){return[({expiring_soon_payment_reminder_schedule:e})=>!e||e.length<=100||"expiring-soon-payment-reminder-schedule:v8n_too_long",({reattempt_bypass_strings:e})=>!e||e.length<=400||"reattempt-bypass-strings:v8n_too_long",({reminder_email_schedule:e})=>!e||e.length<=100||"reminder-email-schedule:v8n_too_long",({reattempt_schedule:e})=>!e||e.length<=100||"reattempt-schedule:v8n_too_long"]}renderBody(){return a(h||(h=y` <foxy-internal-radio-group-control infer="past-due-amount-handling" theme="vertical list" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="automatically-charge-past-due-amount" class="-mt-xs -mb-m" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-subscription-settings-form-reattempt-bypass infer="reattempt-bypass"> </foxy-internal-subscription-settings-form-reattempt-bypass> <foxy-internal-editable-list-control infer="reattempt-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="reminder-email-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="expiring-soon-payment-reminder-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="send-email-receipts-for-automated-billing" class="-mt-xs -mb-m" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-integer-control suffix="${0}" infer="cancellation-schedule" min="1"> </foxy-internal-integer-control> <foxy-internal-text-control infer="modification-url"></foxy-internal-text-control> ${0} `),this.__pastDueAmountHandlingOptions,this.__automaticallyChargePastDueAmountGetValue,this.__automaticallyChargePastDueAmountSetValue,this.__automaticallyChargePastDueAmountOptions,this.form.automatically_charge_past_due_amount?"":a(f||(f=y` <foxy-internal-checkbox-group-control infer="clear-past-due-amounts-on-success" class="-mt-xs -mb-m" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="reset-nextdate-on-makeup-payment" class="-mt-xs -mb-m" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__clearPastDueAmountsOnSuccessGetValue,this.__clearPastDueAmountsOnSuccessSetValue,this.__clearPastDueAmountsOnSuccessOptions,this.__resetNextDateOnMakeUpPaymentGetValue,this.__resetNextDateOnMakeUpPaymentSetValue,this.__resetNextDateOnMakeUpPaymentOptions),this.__positiveIntegerInputParams,this.__reattemptScheduleGetValue,this.__reattemptScheduleSetValue,this.__positiveIntegerInputParams,this.__reminderEmailScheduleGetValue,this.__reminderEmailScheduleSetValue,this.__positiveIntegerInputParams,this.__expiringSoonPaymentReminderScheduleGetValue,this.__expiringSoonPaymentReminderScheduleSetValue,this.__sendEmailReceiptsForAutomatedBillingOptions,this.__sendEmailReceiptsForAutomatedBillingGetValue,this.__sendEmailReceiptsForAutomatedBillingSetValue,this.__cancellationScheduleSuffix,super.renderBody())}get __cancellationScheduleSuffix(){const e=this.form.cancellation_schedule;return e?this.t("day_suffix",{count:e}):""}}customElements.define("foxy-subscription-settings-form",b);export{b as SubscriptionSettingsForm};
1
+ import"./shared-dcbaa1c5.js";import"./shared-8349938a.js";import"./shared-a6518411.js";import"./shared-b88e35b7.js";import"./shared-1e5292a1.js";import{I as e}from"./shared-6fb923d5.js";import{I as t}from"./shared-0c02b4ee.js";import"./shared-86768244.js";import{c as s,h as a}from"./shared-7f33a83a.js";import{y as i,a as r}from"./shared-16b542bc.js";import"./shared-d493355a.js";import"./shared-c40d85dc.js";import"./shared-7a290f36.js";import"./shared-b95ef318.js";import"./shared-4c9f96ec.js";import"./shared-e28f16db.js";import"./shared-98755831.js";import"./shared-d3bf9ac0.js";import"./shared-4e709717.js";import"./shared-d519a301.js";import"./shared-f3b35364.js";import"./shared-11c2efc8.js";import"./shared-aeec3cab.js";import"./shared-f3f5e87e.js";import"./shared-5dd31b4e.js";import"./shared-0479553e.js";import"./shared-de790de9.js";import"./shared-a8cf402a.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-64657919.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-cb6f2388.js";import"./shared-0dc1d012.js";import"./shared-9e60ef60.js";import"./foxy-spinner.js";import"./shared-ca58ef47.js";let o,n,l,p=e=>e;let u,d,c=e=>e;const m=s(u||(u=c`:host(.foxy-internal-subscription-settings-form-reattempt-bypass) label{padding-bottom:var(--lumo-space-xs)}:host(.foxy-internal-subscription-settings-form-reattempt-bypass) [part=group-field]{display:flex;border:thin solid var(--lumo-contrast-10pct);border-radius:var(--lumo-border-radius);transition:border-color .15s ease}:host(.foxy-internal-subscription-settings-form-reattempt-bypass:not([disabled]):not([readonly]):hover) [part=group-field]{border-color:var(--lumo-contrast-20pct)}`)),_=s(d||(d=c`:host(.foxy-internal-subscription-settings-form-reattempt-bypass) label{display:flex}:host(.foxy-internal-subscription-settings-form-reattempt-bypass) [part=label]{flex:1}`));customElements.define("foxy-internal-subscription-settings-form-reattempt-bypass",class extends t{constructor(){super(...arguments),this.nucleon=null,this.__getReattemptBypassStringsValue=()=>{var e,t,s;return(null!==(s=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.reattempt_bypass_strings)||void 0===t?void 0:t.split(","))&&void 0!==s?s:[]).map((e=>e.trim())).filter(((e,t,s)=>e&&s.indexOf(e)===t)).map((e=>({value:e})))},this.__setReattemptBypassStringsValue=e=>{var t,s;const a=this.renderRoot.querySelector("vaadin-radio-group"),i=null!==(t=null==a?void 0:a.value)&&void 0!==t?t:"reattempt_if_exists";null===(s=this.nucleon)||void 0===s||s.edit({reattempt_bypass_strings:e.map((({value:e})=>e)).join(),reattempt_bypass_logic:i})}}static get styles(){return[super.styles,s(o||(o=p`.visible-if-checked{display:none}[checked] .visible-if-checked{display:block}`))]}renderControl(){const e=a(n||(n=p` <foxy-internal-editable-list-control infer="reattempt-bypass-strings" class="w-full visible-if-checked" .getValue="${0}" .setValue="${0}" @mousedown="${0}" @mouseup="${0}" @keydown="${0}" @click="${0}"> </foxy-internal-editable-list-control> `),this.__getReattemptBypassStringsValue,this.__setReattemptBypassStringsValue,(e=>e.stopPropagation()),(e=>e.stopPropagation()),(e=>e.stopPropagation()),(e=>(e.preventDefault(),e.stopPropagation())));let t;const s=this.nucleon,i=null==s?void 0:s.form.reattempt_bypass_logic;return(null==s?void 0:s.form.reattempt_bypass_strings)?t=i:"reattempt_if_exists"===i?t="never_reattempt":"skip_if_exists"===i&&(t="always_reattempt"),a(l||(l=p` <vaadin-radio-group helper-text="${0}" label="${0}" class="foxy-internal-subscription-settings-form-reattempt-bypass w-full divide-y divide-contrast-10 group" theme="vertical" ?disabled="${0}" ?readonly="${0}" .value="${0}" @value-changed="${0}"> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="reattempt_if_exists"> <foxy-i18n infer="" key="option_reattempt_if_exists"></foxy-i18n> ${0} </vaadin-radio-button> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="skip_if_exists"> <foxy-i18n infer="" key="option_skip_if_exists"></foxy-i18n> ${0} </vaadin-radio-button> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="always_reattempt"> <foxy-i18n infer="" key="option_always_reattempt"></foxy-i18n> </vaadin-radio-button> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="never_reattempt"> <foxy-i18n infer="" key="option_never_reattempt"></foxy-i18n> </vaadin-radio-button> </vaadin-radio-group> `),this.helperText,this.label,this.disabled,this.readonly,t,this.__handleGroupValueChanged,e,e)}__handleGroupValueChanged(e){const t=e.currentTarget.value,s=this.nucleon;"never_reattempt"!==t&&"always_reattempt"!==t||("never_reattempt"===t?"reattempt_if_exists"!==(null==s?void 0:s.form.reattempt_bypass_logic)&&(null==s||s.edit({reattempt_bypass_logic:"reattempt_if_exists"})):"skip_if_exists"!==(null==s?void 0:s.form.reattempt_bypass_logic)&&(null==s||s.edit({reattempt_bypass_logic:"skip_if_exists"})),(null==s?void 0:s.form.reattempt_bypass_strings)&&(null==s||s.edit({reattempt_bypass_strings:""})))}}),i("vaadin-radio-group",m),i("vaadin-radio-button",_);let h,f,y=e=>e;const g=r(e,"subscription-settings-form");class b extends g{constructor(){super(...arguments),this.templates={},this.__sendEmailReceiptsForAutomatedBillingOptions=[{label:"option_checked",value:"checked"}],this.__automaticallyChargePastDueAmountOptions=[{label:"option_checked",value:"checked"}],this.__clearPastDueAmountsOnSuccessOptions=[{label:"option_checked",value:"checked"}],this.__resetNextDateOnMakeUpPaymentOptions=[{label:"option_checked",value:"checked"}],this.__pastDueAmountHandlingOptions=[{label:"option_increment",value:"increment"},{label:"option_replace",value:"replace"},{label:"option_ignore",value:"ignore"}],this.__positiveIntegerInputParams={type:"number",step:"1",min:"0"},this.__sendEmailReceiptsForAutomatedBillingGetValue=()=>this.form.send_email_receipts_for_automated_billing?["checked"]:[],this.__sendEmailReceiptsForAutomatedBillingSetValue=e=>{this.edit({send_email_receipts_for_automated_billing:e.includes("checked")})},this.__expiringSoonPaymentReminderScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.expiring_soon_payment_reminder_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,s)=>!isNaN(e)&&s.indexOf(e)===t)).sort(((e,t)=>t-e)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__expiringSoonPaymentReminderScheduleSetValue=e=>{this.edit({expiring_soon_payment_reminder_schedule:e.map((({value:e})=>e)).join()})},this.__automaticallyChargePastDueAmountGetValue=()=>this.form.automatically_charge_past_due_amount?["checked"]:[],this.__automaticallyChargePastDueAmountSetValue=e=>{const t=e.includes("checked");this.edit({automatically_charge_past_due_amount:t,clear_past_due_amounts_on_success:!t&&void 0,reset_nextdate_on_makeup_payment:!t&&void 0})},this.__clearPastDueAmountsOnSuccessGetValue=()=>this.form.clear_past_due_amounts_on_success?["checked"]:[],this.__clearPastDueAmountsOnSuccessSetValue=e=>{this.edit({clear_past_due_amounts_on_success:e.includes("checked")})},this.__resetNextDateOnMakeUpPaymentGetValue=()=>this.form.reset_nextdate_on_makeup_payment?["checked"]:[],this.__resetNextDateOnMakeUpPaymentSetValue=e=>{this.edit({reset_nextdate_on_makeup_payment:e.includes("checked")})},this.__reminderEmailScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reminder_email_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,s)=>!isNaN(e)&&s.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reminderEmailScheduleSetValue=e=>{this.edit({reminder_email_schedule:e.map((({value:e})=>e)).join()})},this.__reattemptScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reattempt_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,s)=>!isNaN(e)&&s.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reattemptScheduleSetValue=e=>{this.edit({reattempt_schedule:e.map((({value:e})=>e)).join()})}}static get v8n(){return[({expiring_soon_payment_reminder_schedule:e})=>!e||e.length<=100||"expiring-soon-payment-reminder-schedule:v8n_too_long",({reattempt_bypass_strings:e})=>!e||e.length<=400||"reattempt-bypass-strings:v8n_too_long",({reminder_email_schedule:e})=>!e||e.length<=100||"reminder-email-schedule:v8n_too_long",({reattempt_schedule:e})=>!e||e.length<=100||"reattempt-schedule:v8n_too_long"]}renderBody(){return a(h||(h=y` <foxy-internal-radio-group-control infer="past-due-amount-handling" theme="vertical list" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="automatically-charge-past-due-amount" class="-mt-xs -mb-m" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-subscription-settings-form-reattempt-bypass infer="reattempt-bypass"> </foxy-internal-subscription-settings-form-reattempt-bypass> <foxy-internal-editable-list-control infer="reattempt-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="reminder-email-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="expiring-soon-payment-reminder-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="send-email-receipts-for-automated-billing" class="-mt-xs -mb-m" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-integer-control suffix="${0}" infer="cancellation-schedule" min="1"> </foxy-internal-integer-control> <foxy-internal-text-control infer="modification-url"></foxy-internal-text-control> ${0} `),this.__pastDueAmountHandlingOptions,this.__automaticallyChargePastDueAmountGetValue,this.__automaticallyChargePastDueAmountSetValue,this.__automaticallyChargePastDueAmountOptions,this.form.automatically_charge_past_due_amount?"":a(f||(f=y` <foxy-internal-checkbox-group-control infer="clear-past-due-amounts-on-success" class="-mt-xs -mb-m" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="reset-nextdate-on-makeup-payment" class="-mt-xs -mb-m" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__clearPastDueAmountsOnSuccessGetValue,this.__clearPastDueAmountsOnSuccessSetValue,this.__clearPastDueAmountsOnSuccessOptions,this.__resetNextDateOnMakeUpPaymentGetValue,this.__resetNextDateOnMakeUpPaymentSetValue,this.__resetNextDateOnMakeUpPaymentOptions),this.__positiveIntegerInputParams,this.__reattemptScheduleGetValue,this.__reattemptScheduleSetValue,this.__positiveIntegerInputParams,this.__reminderEmailScheduleGetValue,this.__reminderEmailScheduleSetValue,this.__positiveIntegerInputParams,this.__expiringSoonPaymentReminderScheduleGetValue,this.__expiringSoonPaymentReminderScheduleSetValue,this.__sendEmailReceiptsForAutomatedBillingOptions,this.__sendEmailReceiptsForAutomatedBillingGetValue,this.__sendEmailReceiptsForAutomatedBillingSetValue,this.__cancellationScheduleSuffix,super.renderBody())}get __cancellationScheduleSuffix(){const e=this.form.cancellation_schedule;return e?this.t("day_suffix",{count:e}):""}}customElements.define("foxy-subscription-settings-form",b);export{b as SubscriptionSettingsForm};
@@ -1 +1 @@
1
- import"./foxy-spinner.js";import"./shared-d1c45954.js";import{S as s}from"./shared-e7ce4e47.js";export{S as SubscriptionsTable}from"./shared-e7ce4e47.js";import"./shared-acda8da2.js";import"./shared-f0c8a5bd.js";import"./shared-04634a6f.js";import"./shared-98755831.js";import"./shared-7f33a83a.js";import"./shared-313a39ef.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-ab69c97b.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";import"./shared-d2384b7b.js";customElements.define("foxy-subscriptions-table",s);
1
+ import"./foxy-spinner.js";import"./shared-86768244.js";import{S as s}from"./shared-eb4b4597.js";export{S as SubscriptionsTable}from"./shared-eb4b4597.js";import"./shared-e28f16db.js";import"./shared-7a290f36.js";import"./shared-16b542bc.js";import"./shared-98755831.js";import"./shared-7f33a83a.js";import"./shared-ca58ef47.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-6eb7dc77.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";import"./shared-bb009254.js";customElements.define("foxy-subscriptions-table",s);
@@ -1 +1 @@
1
- import"./shared-0479553e.js";import"./foxy-spinner.js";import{T as s}from"./shared-ab69c97b.js";export{T as Table}from"./shared-ab69c97b.js";import"./shared-7f33a83a.js";import"./shared-acda8da2.js";import"./shared-f0c8a5bd.js";import"./shared-04634a6f.js";import"./shared-98755831.js";import"./shared-313a39ef.js";import"./shared-d1c45954.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";customElements.define("foxy-table",s);
1
+ import"./shared-0479553e.js";import"./foxy-spinner.js";import{T as s}from"./shared-6eb7dc77.js";export{T as Table}from"./shared-6eb7dc77.js";import"./shared-7f33a83a.js";import"./shared-e28f16db.js";import"./shared-7a290f36.js";import"./shared-16b542bc.js";import"./shared-98755831.js";import"./shared-ca58ef47.js";import"./shared-86768244.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./shared-de790de9.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";customElements.define("foxy-table",s);
@@ -1 +1 @@
1
- import"./shared-44594184.js";import{h as a}from"./shared-7f33a83a.js";import{a as t}from"./shared-04634a6f.js";import{C as e}from"./shared-de790de9.js";import{I as r}from"./shared-07e32de2.js";import"./foxy-spinner.js";import"./shared-acda8da2.js";import"./shared-f0c8a5bd.js";import"./shared-313a39ef.js";import"./shared-d1c45954.js";import"./shared-98755831.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./shared-d3bf9ac0.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";let s,i=a=>a;class d extends(t(e(r),"tax-card")){renderBody(){const t=this.data;return a(s||(s=i` <div class="flex justify-between gap-s"> <div data-testid="title" class="font-medium truncate flex-shrink-0"> ${0}&ZeroWidthSpace; </div> <div data-testid="subtitle" class="truncate text-tertiary"> ${0} &bull; ${0} </div> </div> `),null==t?void 0:t.name,this.__typeLabel,this.__rateLabel)}get __typeLabel(){var a;const{type:t,country:e,region:r,city:s}=null!==(a=this.data)&&void 0!==a?a:{};return"global"===t?this.t("tax_global"):"union"===t?this.t("tax_union"):"country"===t?e:"region"===t?`${e}, ${r}`:"local"===t?`${e}, ${r}, ${s}`:void 0}get __rateLabel(){var a,t;if(!1===(null===(a=this.data)||void 0===a?void 0:a.is_live))return this.t("percent",{fraction:this.data.rate/100});const e=null===(t=this.data)||void 0===t?void 0:t.service_provider;return"onesource"===e?"Thomson Reuters ONESOURCE":"avalara"===e?"Avalara AvaTax 15":"taxjar"===e?"TaxJar":this.t("tax_rate_provider_default")}}customElements.define("foxy-tax-card",d);export{d as TaxCard};
1
+ import"./shared-49d978e1.js";import{h as t}from"./shared-7f33a83a.js";import{a}from"./shared-16b542bc.js";import{C as e}from"./shared-de790de9.js";import{I as r}from"./shared-3a252ccd.js";import"./foxy-spinner.js";import"./shared-e28f16db.js";import"./shared-7a290f36.js";import"./shared-ca58ef47.js";import"./shared-86768244.js";import"./shared-98755831.js";import"./shared-64657919.js";import"./shared-a8cf402a.js";import"./shared-d3bf9ac0.js";import"./shared-eb900735.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";import"./shared-a89cb472.js";import"./shared-4e709717.js";let s,i=t=>t;class d extends(a(e(r),"tax-card")){renderBody(){const a=this.data;return t(s||(s=i` <div class="flex justify-between gap-s"> <div data-testid="title" class="font-medium truncate flex-shrink-0"> ${0}&ZeroWidthSpace; </div> <div data-testid="subtitle" class="truncate text-tertiary"> ${0} &bull; ${0} </div> </div> `),null==a?void 0:a.name,this.__typeLabel,this.__rateLabel)}get __typeLabel(){var t;const{type:a,country:e,region:r,city:s}=null!==(t=this.data)&&void 0!==t?t:{};return"global"===a?this.t("tax_global"):"union"===a?this.t("tax_union"):"country"===a?e:"region"===a?`${e}, ${r}`:"local"===a?`${e}, ${r}, ${s}`:void 0}get __rateLabel(){var t,a;if(!1===(null===(t=this.data)||void 0===t?void 0:t.is_live))return this.t("percent",{fraction:this.data.rate/100});const e=null===(a=this.data)||void 0===a?void 0:a.service_provider;return"onesource"===e?"Thomson Reuters ONESOURCE":"avalara"===e?"Avalara AvaTax 15":"taxjar"===e?"TaxJar":this.t("tax_rate_provider_default")}}customElements.define("foxy-tax-card",d);export{d as TaxCard};
@@ -1 +1 @@
1
- import"./shared-3d6f0788.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-d1c45954.js";import"./shared-64f2d6de.js";import"./shared-bdd5c908.js";import"./shared-df1816e8.js";import"./shared-025cab8b.js";import{D as e}from"./shared-0237bfae.js";import{f as t,_ as i}from"./shared-98755831.js";import{C as r}from"./shared-ffd03d7b.js";import"./shared-b34bef61.js";import"./shared-80792dc8.js";import{h as s}from"./shared-7f33a83a.js";import{T as a,S as n,a as o}from"./shared-04634a6f.js";import"./shared-7c761c65.js";import"./shared-14bb06d4.js";import"./shared-27d23dfd.js";import"./shared-98eec370.js";import"./shared-acda8da2.js";import"./shared-4494ebfa.js";import{P as d}from"./shared-394c2425.js";import{c as l}from"./shared-4e709717.js";import{C as h}from"./shared-de790de9.js";import{N as c}from"./shared-eb900735.js";import{i as _}from"./shared-d3bf9ac0.js";import{i as m}from"./shared-a89cb472.js";import"./shared-313a39ef.js";import"./shared-f0c8a5bd.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-40638f2c.js";import"./shared-520be2e9.js";import"./shared-77a700fe.js";import"./shared-11c2efc8.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";let p,u,y,g,v,f,$,b,x,S,T,E,j,k,O=e=>e;const C=["US","CA","AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IM","IT","LT","LU","LV","MC","MT","NL","PL","PT","RO","SE","SI","SK"],w=[...C,"AU"],H=h(a(n(o(c,"tax-form"))));class A extends H{constructor(){var e;super(...arguments),e=this,this.templates={},this.__previousCountry=void 0,this.__countries="",this.__regions="",this.__countriesService=m(t.withConfig({services:{sendGet:async function(){const t=await new A.API(e).fetch(e.countries);if(!t.ok)throw new Error(await t.text());return await t.json()}}})),this.__regionsService=m(t.withConfig({services:{sendGet:async function(){var t;const i=new URL(e.regions);i.searchParams.set("country_code",null!==(t=e.form.country)&&void 0!==t?t:"US");const r=await new A.API(e).fetch(i.toString());if(!r.ok)throw new Error(await r.text());return await r.json()}}}))}static get scopedElements(){return{"vaadin-number-field":customElements.get("vaadin-number-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"vaadin-button":customElements.get("vaadin-button"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-property-table":d,"x-checkbox":r,"x-dropdown":e}}static get properties(){return i(i({},super.properties),{},{countries:{type:String,noAccessor:!0},regions:{type:String,noAccessor:!0}})}static get v8n(){return[({name:e})=>!!e||"name_required",({name:e})=>!e||e.length<=30||"name_too_long",({country:e,type:t})=>"country"!==t||!!e||"country_required",({country:e,type:t})=>"region"!==t||!!e||"country_required",({country:e,use_origin_rates:t})=>!t||!!e||"country_required",({country:e})=>!e||!!e.match(/[A-Z]{2}/)||"country_invalid",({region:e,type:t})=>"region"!=t||!!e||"region_required",({region:e})=>!e||e.length<=20||"region_too_long",({city:e})=>!e||e.length<=50||"city_too_long",({city:e,type:t})=>"local"!=t||!!e||"city_required",({rate:e})=>!e||e<=100||"rate_invalid"]}get countries(){return this.__countries}set countries(e){this.__countries=e,e?this.__countriesService.send({type:"FETCH"}):this.__countriesService.send({type:"SET_DATA",data:null})}get regions(){return this.__regions}set regions(e){this.__regions=e,e?this.__regionsService.send({type:"FETCH"}):this.__regionsService.send({type:"SET_DATA",data:null})}connectedCallback(){super.connectedCallback(),this.__countriesService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__countriesService.onChange((()=>this.requestUpdate())),this.__countriesService.start(),this.__regionsService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__regionsService.onChange((()=>this.requestUpdate())),this.__regionsService.start()}render(){var e,t;return s(p||(p=O` <div class="relative space-y-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.__isNameHidden?null:this.__renderName(),this.__isTypeHidden?null:this.__renderType(),this.__isCountryHidden?null:this.__renderCountry(),this.__isRegionHidden?null:this.__renderRegion(),this.__isCityHidden?null:this.__renderCity(),this.__isProviderHidden?null:this.__renderProvider(),this.__isRateHidden?null:this.__renderRate(),this.__isApplyToShippingHidden?null:this.__renderApplyToShipping(),this.__isUseOriginRatesHidden?null:this.__renderUseOriginRates(),this.__isExemptAllCustomerTaxIdsHidden?null:this.__renderExemptAllCustomerTaxIds(),this.__isTimestampsHidden?null:this.__renderTimestamps(),this.__isCreateHidden?null:this.__renderCreate(),this.__isDeleteHidden?null:this.__renderDelete(),l({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":this.in("busy")?"busy":"empty",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}updated(e){super.updated(e),this.form.country!==this.__previousCountry&&(this.__previousCountry=this.form.country,this.__regionsService.send({type:"FETCH"})),this.renderRoot.querySelectorAll("vaadin-combo-box").forEach((e=>e.validate()))}disconnectedCallback(){super.disconnectedCallback(),this.__countriesService.stop(),this.__regionsService.stop()}get __isNameHidden(){return this.hiddenSelector.matches("name",!0)}get __isTypeHidden(){return this.hiddenSelector.matches("type",!0)}get __isCountryHidden(){return!!this.hiddenSelector.matches("country",!0)||("union"===this.form.type?!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type))}get __isRegionHidden(){return!!this.hiddenSelector.matches("region",!0)||"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return!!this.hiddenSelector.matches("city",!0)||"local"!==this.form.type}get __isProviderHidden(){return!!this.hiddenSelector.matches("provider",!0)||(!this.form.type||"global"===this.form.type||"local"===this.form.type)}get __isRateHidden(){return!!this.hiddenSelector.matches("rate",!0)||(!this.form.type||!0===this.form.is_live)}get __isApplyToShippingHidden(){return!!this.hiddenSelector.matches("apply-to-shipping",!0)||(void 0===this.form.type||!!this.form.is_live&&C.includes(this.form.country))}get __isUseOriginRatesHidden(){return!!this.hiddenSelector.matches("use-origin-rates",!0)||("union"!==this.form.type||!this.form.is_live||!!this.form.service_provider)}get __isExemptAllCustomerTaxIdsHidden(){if(this.hiddenSelector.matches("exempt-all-customer-tax-ids",!0))return!0;const e=this.form.service_provider;return void 0===e||"onesource"===e||"avalara"===e}get __isTimestampsHidden(){return!!this.hiddenSelector.matches("timestamps",!0)||!this.data}get __isCreateHidden(){return!!this.hiddenSelector.matches("create",!0)||!!this.data}get __isDeleteHidden(){return!!this.hiddenSelector.matches("delete",!0)||!this.data}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__getValidator(e){return()=>!this.errors.some((t=>t.startsWith(e)))}__renderName(){return s(u||(u=O` <div> ${0} <vaadin-text-field data-testid="name" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("name:before"),this.t("name"),_(this.form.name),this.__getValidator("name"),this.__getErrorMessage("name"),!this.in("idle")||this.disabledSelector.matches("name",!0),this.readonlySelector.matches("name",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({name:t})}),this.renderTemplateOrSlot("name:after"))}__renderType(){return this.form.type||this.edit({type:"global"}),s(y||(y=O` <div> ${0} <x-dropdown data-testid="type" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("type:before"),this.t("type"),_(this.form.type),["global","union","country","region","local"],(e=>this.t(`tax_${e}`)),!this.in("idle")||this.disabledSelector.matches("type",!0),this.readonlySelector.matches("type",!0),(e=>{this.edit({type:e.detail,country:"",region:"",city:"",service_provider:"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})}),this.renderTemplateOrSlot("type:after"))}__renderCountry(){var e;const t=this.__countriesService.state.matches("busy"),i=this.in("busy"),r=t||i,a=this.in("fail"),n=this.__countriesService.state.context.data,o=Object.values(null!==(e=null==n?void 0:n.values)&&void 0!==e?e:{});return s(g||(g=O` <div> ${0} <vaadin-combo-box item-value-path="cc2" item-label-path="default" item-id-path="cc2" data-testid="country" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("country:before"),this.t("country"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.country),this.__getValidator("country"),this.__getErrorMessage("country"),o,0===o.length,a||r||this.disabledSelector.matches("country",!0),this.readonlySelector.matches("country",!0),(e=>{this.edit({country:e.currentTarget.value,region:"",city:"",is_live:!1,service_provider:""}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__regionsService.send({type:"FETCH"})}),this.renderTemplateOrSlot("country:after"))}__renderRegion(){var e;const t=this.__regionsService.state.matches("busy"),i=this.in("busy"),r=t||i,a=this.in("fail"),n=this.__regionsService.state.context.data,o=Object.values(null!==(e=null==n?void 0:n.values)&&void 0!==e?e:{});return s(v||(v=O` <div> ${0} <vaadin-combo-box item-value-path="code" item-label-path="default" item-id-path="code" data-testid="region" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("region:before"),this.t("region"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.region),this.__getValidator("region"),this.__getErrorMessage("region"),o,0===o.length,a||r||this.disabledSelector.matches("region",!0),this.readonlySelector.matches("region",!0),(e=>{const t=e.currentTarget.value;this.edit({region:t,city:""})}),this.renderTemplateOrSlot("region:after"))}__renderCity(){return s(f||(f=O` <div> ${0} <vaadin-text-field data-testid="city" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("city:before"),this.t("city"),_(this.form.city),this.__getValidator("city"),this.__getErrorMessage("city"),!this.in("idle")||this.disabledSelector.matches("city",!0),this.readonlySelector.matches("city",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({city:t})}),this.renderTemplateOrSlot("city:after"))}__renderProvider(){const e=[{label:this.t("tax_rate_provider_none"),value:"none"},{label:"Avalara AvaTax 15",value:"avalara"},{label:"Thomson Reuters ONESOURCE",value:"onesource"}];return("union"===this.form.type||C.includes(this.form.country))&&e.push({label:this.t("tax_rate_provider_default"),value:"default"}),w.includes(this.form.country)&&e.push({label:"TaxJar",value:"taxjar"}),s($||($=O` <div> ${0} <x-dropdown data-testid="provider" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("provider:before"),this.t("tax_rate_provider"),this.form.service_provider||(this.form.is_live?"default":"none"),e.map((e=>e.value)),(t=>{var i;return null===(i=e.find((e=>e.value===t)))||void 0===i?void 0:i.label}),!this.in("idle")||this.disabledSelector.matches("provider",!0),this.readonlySelector.matches("provider",!0),(e=>{const t=e.detail,i=["none","default"].includes(t)?"":t;this.edit({service_provider:i,is_live:"none"!==t}),this.__isExemptAllCustomerTaxIdsHidden&&this.edit({exempt_all_customer_tax_ids:!1}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__isUseOriginRatesHidden&&this.edit({use_origin_rates:!1})}),this.renderTemplateOrSlot("provider:after"))}__renderRate(){return s(b||(b=O` <div> ${0} <vaadin-number-field data-testid="rate" class="w-full" label="${0}" value="${0}" min="0" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @change="${0}"> </vaadin-number-field> ${0} </div> `),this.renderTemplateOrSlot("rate:before"),this.t("tax_rate"),_(this.form.rate),this.__getValidator("rate"),this.__getErrorMessage("rate"),!this.in("idle")||this.disabledSelector.matches("rate",!0),this.readonlySelector.matches("rate",!0),this.__submitOnEnter,(e=>{const t=parseFloat(e.currentTarget.value);isNaN(t)||this.edit({rate:t})}),this.renderTemplateOrSlot("rate:after"))}__renderApplyToShipping(){return s(x||(x=O` <div> ${0} <x-checkbox data-testid="apply-to-shipping" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_apply_to_shipping" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_apply_to_shipping_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("apply-to-shipping:before"),!this.in("idle")||this.disabledSelector.matches("apply-to-shipping",!0),this.readonlySelector.matches("apply-to-shipping",!0),!!this.form.apply_to_shipping,(e=>this.edit({apply_to_shipping:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("apply-to-shipping:after"))}__renderUseOriginRates(){return s(S||(S=O` <div> ${0} <x-checkbox data-testid="use-origin-rates" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_use_origin_rates" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_use_origin_rates_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("use-origin-rates:before"),!this.in("idle")||this.disabledSelector.matches("use-origin-rates",!0),this.readonlySelector.matches("use-origin-rates",!0),!!this.form.use_origin_rates,(e=>this.edit({use_origin_rates:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("use-origin-rates:after"))}__renderExemptAllCustomerTaxIds(){const e="exempt-all-customer-tax-ids";return s(T||(T=O` <div> ${0} <x-checkbox data-testid="${0}" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_exempt_all_customer_tax_ids" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_exempt_all_customer_tax_ids_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),e,!this.in("idle")||this.disabledSelector.matches(e,!0),this.readonlySelector.matches(e,!0),!!this.form.exempt_all_customer_tax_ids,(e=>{this.edit({exempt_all_customer_tax_ids:e.detail})}),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot(`${e}:after`))}__renderTimestamps(){return s(E||(E=O` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot("timestamps:after"))}__renderCreate(){const e=this.in({idle:{template:{clean:"invalid"}}}),t=this.in({idle:{template:{dirty:"invalid"}}}),i=this.in({idle:{snapshot:{clean:"invalid"}}}),r=this.in({idle:{snapshot:{dirty:"invalid"}}}),a=e||t||(i||r),n=this.in("idle");return s(j||(j=O` <div> ${0} <vaadin-button data-testid="create" class="w-full" theme="primary success" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="create" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("create:before"),!n||a||this.disabledSelector.matches("create",!0),this.submit,this.ns,this.lang,this.renderTemplateOrSlot("create:after"))}__renderDelete(){return s(k||(k=O` <div> <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} <vaadin-button data-testid="delete" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="delete" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.lang,this.ns,(e=>!e.detail.cancelled&&this.delete()),this.renderTemplateOrSlot("delete:before"),!this.in("idle")||this.disabledSelector.matches("delete",!0),(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}),this.ns,this.lang,this.renderTemplateOrSlot("delete:after"))}__submitOnEnter(e){"Enter"===e.key&&this.submit()}}customElements.define("foxy-tax-form",A);export{A as TaxForm};
1
+ import"./shared-0dc1d012.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-86768244.js";import"./shared-aeec3cab.js";import"./shared-b95ef318.js";import"./shared-0543c6e0.js";import"./shared-cb6f2388.js";import{D as e}from"./shared-6b53ef85.js";import{f as t,_ as i}from"./shared-98755831.js";import{C as r}from"./shared-ad396f3c.js";import"./shared-ee13d1a6.js";import"./shared-9e60ef60.js";import{h as s}from"./shared-7f33a83a.js";import{T as a,S as n,a as o}from"./shared-16b542bc.js";import"./shared-f3f5e87e.js";import"./shared-068480a3.js";import"./shared-c40d85dc.js";import"./shared-4c9f96ec.js";import"./shared-e28f16db.js";import"./shared-6f465111.js";import{P as d}from"./shared-7bf46d6d.js";import{c as l}from"./shared-4e709717.js";import{C as h}from"./shared-de790de9.js";import{N as c}from"./shared-eb900735.js";import{i as _}from"./shared-d3bf9ac0.js";import{i as m}from"./shared-a89cb472.js";import"./shared-ca58ef47.js";import"./shared-7a290f36.js";import"./shared-a8cf402a.js";import"./shared-64657919.js";import"./shared-4db2c7b1.js";import"./shared-cd096e97.js";import"./shared-e5c19ea3.js";import"./shared-11c2efc8.js";import"./shared-509a2f52.js";import"./shared-d6276c83.js";let p,u,y,g,v,f,$,b,x,S,T,E,j,k,O=e=>e;const C=["US","CA","AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IM","IT","LT","LU","LV","MC","MT","NL","PL","PT","RO","SE","SI","SK"],w=[...C,"AU"],H=h(a(n(o(c,"tax-form"))));class A extends H{constructor(){var e;super(...arguments),e=this,this.templates={},this.__previousCountry=void 0,this.__countries="",this.__regions="",this.__countriesService=m(t.withConfig({services:{sendGet:async function(){const t=await new A.API(e).fetch(e.countries);if(!t.ok)throw new Error(await t.text());return await t.json()}}})),this.__regionsService=m(t.withConfig({services:{sendGet:async function(){var t;const i=new URL(e.regions);i.searchParams.set("country_code",null!==(t=e.form.country)&&void 0!==t?t:"US");const r=await new A.API(e).fetch(i.toString());if(!r.ok)throw new Error(await r.text());return await r.json()}}}))}static get scopedElements(){return{"vaadin-number-field":customElements.get("vaadin-number-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"vaadin-button":customElements.get("vaadin-button"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-property-table":d,"x-checkbox":r,"x-dropdown":e}}static get properties(){return i(i({},super.properties),{},{countries:{type:String,noAccessor:!0},regions:{type:String,noAccessor:!0}})}static get v8n(){return[({name:e})=>!!e||"name_required",({name:e})=>!e||e.length<=30||"name_too_long",({country:e,type:t})=>"country"!==t||!!e||"country_required",({country:e,type:t})=>"region"!==t||!!e||"country_required",({country:e,use_origin_rates:t})=>!t||!!e||"country_required",({country:e})=>!e||!!e.match(/[A-Z]{2}/)||"country_invalid",({region:e,type:t})=>"region"!=t||!!e||"region_required",({region:e})=>!e||e.length<=20||"region_too_long",({city:e})=>!e||e.length<=50||"city_too_long",({city:e,type:t})=>"local"!=t||!!e||"city_required",({rate:e})=>!e||e<=100||"rate_invalid"]}get countries(){return this.__countries}set countries(e){this.__countries=e,e?this.__countriesService.send({type:"FETCH"}):this.__countriesService.send({type:"SET_DATA",data:null})}get regions(){return this.__regions}set regions(e){this.__regions=e,e?this.__regionsService.send({type:"FETCH"}):this.__regionsService.send({type:"SET_DATA",data:null})}connectedCallback(){super.connectedCallback(),this.__countriesService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__countriesService.onChange((()=>this.requestUpdate())),this.__countriesService.start(),this.__regionsService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__regionsService.onChange((()=>this.requestUpdate())),this.__regionsService.start()}render(){var e,t;return s(p||(p=O` <div class="relative space-y-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.__isNameHidden?null:this.__renderName(),this.__isTypeHidden?null:this.__renderType(),this.__isCountryHidden?null:this.__renderCountry(),this.__isRegionHidden?null:this.__renderRegion(),this.__isCityHidden?null:this.__renderCity(),this.__isProviderHidden?null:this.__renderProvider(),this.__isRateHidden?null:this.__renderRate(),this.__isApplyToShippingHidden?null:this.__renderApplyToShipping(),this.__isUseOriginRatesHidden?null:this.__renderUseOriginRates(),this.__isExemptAllCustomerTaxIdsHidden?null:this.__renderExemptAllCustomerTaxIds(),this.__isTimestampsHidden?null:this.__renderTimestamps(),this.__isCreateHidden?null:this.__renderCreate(),this.__isDeleteHidden?null:this.__renderDelete(),l({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":this.in("busy")?"busy":"empty",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}updated(e){super.updated(e),this.form.country!==this.__previousCountry&&(this.__previousCountry=this.form.country,this.__regionsService.send({type:"FETCH"})),this.renderRoot.querySelectorAll("vaadin-combo-box").forEach((e=>e.validate()))}disconnectedCallback(){super.disconnectedCallback(),this.__countriesService.stop(),this.__regionsService.stop()}get __isNameHidden(){return this.hiddenSelector.matches("name",!0)}get __isTypeHidden(){return this.hiddenSelector.matches("type",!0)}get __isCountryHidden(){return!!this.hiddenSelector.matches("country",!0)||("union"===this.form.type?!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type))}get __isRegionHidden(){return!!this.hiddenSelector.matches("region",!0)||"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return!!this.hiddenSelector.matches("city",!0)||"local"!==this.form.type}get __isProviderHidden(){return!!this.hiddenSelector.matches("provider",!0)||(!this.form.type||"global"===this.form.type||"local"===this.form.type)}get __isRateHidden(){return!!this.hiddenSelector.matches("rate",!0)||(!this.form.type||!0===this.form.is_live)}get __isApplyToShippingHidden(){return!!this.hiddenSelector.matches("apply-to-shipping",!0)||(void 0===this.form.type||!!this.form.is_live&&C.includes(this.form.country))}get __isUseOriginRatesHidden(){return!!this.hiddenSelector.matches("use-origin-rates",!0)||("union"!==this.form.type||!this.form.is_live||!!this.form.service_provider)}get __isExemptAllCustomerTaxIdsHidden(){if(this.hiddenSelector.matches("exempt-all-customer-tax-ids",!0))return!0;const e=this.form.service_provider;return void 0===e||"onesource"===e||"avalara"===e}get __isTimestampsHidden(){return!!this.hiddenSelector.matches("timestamps",!0)||!this.data}get __isCreateHidden(){return!!this.hiddenSelector.matches("create",!0)||!!this.data}get __isDeleteHidden(){return!!this.hiddenSelector.matches("delete",!0)||!this.data}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__getValidator(e){return()=>!this.errors.some((t=>t.startsWith(e)))}__renderName(){return s(u||(u=O` <div> ${0} <vaadin-text-field data-testid="name" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("name:before"),this.t("name"),_(this.form.name),this.__getValidator("name"),this.__getErrorMessage("name"),!this.in("idle")||this.disabledSelector.matches("name",!0),this.readonlySelector.matches("name",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({name:t})}),this.renderTemplateOrSlot("name:after"))}__renderType(){return this.form.type||this.edit({type:"global"}),s(y||(y=O` <div> ${0} <x-dropdown data-testid="type" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("type:before"),this.t("type"),_(this.form.type),["global","union","country","region","local"],(e=>this.t(`tax_${e}`)),!this.in("idle")||this.disabledSelector.matches("type",!0),this.readonlySelector.matches("type",!0),(e=>{this.edit({type:e.detail,country:"",region:"",city:"",service_provider:"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})}),this.renderTemplateOrSlot("type:after"))}__renderCountry(){var e;const t=this.__countriesService.state.matches("busy"),i=this.in("busy"),r=t||i,a=this.in("fail"),n=this.__countriesService.state.context.data,o=Object.values(null!==(e=null==n?void 0:n.values)&&void 0!==e?e:{});return s(g||(g=O` <div> ${0} <vaadin-combo-box item-value-path="cc2" item-label-path="default" item-id-path="cc2" data-testid="country" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("country:before"),this.t("country"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.country),this.__getValidator("country"),this.__getErrorMessage("country"),o,0===o.length,a||r||this.disabledSelector.matches("country",!0),this.readonlySelector.matches("country",!0),(e=>{this.edit({country:e.currentTarget.value,region:"",city:"",is_live:!1,service_provider:""}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__regionsService.send({type:"FETCH"})}),this.renderTemplateOrSlot("country:after"))}__renderRegion(){var e;const t=this.__regionsService.state.matches("busy"),i=this.in("busy"),r=t||i,a=this.in("fail"),n=this.__regionsService.state.context.data,o=Object.values(null!==(e=null==n?void 0:n.values)&&void 0!==e?e:{});return s(v||(v=O` <div> ${0} <vaadin-combo-box item-value-path="code" item-label-path="default" item-id-path="code" data-testid="region" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("region:before"),this.t("region"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.region),this.__getValidator("region"),this.__getErrorMessage("region"),o,0===o.length,a||r||this.disabledSelector.matches("region",!0),this.readonlySelector.matches("region",!0),(e=>{const t=e.currentTarget.value;this.edit({region:t,city:""})}),this.renderTemplateOrSlot("region:after"))}__renderCity(){return s(f||(f=O` <div> ${0} <vaadin-text-field data-testid="city" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("city:before"),this.t("city"),_(this.form.city),this.__getValidator("city"),this.__getErrorMessage("city"),!this.in("idle")||this.disabledSelector.matches("city",!0),this.readonlySelector.matches("city",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({city:t})}),this.renderTemplateOrSlot("city:after"))}__renderProvider(){const e=[{label:this.t("tax_rate_provider_none"),value:"none"},{label:"Avalara AvaTax 15",value:"avalara"},{label:"Thomson Reuters ONESOURCE",value:"onesource"}];return("union"===this.form.type||C.includes(this.form.country))&&e.push({label:this.t("tax_rate_provider_default"),value:"default"}),w.includes(this.form.country)&&e.push({label:"TaxJar",value:"taxjar"}),s($||($=O` <div> ${0} <x-dropdown data-testid="provider" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("provider:before"),this.t("tax_rate_provider"),this.form.service_provider||(this.form.is_live?"default":"none"),e.map((e=>e.value)),(t=>{var i;return null===(i=e.find((e=>e.value===t)))||void 0===i?void 0:i.label}),!this.in("idle")||this.disabledSelector.matches("provider",!0),this.readonlySelector.matches("provider",!0),(e=>{const t=e.detail,i=["none","default"].includes(t)?"":t;this.edit({service_provider:i,is_live:"none"!==t}),this.__isExemptAllCustomerTaxIdsHidden&&this.edit({exempt_all_customer_tax_ids:!1}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__isUseOriginRatesHidden&&this.edit({use_origin_rates:!1})}),this.renderTemplateOrSlot("provider:after"))}__renderRate(){return s(b||(b=O` <div> ${0} <vaadin-number-field data-testid="rate" class="w-full" label="${0}" value="${0}" min="0" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @change="${0}"> </vaadin-number-field> ${0} </div> `),this.renderTemplateOrSlot("rate:before"),this.t("tax_rate"),_(this.form.rate),this.__getValidator("rate"),this.__getErrorMessage("rate"),!this.in("idle")||this.disabledSelector.matches("rate",!0),this.readonlySelector.matches("rate",!0),this.__submitOnEnter,(e=>{const t=parseFloat(e.currentTarget.value);isNaN(t)||this.edit({rate:t})}),this.renderTemplateOrSlot("rate:after"))}__renderApplyToShipping(){return s(x||(x=O` <div> ${0} <x-checkbox data-testid="apply-to-shipping" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_apply_to_shipping" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_apply_to_shipping_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("apply-to-shipping:before"),!this.in("idle")||this.disabledSelector.matches("apply-to-shipping",!0),this.readonlySelector.matches("apply-to-shipping",!0),!!this.form.apply_to_shipping,(e=>this.edit({apply_to_shipping:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("apply-to-shipping:after"))}__renderUseOriginRates(){return s(S||(S=O` <div> ${0} <x-checkbox data-testid="use-origin-rates" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_use_origin_rates" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_use_origin_rates_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("use-origin-rates:before"),!this.in("idle")||this.disabledSelector.matches("use-origin-rates",!0),this.readonlySelector.matches("use-origin-rates",!0),!!this.form.use_origin_rates,(e=>this.edit({use_origin_rates:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("use-origin-rates:after"))}__renderExemptAllCustomerTaxIds(){const e="exempt-all-customer-tax-ids";return s(T||(T=O` <div> ${0} <x-checkbox data-testid="${0}" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_exempt_all_customer_tax_ids" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_exempt_all_customer_tax_ids_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),e,!this.in("idle")||this.disabledSelector.matches(e,!0),this.readonlySelector.matches(e,!0),!!this.form.exempt_all_customer_tax_ids,(e=>{this.edit({exempt_all_customer_tax_ids:e.detail})}),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot(`${e}:after`))}__renderTimestamps(){return s(E||(E=O` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot("timestamps:after"))}__renderCreate(){const e=this.in({idle:{template:{clean:"invalid"}}}),t=this.in({idle:{template:{dirty:"invalid"}}}),i=this.in({idle:{snapshot:{clean:"invalid"}}}),r=this.in({idle:{snapshot:{dirty:"invalid"}}}),a=e||t||(i||r),n=this.in("idle");return s(j||(j=O` <div> ${0} <vaadin-button data-testid="create" class="w-full" theme="primary success" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="create" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("create:before"),!n||a||this.disabledSelector.matches("create",!0),this.submit,this.ns,this.lang,this.renderTemplateOrSlot("create:after"))}__renderDelete(){return s(k||(k=O` <div> <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} <vaadin-button data-testid="delete" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="delete" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.lang,this.ns,(e=>!e.detail.cancelled&&this.delete()),this.renderTemplateOrSlot("delete:before"),!this.in("idle")||this.disabledSelector.matches("delete",!0),(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}),this.ns,this.lang,this.renderTemplateOrSlot("delete:after"))}__submitOnEnter(e){"Enter"===e.key&&this.submit()}}customElements.define("foxy-tax-form",A);export{A as TaxForm};