@wix/form-elements 1.91.0 → 1.93.0

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 (110) hide show
  1. package/dist/component/{appointment-rac-CDZ0Gdin.js → appointment-rac-bw0pvoxP.js} +4 -4
  2. package/dist/component/{bookings-address-rac-pmQyMw-1.js → bookings-address-rac-DECq7eWR.js} +1 -1
  3. package/dist/component/{bookings-email-rac-CzDEYpBV.js → bookings-email-rac-DTLjh6Zw.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-qg7T37FZ.js → bookings-first-name-rac-DObRe-Gq.js} +1 -1
  5. package/dist/component/{bookings-header-rac-Dmwmt_Cp.js → bookings-header-rac-DjpmYRJG.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-CXTtlnYI.js → bookings-last-name-rac-Ds3o0ABM.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-DTs9s6hU.js → bookings-login-bar-rac-DPUL2jWj.js} +1 -1
  8. package/dist/component/{bookings-phone-rac-C7AEVZA-.js → bookings-phone-rac-DIIHPxEP.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-CBGVMqOn.js → bookings-rich-text-rac-BrcQO9xx.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-BggtF6cZ.js → checkbox-field-rac-CD1MP1LT.js} +4 -4
  11. package/dist/component/{checkbox-group-field-headless-O2ZsF7An.js → checkbox-group-field-headless-C0V6zq0u.js} +3 -3
  12. package/dist/component/{checkbox-group-field-rac-OC3W4Taz.js → checkbox-group-field-rac-B-MYpz53.js} +3 -3
  13. package/dist/component/{checkbox-group-rac-CZuEXWgx.js → checkbox-group-rac-BejQjiO2.js} +1 -1
  14. package/dist/component/{checkbox-rac-W-a8Z0ht.js → checkbox-rac-B0YgCj29.js} +1 -1
  15. package/dist/component/{contacts-address-rac-DtG9NDgw.js → contacts-address-rac-B1QNl3Lb.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-DS7uNjKO.js → contacts-birthdate-rac-Cp-gh3P-.js} +1 -1
  17. package/dist/component/{contacts-company-rac-CQX5azvs.js → contacts-company-rac-CSCU7JGm.js} +1 -1
  18. package/dist/component/{contacts-email-rac-QgYLfH6e.js → contacts-email-rac-B1Oov6-3.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-BrlHl2Uj.js → contacts-first-name-rac-rsHIOcjr.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-ieDtRIbl.js → contacts-last-name-rac-Csgq53Wm.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-LTjC8k7e.js → contacts-phone-rac-r9SwjDZ4.js} +1 -1
  22. package/dist/component/{contacts-position-rac-CxbAUzIc.js → contacts-position-rac-D7VcCM7v.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac-H0dNjYV8.js → contacts-subscribe-rac-8Nu9ncZW.js} +1 -1
  24. package/dist/component/{contacts-tax-id-rac-uhTEMEwl.js → contacts-tax-id-rac-CL_JSl_W.js} +1 -1
  25. package/dist/component/{date-availability-eRjWauCz.js → date-availability-DLOKY9C4.js} +1 -1
  26. package/dist/component/date-input-field-rac-D23Al-Mr.js +292 -0
  27. package/dist/component/{date-input-rac-BBllT9pM.js → date-input-rac-B6zgkw-L.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-CSXVWmGL.js → date-picker-field-rac-BqdzPPzK.js} +4 -4
  29. package/dist/component/{date-picker-rac-CwEFOSSe.js → date-picker-rac-C7g6aceb.js} +1 -1
  30. package/dist/component/date-time-input-field-rac-BENzf6gc.js +428 -0
  31. package/dist/component/{date-time-input-rac-DsGlyO8x.js → date-time-input-rac-CVpK3mgw.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-Bs9tVVXo.js → dext-checkbox-group-rac-CbEFDD3H.js} +2 -2
  33. package/dist/component/{dext-checkbox-rac-FEjZejl7.js → dext-checkbox-rac-BdtZvn6I.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-Mdbuq1mu.js → dext-date-picker-rac-BAhFvUEx.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-B4dRBObU.js → dext-date-time-input-rac-iXMKMwQY.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-QVngfb7K.js → dext-dropdown-rac-D-NPziZS.js} +1 -1
  37. package/dist/component/{dext-email-rac-cURI3VuR.js → dext-email-rac-DYSwyB80.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-CovkZ8Ey.js → dext-number-input-rac-DXx8hgFg.js} +1 -1
  39. package/dist/component/{dext-phone-rac-C8GjKZnH.js → dext-phone-rac-BtuLROzm.js} +1 -1
  40. package/dist/component/{dext-radio-group-rac-BlrJmIH3.js → dext-radio-group-rac-MdKNiJ2i.js} +2 -2
  41. package/dist/component/{dext-rating-input-rac-jIJisfdp.js → dext-rating-input-rac-d998xond.js} +1 -1
  42. package/dist/component/{dext-tags-rac-BXjCLX6y.js → dext-tags-rac-DnSpOM9T.js} +2 -2
  43. package/dist/component/{dext-text-area-rac-CD_x4meg.js → dext-text-area-rac-KqjeDDWe.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-Du51Nj6q.js → dext-text-input-rac-CtCnClfX.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-_W6CW5hp.js → dext-url-input-rac-DSJQcLLr.js} +1 -1
  46. package/dist/component/{donation-rac-9njvq8HE.js → donation-rac-B_KGkBgo.js} +5 -5
  47. package/dist/component/dropdown-field-headless-BUilB8wZ.js +89 -0
  48. package/dist/component/{dropdown-field-rac-BYRb3VEI.js → dropdown-field-rac-COupYC1a.js} +2 -2
  49. package/dist/component/{dropdown-rac-BBrPWiSg.js → dropdown-rac-Dj0UZrE0.js} +1 -1
  50. package/dist/component/{ecom-address-rac-CDJ46mdt.js → ecom-address-rac-C0xnn86e.js} +1 -1
  51. package/dist/component/{ecom-subscription-checkbox-rac-DItvmxzX.js → ecom-subscription-checkbox-rac-D-ekxwUE.js} +2 -2
  52. package/dist/component/{email-input-field-rac-aeRdkPOh.js → email-input-field-rac-DVj1qz_R.js} +3 -3
  53. package/dist/component/{events-repeater-rac-CzVycetd.js → events-repeater-rac-U0aq9Z4Q.js} +3 -3
  54. package/dist/component/{events-rsvp-rac-BhLYlH1V.js → events-rsvp-rac-C7J58_5q.js} +2 -2
  55. package/dist/component/{field-error-headless-T9JfqiMS.js → field-error-headless-2nYJ2792.js} +1 -1
  56. package/dist/component/{field-label-headless-bDWQszAb.js → field-label-headless-D97ACnmc.js} +1 -1
  57. package/dist/component/{file-upload-rac-Dk-delp2.js → file-upload-rac-BR7QpuPW.js} +3 -3
  58. package/dist/component/{fixed-payment-rac-Bj8RMj1w.js → fixed-payment-rac-COl18wW1.js} +3 -3
  59. package/dist/component/{form-C7cB75mm.js → form-DKKTSAj1.js} +69 -69
  60. package/dist/component/form.css +1 -1
  61. package/dist/component/form.js +1 -1
  62. package/dist/component/{header-field-rac-RzI5owwx.js → header-field-rac-B6DyMG3U.js} +2 -2
  63. package/dist/component/{header-rac-DQgyaMDA.js → header-rac-x4H2qMky.js} +1 -1
  64. package/dist/component/{image-choice-rac-DOs1eI0_.js → image-choice-rac-BVgmKTKk.js} +4 -4
  65. package/dist/component/{index-DlPclNOa.js → index-C47UMGhd.js} +4 -4
  66. package/dist/component/{index-C90Q2rfK.js → index-DnpqBcg5.js} +2 -2
  67. package/dist/component/{isObjectLike-DLz0WtlZ.js → isObjectLike-BrrFBP4f.js} +1 -1
  68. package/dist/component/multiline-address-field-rac-B6ka-2Wy.js +1630 -0
  69. package/dist/component/{multiline-address-rac-7sUhPDFM.js → multiline-address-rac-Bh58qUEe.js} +1 -1
  70. package/dist/component/{number-input-field-rac-DMHSUbYN.js → number-input-field-rac-pAmxvk3A.js} +4 -4
  71. package/dist/component/{number-input-rac-CF5271QD.js → number-input-rac-mKA2njIU.js} +1 -1
  72. package/dist/component/{password-rac-CxQRcSEb.js → password-rac-BbD7PQXO.js} +4 -4
  73. package/dist/component/{payment-input-rac-C20HS9QN.js → payment-input-rac-UdkwC1ek.js} +4 -4
  74. package/dist/component/phone-input-field-rac-BVLVVDTq.js +487 -0
  75. package/dist/component/{phone-rac-pGbG3Cu0.js → phone-rac-LixcB9WV.js} +1 -1
  76. package/dist/component/{product-list-rac-CxyJaRQ6.js → product-list-rac-B_dL1Ov-.js} +4 -4
  77. package/dist/component/{quiz-radio-group-rac-CCddKnuf.js → quiz-radio-group-rac-Bj5XfqNf.js} +1 -1
  78. package/dist/component/{radio-button-module-classes-uyJAJMZn.js → radio-button-module-classes-y_PtsZPP.js} +3 -3
  79. package/dist/component/{radio-group-field-rac-VwR2FlNg.js → radio-group-field-rac-C8OElNAQ.js} +3 -3
  80. package/dist/component/{radio-group-rac-D8pzwSCS.js → radio-group-rac-BqJFboHE.js} +1 -1
  81. package/dist/component/{rating-input-field-rac-C4ohOgX0.js → rating-input-field-rac-C9_ITvEh.js} +4 -4
  82. package/dist/component/{rating-input-rac-NpCggSGK.js → rating-input-rac-CvTpEUoU.js} +1 -1
  83. package/dist/component/{rich-content-rac.module-B9HHqJL4.js → rich-content-rac.module-D4pEN-TY.js} +1 -1
  84. package/dist/component/{rich-text-field-rac-C3qKHitl.js → rich-text-field-rac-B8cqCmaf.js} +2 -2
  85. package/dist/component/{rich-text-rac-BJkS9CGE.js → rich-text-rac-C1o-tfXG.js} +1 -1
  86. package/dist/component/{service-dropdown-rac-BTdBTfeg.js → service-dropdown-rac-BOXqB2aq.js} +4 -4
  87. package/dist/component/{services-multi-choice-rac-Nl74A8jo.js → services-multi-choice-rac-Dk4rz-fw.js} +5 -5
  88. package/dist/component/{signature-rac-BAVXA-5Q.js → signature-rac-h9GWVdez.js} +3 -3
  89. package/dist/component/{submit-button-rac-DlmeZjy_.js → submit-button-rac-qNaTyCxd.js} +1 -1
  90. package/dist/component/{tags-field-rac-BFBSf5mt.js → tags-field-rac-NMRn0YnW.js} +5 -5
  91. package/dist/component/{tags-rac-S_GJQpwJ.js → tags-rac-DGx4KxEn.js} +1 -1
  92. package/dist/component/{text-area-field-rac-D1qLXh4K.js → text-area-field-rac-C7u0D4l3.js} +4 -4
  93. package/dist/component/{text-area-rac-DejqDYR0.js → text-area-rac-Yo-RIyLm.js} +1 -1
  94. package/dist/component/{text-input-field-rac-DwPTWyiR.js → text-input-field-rac-CvU-1clq.js} +2 -2
  95. package/dist/component/{text-input-headless-BUljrxVJ.js → text-input-headless-DLRwVmwf.js} +3 -3
  96. package/dist/component/{text-input-rac-CCWkAOVG.js → text-input-rac-CWh5xjZA.js} +1 -1
  97. package/dist/component/{time-input-rac-b09-o8Uw.js → time-input-rac-BZlso9qK.js} +4 -4
  98. package/dist/component/{url-input-field-rac-DYGAFldc.js → url-input-field-rac-Bax0TB4Q.js} +4 -4
  99. package/dist/component/{url-input-rac-CsAWnWt5.js → url-input-rac-Bw2nfybR.js} +1 -1
  100. package/dist/component/use-dropdown-option-class-name-vKSagp3b.js +57 -0
  101. package/dist/component/{use-element-state-class-name-DZhlOoWK.js → use-element-state-class-name-C0zLrsDR.js} +1 -1
  102. package/dist/component/{use-service-options-base-JNSCsxxz.js → use-service-options-base-Bkj6BSQL.js} +1 -1
  103. package/dist/component/{use-text-input-class-name-CgCYHOMw.js → use-text-input-class-name-Biu89Ma7.js} +2 -2
  104. package/package.json +2 -2
  105. package/dist/component/date-input-field-rac-BKb019gB.js +0 -288
  106. package/dist/component/date-time-input-field-rac-C4yIIebr.js +0 -424
  107. package/dist/component/dropdown-field-headless-BBc5oicg.js +0 -101
  108. package/dist/component/multiline-address-field-rac-DHYRZxtJ.js +0 -1618
  109. package/dist/component/phone-input-field-rac-BDF_4RJE.js +0 -474
  110. package/dist/component/use-dropdown-option-class-name-CruN_y12.js +0 -28
@@ -0,0 +1,1630 @@
1
+ import { RicosViewer as X } from "@wix/ricos/viewer";
2
+ import L from "classnames";
3
+ import r, { useMemo as w, createContext as Ue, useContext as Ce, useState as be, useRef as x, useCallback as R, useEffect as Pe } from "react";
4
+ import { UNSAFE_PortalProvider as Pt } from "react-aria";
5
+ import { af as yt, c as Ct, aa as Tt, ac as It, H as Mt, J as qt, v as wt, G as V, F as K, au as Te, a3 as lt, ak as P, ah as T, am as ae, ag as Lt, T as xt, C as ve, a1 as Bt, a5 as kt, ar as $t, al as Wt, aq as Ut, a8 as Vt, Z as Kt, a7 as Yt, an as Ht, j as jt } from "./form-DKKTSAj1.js";
6
+ import { f as E, a as F } from "./find-child-C60k4CxG.js";
7
+ import { F as Jt, V as Gt } from "./headless-styles-CmcyA_pi.js";
8
+ import { a as Xt, u as zt } from "./use-dropdown-option-class-name-vKSagp3b.js";
9
+ import { TextField as fe, Input as le, ComboBoxStateContext as Ve, ComboBox as De, Popover as Se, ListBox as Re, ListBoxItem as Ae, Group as Nt, Button as gt } from "react-aria-components";
10
+ import { D as ie, E as ce } from "./field-error-headless-2nYJ2792.js";
11
+ import { L as de } from "./field-label-headless-D97ACnmc.js";
12
+ import { e as Qt, c as Zt, a as en, r as Ot } from "./isObjectLike-BrrFBP4f.js";
13
+ import { u as tn } from "./use-invoke-callback-UH73A_J3.js";
14
+ import { C as it } from "./chevron-down-icon-CcpVm6B-.js";
15
+ import { E as z } from "./error-icon-hZxQ6DEy.js";
16
+ import { H as Me } from "./custom-focus-class-_483Pkwp.js";
17
+ import { s as C } from "./field-rac.module-BUvPquav.js";
18
+ import { B as Q, R as Z, m as ct, D as ge, q as ee, i as te } from "./form-element-classes-CLZXu-91.js";
19
+ import { u as nn } from "./use-text-input-class-name-Biu89Ma7.js";
20
+ const rn = (e, t, o) => {
21
+ var l, a, i, s;
22
+ const n = (l = e.steps) == null ? void 0 : l.map((d) => {
23
+ var m, u, y, I, b, p;
24
+ return {
25
+ ...d,
26
+ layout: {
27
+ ...d.layout,
28
+ large: {
29
+ ...(m = d.layout) == null ? void 0 : m.large,
30
+ items: ((I = (y = (u = d.layout) == null ? void 0 : u.large) == null ? void 0 : y.items) == null ? void 0 : I.map((f) => ({
31
+ ...f,
32
+ row: o.row <= f.row ? (f.row || 0) + 1 : f.row
33
+ }))) || ((p = (b = d.layout) == null ? void 0 : b.large) == null ? void 0 : p.items)
34
+ }
35
+ }
36
+ };
37
+ });
38
+ return (s = (i = (a = n == null ? void 0 : n[0].layout) == null ? void 0 : a.large) == null ? void 0 : i.items) == null || s.unshift(o), {
39
+ ...e,
40
+ fields: [
41
+ t,
42
+ ...e.fields || []
43
+ ],
44
+ steps: n || e.steps
45
+ };
46
+ };
47
+ var ye = /* @__PURE__ */ (function(e) {
48
+ return e.COUNTRY = "country", e.SUBDIVISION = "subdivision", e.CITY = "city", e.ADDRESS_LINE = "addressLine", e.ADDRESS_LINE_2 = "addressLine2", e.POSTAL_CODE = "postalCode", e.STREET_NAME = "streetName", e.STREET_NUMBER = "streetNumber", e.APARTMENT = "apartment", e;
49
+ })({});
50
+ function on(e, t, o = !1) {
51
+ const { country: n, subdivision: l, city: a, addressLine: i, streetAddress: s, addressLine2: d, postalCode: m } = e, u = {};
52
+ return t ? (n && (u.country = n), l && (u.subdivision = l), a && (u.city = a), i ? u.addressLine = i : s != null && s.formattedAddressLine && (u.addressLine = s == null ? void 0 : s.formattedAddressLine), d && (u.addressLine = d), m && (u.postalCode = m), s != null && s.apt && (u.apartment = s == null ? void 0 : s.apt), s != null && s.name ? u.streetName = s == null ? void 0 : s.name : o && (s != null && s.formattedAddressLine) && (u.streetName = s == null ? void 0 : s.formattedAddressLine), s != null && s.number && (u.streetNumber = s.number)) : (n && (u.country = n), l && (u.subdivision = l), a && (u.city = a), i ? u.address_line = i : s != null && s.formattedAddressLine && (u.address_line = s == null ? void 0 : s.formattedAddressLine), d && (u.address_line = d), m && (u.postal_code = m), s != null && s.apt && (u.apartment = s == null ? void 0 : s.apt), s != null && s.name ? u.street_name = s == null ? void 0 : s.name : o && (s != null && s.formattedAddressLine) && (u.street_name = s == null ? void 0 : s.formattedAddressLine), s != null && s.number && (u.street_number = s.number)), u;
53
+ }
54
+ const vt = /* @__PURE__ */ Ue({
55
+ onAddressSelect: () => {
56
+ }
57
+ }), sn = ({ children: e, onAddressSelect: t, autocompleteEnabled: o }) => {
58
+ const n = w(() => ({
59
+ onAddressSelect: t,
60
+ autocompleteEnabled: o
61
+ }), [
62
+ t,
63
+ o
64
+ ]);
65
+ return /* @__PURE__ */ r.createElement(vt.Provider, {
66
+ value: n
67
+ }, e);
68
+ };
69
+ function Ie() {
70
+ return Ce(vt);
71
+ }
72
+ const Ft = /* @__PURE__ */ Ue(void 0), an = ({ children: e, countryCode: t }) => {
73
+ const o = w(() => ({
74
+ countryCode: t
75
+ }), [
76
+ t
77
+ ]);
78
+ return /* @__PURE__ */ r.createElement(Ft.Provider, {
79
+ value: o
80
+ }, e);
81
+ };
82
+ function Le() {
83
+ const e = Ce(Ft);
84
+ return e == null ? void 0 : e.countryCode;
85
+ }
86
+ function qe(e) {
87
+ return e != null;
88
+ }
89
+ function ln(e, t, o) {
90
+ return !t || !o ? e : {
91
+ ...e,
92
+ fields: (e.fields ?? []).map((n) => {
93
+ const { show: l, ...a } = t[n.target] || {}, { required: i } = o[n.target] || {};
94
+ return {
95
+ ...n,
96
+ view: {
97
+ ...n.view,
98
+ ...a
99
+ },
100
+ ...qe(l) && {
101
+ hidden: !l
102
+ },
103
+ ...qe(i) && qe(n.validation) && {
104
+ validation: {
105
+ ...n.validation,
106
+ required: i
107
+ }
108
+ }
109
+ };
110
+ })
111
+ };
112
+ }
113
+ const cn = (e, t) => e.map((o) => ({
114
+ ...o,
115
+ id: ("target" in o ? t[o.target] : void 0) ?? o.id
116
+ })), ht = 12, dn = (e) => {
117
+ const t = e.filter((n) => !n.properties.hidden), o = e.filter((n) => n.properties.hidden);
118
+ return {
119
+ visibleFields: t,
120
+ hiddenFields: o
121
+ };
122
+ }, un = (e) => {
123
+ const t = {};
124
+ return e.forEach((o) => {
125
+ const n = o.layout.row;
126
+ t[n] || (t[n] = []), t[n].push(o);
127
+ }), t;
128
+ }, mn = (e) => {
129
+ const t = {};
130
+ return Object.keys(e).forEach((o) => {
131
+ const n = parseInt(o, 10), l = e[n];
132
+ l.reduce((i, s) => i + s.layout.width, 0) !== ht && (t[n] = l);
133
+ }), t;
134
+ }, pn = (e, t) => e.map((o) => {
135
+ const n = o.layout.row;
136
+ if (t[n] && !o.properties.hidden) {
137
+ const l = t[n], a = l.length, i = ht / a, s = l.findIndex((m) => m.id === o.id), d = i * s;
138
+ return {
139
+ ...o,
140
+ layout: {
141
+ ...o.layout,
142
+ width: i,
143
+ column: d
144
+ }
145
+ };
146
+ }
147
+ return o;
148
+ }), En = (e, t, o) => {
149
+ const n = Math.max(...t.map((l) => l.layout.row), -1);
150
+ return e.map((l) => {
151
+ if (l.properties.hidden) {
152
+ const a = o.findIndex((i) => i.id === l.id);
153
+ return {
154
+ ...l,
155
+ layout: {
156
+ ...l.layout,
157
+ row: n + 1 + a
158
+ }
159
+ };
160
+ }
161
+ return l;
162
+ });
163
+ }, bn = (e) => {
164
+ const { visibleFields: t, hiddenFields: o } = dn(e.fields), n = un(t), l = mn(n), a = pn(e.fields, l), i = En(a, t, o);
165
+ return {
166
+ ...e,
167
+ fields: i
168
+ };
169
+ }, fn = () => ({
170
+ country: V(),
171
+ subdivision: V(),
172
+ city: V(),
173
+ address_line: V(),
174
+ address_line_2: V(),
175
+ postal_code: V(),
176
+ street_name: V(),
177
+ street_number: V(),
178
+ apartment: V()
179
+ }), yn = ({ id: e, target: t, fieldType: o, form: n, country: l, fieldSettings: a, validation: i, required: s }) => {
180
+ const [d] = be(fn), { isExperimentEnabled: m } = yt(), u = m(Ct.USE_FIELDS_V2), { getCountryAddressForm: y } = Tt(), { isMobile: I, breakpoint: b } = It(), p = y(l), f = o === K.MULTILINE_ADDRESS || o === K.BOOKINGS_ADDRESS, N = w(() => {
181
+ var O;
182
+ return Mt(s, (O = i == null ? void 0 : i.predefined) == null ? void 0 : O.multilineAddressOptions);
183
+ }, [
184
+ i,
185
+ s
186
+ ]), S = w(() => qt(), []);
187
+ return {
188
+ form: w(() => {
189
+ var _, g;
190
+ if (!f || !p)
191
+ return n && {
192
+ ...n,
193
+ fields: cn(n.fields, d)
194
+ };
195
+ const O = wt({
196
+ useFieldsV2: u,
197
+ path: t,
198
+ parentId: e,
199
+ includeHiddenFields: !0,
200
+ isMobile: I,
201
+ breakpoint: b,
202
+ form: ln(rn(p, N, S), a, (g = (_ = i == null ? void 0 : i.predefined) == null ? void 0 : _.multilineAddressOptions) == null ? void 0 : g.fields)
203
+ });
204
+ if (!O.fields.some((v) => v.properties.hidden))
205
+ return O;
206
+ const M = bn(O);
207
+ return {
208
+ ...M,
209
+ fields: M.fields.filter((v) => !v.properties.hidden)
210
+ };
211
+ }, [
212
+ p,
213
+ n,
214
+ d,
215
+ a,
216
+ i,
217
+ t,
218
+ N,
219
+ S,
220
+ f,
221
+ u,
222
+ e,
223
+ I,
224
+ b
225
+ ]),
226
+ isMultilineAddressField: f
227
+ };
228
+ }, Dt = /* @__PURE__ */ Ue(void 0), Cn = ({ children: e, fields: t }) => {
229
+ const o = w(() => ({
230
+ fields: t
231
+ }), [
232
+ t
233
+ ]);
234
+ return /* @__PURE__ */ r.createElement(Dt.Provider, {
235
+ value: o
236
+ }, e);
237
+ };
238
+ function ue(e) {
239
+ const t = Ce(Dt);
240
+ if (!t)
241
+ throw new Error("useAddressFields must be used within AddressFieldsProvider");
242
+ return t.fields[e];
243
+ }
244
+ function pe(e) {
245
+ const { t } = Te(), o = Le(), n = o && lt.getCountryByShortKey(o), a = (n ? n.addressPartDisplayNames : lt.getDefaultAddressDisplayNames())[e];
246
+ return a ? t(a) : "";
247
+ }
248
+ const ne = ({ children: e }) => {
249
+ const { id: t, value: o, onChange: n, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: y } = T(), I = pe("addressLine2"), b = E(e, ne.Label), p = E(e, ne.Input), f = E(e, ne.Description), N = E(e, ne.Error);
250
+ return /* @__PURE__ */ r.createElement(u, {
251
+ fieldId: t,
252
+ renderLabel: () => F(b, {
253
+ label: I
254
+ }),
255
+ renderInput: () => /* @__PURE__ */ r.createElement(fe, {
256
+ "aria-labelledby": y,
257
+ value: o ?? "",
258
+ onChange: n,
259
+ isDisabled: l,
260
+ isReadOnly: a,
261
+ isRequired: i,
262
+ isInvalid: s,
263
+ onBlur: d,
264
+ onFocus: m
265
+ }, p),
266
+ renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, N, f)
267
+ });
268
+ }, In = ({ className: e }) => {
269
+ const { id: t, placeholder: o } = P(), { inputId: n, ariaDescribedBy: l } = T(), a = x(null);
270
+ return ae(() => {
271
+ var i;
272
+ (i = a.current) == null || i.focus();
273
+ }, t), /* @__PURE__ */ r.createElement(le, {
274
+ ref: a,
275
+ id: n,
276
+ "aria-describedby": l,
277
+ className: e,
278
+ placeholder: o
279
+ });
280
+ };
281
+ ne.Label = de;
282
+ ne.Input = In;
283
+ ne.Description = ie;
284
+ ne.Error = ce;
285
+ const Ke = ({ enabled: e }) => {
286
+ const { actions: t } = Lt(), [o, n] = be(V()), l = R(() => n(V()), []);
287
+ return w(() => {
288
+ const { predict: a, getPlace: i, searchByPostalCode: s } = t ?? {};
289
+ if (!(!e || !a || !i || !s))
290
+ return {
291
+ predict: (d) => a({
292
+ ...d,
293
+ sessionToken: o
294
+ }),
295
+ getPlace: (d) => i({
296
+ ...d,
297
+ sessionToken: o,
298
+ refreshSessionToken: l
299
+ }),
300
+ searchByPostalCode: (d) => s({
301
+ ...d,
302
+ sessionToken: o
303
+ })
304
+ };
305
+ }, [
306
+ e,
307
+ t,
308
+ o,
309
+ l
310
+ ]);
311
+ };
312
+ var we, dt;
313
+ function Ln() {
314
+ if (dt) return we;
315
+ dt = 1;
316
+ var e = Qt(), t = function() {
317
+ return e.Date.now();
318
+ };
319
+ return we = t, we;
320
+ }
321
+ var xe, ut;
322
+ function Nn() {
323
+ if (ut) return xe;
324
+ ut = 1;
325
+ var e = /\s/;
326
+ function t(o) {
327
+ for (var n = o.length; n-- && e.test(o.charAt(n)); )
328
+ ;
329
+ return n;
330
+ }
331
+ return xe = t, xe;
332
+ }
333
+ var Be, mt;
334
+ function gn() {
335
+ if (mt) return Be;
336
+ mt = 1;
337
+ var e = Nn(), t = /^\s+/;
338
+ function o(n) {
339
+ return n && n.slice(0, e(n) + 1).replace(t, "");
340
+ }
341
+ return Be = o, Be;
342
+ }
343
+ var ke, pt;
344
+ function On() {
345
+ if (pt) return ke;
346
+ pt = 1;
347
+ var e = Zt(), t = en(), o = "[object Symbol]";
348
+ function n(l) {
349
+ return typeof l == "symbol" || t(l) && e(l) == o;
350
+ }
351
+ return ke = n, ke;
352
+ }
353
+ var $e, Et;
354
+ function vn() {
355
+ if (Et) return $e;
356
+ Et = 1;
357
+ var e = gn(), t = Ot(), o = On(), n = NaN, l = /^[-+]0x[0-9a-f]+$/i, a = /^0b[01]+$/i, i = /^0o[0-7]+$/i, s = parseInt;
358
+ function d(m) {
359
+ if (typeof m == "number")
360
+ return m;
361
+ if (o(m))
362
+ return n;
363
+ if (t(m)) {
364
+ var u = typeof m.valueOf == "function" ? m.valueOf() : m;
365
+ m = t(u) ? u + "" : u;
366
+ }
367
+ if (typeof m != "string")
368
+ return m === 0 ? m : +m;
369
+ m = e(m);
370
+ var y = a.test(m);
371
+ return y || i.test(m) ? s(m.slice(2), y ? 2 : 8) : l.test(m) ? n : +m;
372
+ }
373
+ return $e = d, $e;
374
+ }
375
+ var We, bt;
376
+ function Fn() {
377
+ if (bt) return We;
378
+ bt = 1;
379
+ var e = Ot(), t = Ln(), o = vn(), n = "Expected a function", l = Math.max, a = Math.min;
380
+ function i(s, d, m) {
381
+ var u, y, I, b, p, f, N = 0, S = !1, h = !1, O = !0;
382
+ if (typeof s != "function")
383
+ throw new TypeError(n);
384
+ d = o(d) || 0, e(m) && (S = !!m.leading, h = "maxWait" in m, I = h ? l(o(m.maxWait) || 0, d) : I, O = "trailing" in m ? !!m.trailing : O);
385
+ function A(D) {
386
+ var J = u, Ee = y;
387
+ return u = y = void 0, N = D, b = s.apply(Ee, J), b;
388
+ }
389
+ function M(D) {
390
+ return N = D, p = setTimeout(v, d), S ? A(D) : b;
391
+ }
392
+ function _(D) {
393
+ var J = D - f, Ee = D - N, Ne = d - J;
394
+ return h ? a(Ne, I - Ee) : Ne;
395
+ }
396
+ function g(D) {
397
+ var J = D - f, Ee = D - N;
398
+ return f === void 0 || J >= d || J < 0 || h && Ee >= I;
399
+ }
400
+ function v() {
401
+ var D = t();
402
+ if (g(D))
403
+ return me(D);
404
+ p = setTimeout(v, _(D));
405
+ }
406
+ function me(D) {
407
+ return p = void 0, O && u ? A(D) : (u = y = void 0, b);
408
+ }
409
+ function j() {
410
+ p !== void 0 && clearTimeout(p), N = 0, u = f = y = p = void 0;
411
+ }
412
+ function B() {
413
+ return p === void 0 ? b : me(t());
414
+ }
415
+ function q() {
416
+ var D = t(), J = g(D);
417
+ if (u = arguments, y = this, f = D, J) {
418
+ if (p === void 0)
419
+ return M(f);
420
+ if (h)
421
+ return clearTimeout(p), p = setTimeout(v, d), A(f);
422
+ }
423
+ return p === void 0 && (p = setTimeout(v, d)), b;
424
+ }
425
+ return q.cancel = j, q.flush = B, q;
426
+ }
427
+ return We = i, We;
428
+ }
429
+ var hn = Fn();
430
+ const Dn = /* @__PURE__ */ xt(hn), Sn = (e, t, o = 200) => {
431
+ const n = x(e), l = R(Dn((...a) => {
432
+ n.current(...a);
433
+ }, o), [
434
+ o
435
+ ]);
436
+ return Pe(() => {
437
+ n.current = e;
438
+ }, [
439
+ e,
440
+ t
441
+ ]), l;
442
+ }, Rn = () => {
443
+ const e = x(!0);
444
+ return Pe(() => () => {
445
+ e.current = !1;
446
+ }, []), () => e.current;
447
+ }, ft = {
448
+ loading: !1,
449
+ predictions: []
450
+ }, St = ({ atlas: e, onError: t }) => {
451
+ const [{ loading: n, predictions: l }, a] = be(ft), i = x(0), s = Rn(), d = R(() => {
452
+ i.current++, a(ft);
453
+ }, []), m = Sn(async ({ input: u, countryCodes: y }) => {
454
+ if (!e || !s())
455
+ return;
456
+ if (!u) {
457
+ d();
458
+ return;
459
+ }
460
+ const I = ++i.current;
461
+ a((p) => ({
462
+ ...p,
463
+ loading: !0
464
+ }));
465
+ let b;
466
+ try {
467
+ b = await e.predict({
468
+ input: u,
469
+ countryCodes: y
470
+ });
471
+ } catch (p) {
472
+ t ? t(p) : console.error(p);
473
+ } finally {
474
+ const p = I === i.current;
475
+ s() && p && a((f) => ({
476
+ loading: !1,
477
+ // set new predictions if fetched properly, else keep current predictions
478
+ predictions: b || f.predictions
479
+ }));
480
+ }
481
+ }, [
482
+ e,
483
+ t
484
+ ], 200);
485
+ return {
486
+ predictions: l,
487
+ loading: n,
488
+ updatePredictions: m,
489
+ clearPredictions: d
490
+ };
491
+ }, Ye = ({ optionCount: e }) => {
492
+ const t = Ce(Ve), o = x(t);
493
+ o.current = t;
494
+ const n = x(e);
495
+ return Pe(() => {
496
+ const l = e > 0 && n.current === 0;
497
+ n.current = e;
498
+ const a = o.current;
499
+ l && (a != null && a.isFocused) && !a.isOpen && a.open(null, "manual");
500
+ }, [
501
+ e
502
+ ]), null;
503
+ }, k = ({ children: e }) => {
504
+ const { id: t, value: o, onChange: n, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u, autocomplete: y } = P(), { labelId: I } = T(), { autocompleteEnabled: b } = Ie(), p = y || b, f = pe("addressLine1"), N = E(e, k.Label), S = E(e, k.Input), h = E(e, k.Options), O = E(e, k.Description), A = E(e, k.Error);
505
+ return p ? /* @__PURE__ */ r.createElement(u, {
506
+ fieldId: t,
507
+ renderLabel: () => F(N, {
508
+ label: f
509
+ }),
510
+ renderInput: () => /* @__PURE__ */ r.createElement(An, {
511
+ value: o,
512
+ onChange: n,
513
+ disabled: l,
514
+ readOnly: a,
515
+ required: i,
516
+ hasError: s,
517
+ onBlur: d,
518
+ onFocus: m
519
+ }, S, h),
520
+ renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, A, O)
521
+ }) : /* @__PURE__ */ r.createElement(u, {
522
+ fieldId: t,
523
+ renderLabel: () => F(N, {
524
+ label: f
525
+ }),
526
+ renderInput: () => /* @__PURE__ */ r.createElement(fe, {
527
+ "aria-labelledby": I,
528
+ value: o ?? "",
529
+ onChange: n,
530
+ isDisabled: l,
531
+ isReadOnly: a,
532
+ isRequired: i,
533
+ isInvalid: s,
534
+ onBlur: d,
535
+ onFocus: m
536
+ }, S),
537
+ renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, A, O)
538
+ });
539
+ }, An = ({ children: e, value: t, onChange: o, disabled: n, readOnly: l, required: a, hasError: i, onBlur: s, onFocus: d }) => {
540
+ const { labelId: m } = T(), { onAddressSelect: u } = Ie(), y = Le(), I = Ke({
541
+ enabled: !0
542
+ }), { predictions: b, updatePredictions: p, clearPredictions: f } = St({
543
+ atlas: I
544
+ }), N = w(() => b.map((g) => ({
545
+ id: g.searchId || "",
546
+ label: g.description || ""
547
+ })), [
548
+ b
549
+ ]), S = R((g) => {
550
+ p({
551
+ input: g,
552
+ countryCodes: y ? [
553
+ y
554
+ ] : void 0
555
+ }), o(g);
556
+ }, [
557
+ o,
558
+ p,
559
+ y
560
+ ]), h = R(async (g) => {
561
+ if (!g)
562
+ return;
563
+ f();
564
+ const v = await (I == null ? void 0 : I.getPlace({
565
+ searchId: String(g)
566
+ }));
567
+ v && u && u(v);
568
+ }, [
569
+ u,
570
+ f,
571
+ I
572
+ ]), O = R(() => {
573
+ f(), s == null || s();
574
+ }, [
575
+ s,
576
+ f
577
+ ]), A = R(() => {
578
+ d == null || d();
579
+ }, [
580
+ d
581
+ ]), M = E(e, k.Input), _ = E(e, k.Options);
582
+ return /* @__PURE__ */ r.createElement(De, {
583
+ "aria-labelledby": m,
584
+ inputValue: t ?? "",
585
+ onInputChange: S,
586
+ value: null,
587
+ onChange: h,
588
+ isDisabled: n,
589
+ isReadOnly: l,
590
+ isRequired: a,
591
+ isInvalid: i,
592
+ onBlur: O,
593
+ onFocus: A,
594
+ allowsCustomValue: !0,
595
+ menuTrigger: "input",
596
+ items: N
597
+ }, F(M, {
598
+ onFocus: A
599
+ }), F(_, {
600
+ options: N
601
+ }), /* @__PURE__ */ r.createElement(Ye, {
602
+ optionCount: N.length
603
+ }));
604
+ }, _n = ({ className: e, ...t }) => {
605
+ const { id: o, placeholder: n } = P(), { inputId: l, ariaDescribedBy: a } = T(), { onFocus: i } = t, s = x(null);
606
+ return ae(() => {
607
+ var d;
608
+ (d = s.current) == null || d.focus();
609
+ }, o), /* @__PURE__ */ r.createElement(le, {
610
+ ref: s,
611
+ id: l,
612
+ "aria-describedby": a,
613
+ className: e,
614
+ placeholder: n,
615
+ onFocus: i
616
+ });
617
+ }, He = ({ children: e, className: t }) => {
618
+ const o = E(e, He.Option);
619
+ return /* @__PURE__ */ r.createElement(Se, {
620
+ className: t,
621
+ containerPadding: 0,
622
+ offset: 0
623
+ }, /* @__PURE__ */ r.createElement(Re, {
624
+ renderEmptyState: () => null
625
+ }, (n) => F(o, {
626
+ id: n.id,
627
+ label: n.label
628
+ })));
629
+ }, Pn = ({ className: e, ...t }) => {
630
+ const { id: o, label: n } = t;
631
+ return /* @__PURE__ */ r.createElement(Ae, {
632
+ className: e,
633
+ id: o,
634
+ textValue: n
635
+ }, n);
636
+ };
637
+ He.Option = Pn;
638
+ k.Label = de;
639
+ k.Input = _n;
640
+ k.Options = He;
641
+ k.Description = ie;
642
+ k.Error = ce;
643
+ const re = ({ children: e }) => {
644
+ const { id: t, value: o, onChange: n, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: y } = T(), { t: I } = Te(), b = I("field.mla-apartment.label"), p = E(e, re.Label), f = E(e, re.Input), N = E(e, re.Description), S = E(e, re.Error);
645
+ return /* @__PURE__ */ r.createElement(u, {
646
+ fieldId: t,
647
+ renderLabel: () => F(p, {
648
+ label: b
649
+ }),
650
+ renderInput: () => /* @__PURE__ */ r.createElement(fe, {
651
+ "aria-labelledby": y,
652
+ value: o ?? "",
653
+ onChange: n,
654
+ isDisabled: l,
655
+ isReadOnly: a,
656
+ isRequired: i,
657
+ isInvalid: s,
658
+ onBlur: d,
659
+ onFocus: m
660
+ }, f),
661
+ renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, S, N)
662
+ });
663
+ }, Tn = ({ className: e }) => {
664
+ const { id: t, placeholder: o } = P(), { inputId: n, ariaDescribedBy: l } = T(), a = x(null);
665
+ return ae(() => {
666
+ var i;
667
+ (i = a.current) == null || i.focus();
668
+ }, t), /* @__PURE__ */ r.createElement(le, {
669
+ ref: a,
670
+ id: n,
671
+ "aria-describedby": l,
672
+ className: e,
673
+ placeholder: o
674
+ });
675
+ };
676
+ re.Label = de;
677
+ re.Input = Tn;
678
+ re.Description = ie;
679
+ re.Error = ce;
680
+ const oe = ({ children: e }) => {
681
+ const { id: t, value: o, onChange: n, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: y } = T(), I = pe("city"), b = E(e, oe.Label), p = E(e, oe.Input), f = E(e, oe.Description), N = E(e, oe.Error);
682
+ return /* @__PURE__ */ r.createElement(u, {
683
+ fieldId: t,
684
+ renderLabel: () => F(b, {
685
+ label: I
686
+ }),
687
+ renderInput: () => /* @__PURE__ */ r.createElement(fe, {
688
+ "aria-labelledby": y,
689
+ value: o ?? "",
690
+ onChange: n,
691
+ isDisabled: l,
692
+ isReadOnly: a,
693
+ isRequired: i,
694
+ isInvalid: s,
695
+ onBlur: d,
696
+ onFocus: m
697
+ }, p),
698
+ renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, N, f)
699
+ });
700
+ }, Mn = ({ className: e }) => {
701
+ const { id: t, placeholder: o } = P(), { inputId: n, ariaDescribedBy: l } = T(), a = x(null);
702
+ return ae(() => {
703
+ var i;
704
+ (i = a.current) == null || i.focus();
705
+ }, t), /* @__PURE__ */ r.createElement(le, {
706
+ ref: a,
707
+ id: n,
708
+ "aria-describedby": l,
709
+ className: e,
710
+ placeholder: o
711
+ });
712
+ };
713
+ oe.Label = de;
714
+ oe.Input = Mn;
715
+ oe.Description = ie;
716
+ oe.Error = ce;
717
+ const qn = ({ isOpen: e }) => {
718
+ const t = Ce(Ve), o = x(!1);
719
+ return Pe(() => {
720
+ e && t && !t.isOpen && t.open(null, "manual"), e && (t == null ? void 0 : t.selectionManager.focusedKey) != null && t.selectionManager.setFocusedKey(null), !e && o.current && (t == null || t.close()), o.current = e;
721
+ }, [
722
+ e,
723
+ t
724
+ ]), null;
725
+ }, Rt = ({ readOnly: e, disabled: t } = {}) => {
726
+ const o = Ce(Ve);
727
+ return R(() => {
728
+ !o || o.isOpen || e || t || o.open(null, "manual");
729
+ }, [
730
+ o,
731
+ e,
732
+ t
733
+ ]);
734
+ }, wn = (e, t) => e.find((o) => o.label.toLocaleLowerCase() === t.toLocaleLowerCase().trim()), At = ({ options: e, value: t, commit: o, clear: n, onBlur: l }) => {
735
+ const [a, i] = be(null), s = tn(l), d = w(() => {
736
+ var b;
737
+ return t ? ((b = e.find((p) => p.value === t)) == null ? void 0 : b.label) ?? "" : "";
738
+ }, [
739
+ t,
740
+ e
741
+ ]), m = R((b) => {
742
+ typeof b != "string" || b === "" || b === t || (i(null), o(b));
743
+ }, [
744
+ o,
745
+ t
746
+ ]), u = R((b) => {
747
+ if (i(b), b === "")
748
+ return;
749
+ const p = wn(e, b);
750
+ p && p.value !== t && o(p.value);
751
+ }, [
752
+ o,
753
+ e,
754
+ t
755
+ ]), y = R((b) => {
756
+ b.key !== "Enter" && b.key !== "Escape" || (i(null), b.key === "Enter" && a === "" && t && n());
757
+ }, [
758
+ a,
759
+ t,
760
+ n
761
+ ]), I = R(() => {
762
+ a === "" && t && n(), i(null), s();
763
+ }, [
764
+ a,
765
+ t,
766
+ n,
767
+ s
768
+ ]);
769
+ return {
770
+ value: t ?? null,
771
+ inputValue: a ?? d,
772
+ onChange: m,
773
+ onInputChange: u,
774
+ onBlur: I,
775
+ onInputKeyDown: y
776
+ };
777
+ }, Y = ({ children: e, ...t }) => {
778
+ const { isForcedOpen: o = !1 } = t, { id: n, value: l, onChange: a, disabled: i, readOnly: s, required: d, hasError: m, onBlur: u, onFocus: y, FieldLayout: I, options: b } = P(), { labelId: p } = T(), { t: f } = Te(), { language: N } = It(), S = w(() => (b || []).reduce((q, D) => (D.value && ve.hasOwnProperty(D.value) && q.push({
779
+ value: D.value,
780
+ label: f(`locale-dataset.countries.${ve[D.value].toUpperCase()}`)
781
+ }), q), []).sort((q, D) => q.label.localeCompare(D.label, N)), [
782
+ b,
783
+ f,
784
+ N
785
+ ]), h = R((q) => a(q), [
786
+ a
787
+ ]), O = R(() => h(""), [
788
+ h
789
+ ]), { onInputKeyDown: A, ...M } = At({
790
+ options: S,
791
+ value: l,
792
+ commit: h,
793
+ clear: O,
794
+ onBlur: u
795
+ }), _ = pe("country"), g = E(e, Y.Label), v = E(e, Y.Control), me = E(e, Y.Options), j = E(e, Y.Description), B = E(e, Y.Error);
796
+ return /* @__PURE__ */ r.createElement(I, {
797
+ fieldId: n,
798
+ renderLabel: () => F(g, {
799
+ label: _
800
+ }),
801
+ renderInput: () => /* @__PURE__ */ r.createElement(De, {
802
+ "aria-labelledby": p,
803
+ ...M,
804
+ isDisabled: i,
805
+ isReadOnly: s,
806
+ isRequired: d,
807
+ isInvalid: m,
808
+ onFocus: y,
809
+ menuTrigger: "input"
810
+ }, F(v, {
811
+ onKeyDown: A
812
+ }), F(me, {
813
+ options: S
814
+ }), /* @__PURE__ */ r.createElement(qn, {
815
+ isOpen: o
816
+ })),
817
+ renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, B, j)
818
+ });
819
+ }, Fe = ({ children: e, className: t, ...o }) => {
820
+ const { disabled: n, hasError: l } = P(), { onKeyDown: a } = o, i = E(e, Fe.Input), s = E(e, Fe.Trigger);
821
+ return /* @__PURE__ */ r.createElement(Nt, {
822
+ className: t,
823
+ isDisabled: n,
824
+ isInvalid: l
825
+ }, F(i, {
826
+ onKeyDown: a
827
+ }), s);
828
+ }, xn = ({ className: e, ...t }) => {
829
+ const { id: o, placeholder: n, readOnly: l, disabled: a } = P(), { inputId: i, ariaDescribedBy: s } = T(), { onKeyDown: d } = t, m = x(null), u = Rt({
830
+ readOnly: l,
831
+ disabled: a
832
+ });
833
+ return ae(() => {
834
+ var y;
835
+ (y = m.current) == null || y.focus();
836
+ }, o), /* @__PURE__ */ r.createElement(le, {
837
+ ref: m,
838
+ id: i,
839
+ "aria-describedby": s,
840
+ className: e,
841
+ placeholder: n,
842
+ onClick: u,
843
+ onKeyDown: d
844
+ });
845
+ }, Bn = ({ children: e, className: t }) => /* @__PURE__ */ r.createElement(gt, {
846
+ className: t
847
+ }, e);
848
+ Fe.Input = xn;
849
+ Fe.Trigger = Bn;
850
+ const je = ({ children: e, className: t, ...o }) => {
851
+ const { options: n } = o, l = E(e, je.Option);
852
+ return /* @__PURE__ */ r.createElement(Se, {
853
+ className: t,
854
+ containerPadding: 0,
855
+ offset: 0
856
+ }, /* @__PURE__ */ r.createElement(Re, null, n.map((a) => F(l, {
857
+ key: a.value,
858
+ value: a.value,
859
+ label: a.label
860
+ }))));
861
+ }, kn = ({ className: e, ...t }) => {
862
+ const { value: o, label: n } = t;
863
+ return /* @__PURE__ */ r.createElement(Ae, {
864
+ className: e,
865
+ id: o,
866
+ textValue: n
867
+ }, n);
868
+ };
869
+ je.Option = kn;
870
+ Y.Label = de;
871
+ Y.Control = Fe;
872
+ Y.Options = je;
873
+ Y.Description = ie;
874
+ Y.Error = ce;
875
+ const $n = /(\d{7})|(\d{3}-\d{4})/;
876
+ function Wn(e) {
877
+ var t;
878
+ return (t = e.match($n)) == null ? void 0 : t[0];
879
+ }
880
+ function Un({ isAutocompleteEnabled: e }) {
881
+ const t = x({
882
+ hasAddress: !1
883
+ }), o = Ke({
884
+ enabled: e
885
+ });
886
+ return {
887
+ searchByPostalCode: R(async (l) => {
888
+ const a = Wn(l);
889
+ if (a) {
890
+ if (t.current.postalCode === a && t.current.hasAddress)
891
+ return t.current.address;
892
+ t.current = {
893
+ postalCode: a,
894
+ address: void 0,
895
+ hasAddress: !1
896
+ };
897
+ try {
898
+ const i = await (o == null ? void 0 : o.searchByPostalCode({
899
+ countryCode: "JP",
900
+ postalCode: a
901
+ }));
902
+ return t.current.hasAddress = !0, t.current.address = void 0, i != null && i.formattedAddress ? (t.current.address = i, i) : void 0;
903
+ } catch (i) {
904
+ console.error(i);
905
+ }
906
+ }
907
+ }, [
908
+ o
909
+ ])
910
+ };
911
+ }
912
+ const $ = ({ children: e }) => {
913
+ const { id: t, value: o, onChange: n, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u, autocomplete: y } = P(), { labelId: I } = T(), b = Le(), { autocompleteEnabled: p } = Ie(), f = !!(b && ve[b] === ve.JP), N = (y || p) && f, S = pe("zipCode"), h = E(e, $.Label), O = E(e, $.Control), A = E(e, $.Options), M = E(e, $.Description), _ = E(e, $.Error);
914
+ return N ? /* @__PURE__ */ r.createElement(u, {
915
+ fieldId: t,
916
+ renderLabel: () => F(h, {
917
+ label: S
918
+ }),
919
+ renderInput: () => /* @__PURE__ */ r.createElement(Vn, {
920
+ value: o,
921
+ onChange: n,
922
+ disabled: l,
923
+ readOnly: a,
924
+ required: i,
925
+ hasError: s,
926
+ onBlur: d,
927
+ onFocus: m
928
+ }, O, A),
929
+ renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, _, M)
930
+ }) : /* @__PURE__ */ r.createElement(u, {
931
+ fieldId: t,
932
+ renderLabel: () => F(h, {
933
+ label: S
934
+ }),
935
+ renderInput: () => /* @__PURE__ */ r.createElement(fe, {
936
+ "aria-labelledby": I,
937
+ value: o ?? "",
938
+ onChange: n,
939
+ isDisabled: l,
940
+ isReadOnly: a,
941
+ isRequired: i,
942
+ isInvalid: s,
943
+ onBlur: d,
944
+ onFocus: m
945
+ }, O),
946
+ renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, _, M)
947
+ });
948
+ }, Vn = ({ children: e, value: t, onChange: o, disabled: n, readOnly: l, required: a, hasError: i, onBlur: s, onFocus: d }) => {
949
+ const { labelId: m } = T(), { onAddressSelect: u } = Ie(), [y, I] = be(!1), { searchByPostalCode: b } = Un({
950
+ isAutocompleteEnabled: y
951
+ }), [p, f] = be(), N = w(() => p ? [
952
+ {
953
+ id: V(),
954
+ label: p.formattedAddress || ""
955
+ }
956
+ ] : [], [
957
+ p
958
+ ]), S = R(async (g) => {
959
+ o(g);
960
+ const v = await b(g ?? "");
961
+ f(v);
962
+ }, [
963
+ o,
964
+ b
965
+ ]), h = R(async (g) => {
966
+ g && (f(void 0), p && u && u(p));
967
+ }, [
968
+ u,
969
+ p
970
+ ]), O = R(() => {
971
+ f(void 0), s == null || s();
972
+ }, [
973
+ s
974
+ ]), A = R(() => {
975
+ I(!0), d == null || d();
976
+ }, [
977
+ d
978
+ ]), M = E(e, $.Control), _ = E(e, $.Options);
979
+ return /* @__PURE__ */ r.createElement(De, {
980
+ "aria-labelledby": m,
981
+ inputValue: t ?? "",
982
+ onInputChange: S,
983
+ value: null,
984
+ onChange: h,
985
+ isDisabled: n,
986
+ isReadOnly: l,
987
+ isRequired: a,
988
+ isInvalid: i,
989
+ onBlur: O,
990
+ onFocus: A,
991
+ allowsCustomValue: !0,
992
+ menuTrigger: "input",
993
+ items: N
994
+ }, F(M, {
995
+ onFocus: A
996
+ }), F(_, {
997
+ options: N
998
+ }), /* @__PURE__ */ r.createElement(Ye, {
999
+ optionCount: N.length
1000
+ }));
1001
+ }, Je = ({ children: e, className: t, ...o }) => {
1002
+ const { disabled: n, hasError: l } = P(), { onFocus: a } = o, i = Le(), s = E(e, Je.Input);
1003
+ return /* @__PURE__ */ r.createElement("div", {
1004
+ className: t,
1005
+ "data-country": i || void 0,
1006
+ "data-disabled": n || void 0,
1007
+ "data-invalid": l || void 0
1008
+ }, F(s, {
1009
+ onFocus: a
1010
+ }));
1011
+ }, Kn = ({ className: e, ...t }) => {
1012
+ const { id: o, placeholder: n } = P(), { inputId: l, ariaDescribedBy: a } = T(), { onFocus: i } = t, s = x(null);
1013
+ return ae(() => {
1014
+ var d;
1015
+ (d = s.current) == null || d.focus();
1016
+ }, o), /* @__PURE__ */ r.createElement(le, {
1017
+ ref: s,
1018
+ id: l,
1019
+ "aria-describedby": a,
1020
+ className: e,
1021
+ placeholder: n,
1022
+ onFocus: i
1023
+ });
1024
+ }, Ge = ({ children: e, className: t }) => {
1025
+ const o = E(e, Ge.Option);
1026
+ return /* @__PURE__ */ r.createElement(Se, {
1027
+ className: t,
1028
+ containerPadding: 0,
1029
+ offset: 0
1030
+ }, /* @__PURE__ */ r.createElement(Re, {
1031
+ renderEmptyState: () => null
1032
+ }, (n) => F(o, {
1033
+ id: n.id,
1034
+ label: n.label
1035
+ })));
1036
+ }, Yn = ({ className: e, ...t }) => {
1037
+ const { id: o, label: n } = t;
1038
+ return /* @__PURE__ */ r.createElement(Ae, {
1039
+ className: e,
1040
+ id: o,
1041
+ textValue: n
1042
+ }, n);
1043
+ };
1044
+ Ge.Option = Yn;
1045
+ Je.Input = Kn;
1046
+ $.Label = de;
1047
+ $.Control = Je;
1048
+ $.Options = Ge;
1049
+ $.Description = ie;
1050
+ $.Error = ce;
1051
+ const W = ({ children: e }) => {
1052
+ const { id: t, value: o, onChange: n, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u, autocomplete: y } = P(), { labelId: I } = T(), { autocompleteEnabled: b } = Ie(), p = y || b, f = pe("streetName"), N = E(e, W.Label), S = E(e, W.Input), h = E(e, W.Options), O = E(e, W.Description), A = E(e, W.Error);
1053
+ return p ? /* @__PURE__ */ r.createElement(u, {
1054
+ fieldId: t,
1055
+ renderLabel: () => F(N, {
1056
+ label: f
1057
+ }),
1058
+ renderInput: () => /* @__PURE__ */ r.createElement(Hn, {
1059
+ value: o,
1060
+ onChange: n,
1061
+ disabled: l,
1062
+ readOnly: a,
1063
+ required: i,
1064
+ hasError: s,
1065
+ onBlur: d,
1066
+ onFocus: m
1067
+ }, S, h),
1068
+ renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, A, O)
1069
+ }) : /* @__PURE__ */ r.createElement(u, {
1070
+ fieldId: t,
1071
+ renderLabel: () => F(N, {
1072
+ label: f
1073
+ }),
1074
+ renderInput: () => /* @__PURE__ */ r.createElement(fe, {
1075
+ "aria-labelledby": I,
1076
+ value: o ?? "",
1077
+ onChange: n,
1078
+ isDisabled: l,
1079
+ isReadOnly: a,
1080
+ isRequired: i,
1081
+ isInvalid: s,
1082
+ onBlur: d,
1083
+ onFocus: m
1084
+ }, S),
1085
+ renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, A, O)
1086
+ });
1087
+ }, Hn = ({ children: e, value: t, onChange: o, disabled: n, readOnly: l, required: a, hasError: i, onBlur: s, onFocus: d }) => {
1088
+ const { labelId: m } = T(), { onAddressSelect: u } = Ie(), y = Le(), I = Ke({
1089
+ enabled: !0
1090
+ }), { predictions: b, updatePredictions: p, clearPredictions: f } = St({
1091
+ atlas: I
1092
+ }), N = E(e, W.Input), S = E(e, W.Options), h = w(() => b.reduce((g, v) => (v.searchId && v.description && g.push({
1093
+ id: v.searchId,
1094
+ label: v.description
1095
+ }), g), []), [
1096
+ b
1097
+ ]), O = R((g) => {
1098
+ p({
1099
+ input: g,
1100
+ countryCodes: y ? [
1101
+ y
1102
+ ] : void 0
1103
+ }), o(g);
1104
+ }, [
1105
+ o,
1106
+ p,
1107
+ y
1108
+ ]), A = R(async (g) => {
1109
+ if (f(), !g)
1110
+ return;
1111
+ const v = await (I == null ? void 0 : I.getPlace({
1112
+ searchId: String(g)
1113
+ }));
1114
+ v && u && u(v);
1115
+ }, [
1116
+ u,
1117
+ f,
1118
+ I
1119
+ ]), M = R(() => {
1120
+ f(), s == null || s();
1121
+ }, [
1122
+ s,
1123
+ f
1124
+ ]), _ = R(() => {
1125
+ d == null || d();
1126
+ }, [
1127
+ d
1128
+ ]);
1129
+ return /* @__PURE__ */ r.createElement(De, {
1130
+ "aria-labelledby": m,
1131
+ inputValue: t ?? "",
1132
+ onInputChange: O,
1133
+ value: null,
1134
+ onChange: A,
1135
+ isDisabled: n,
1136
+ isReadOnly: l,
1137
+ isRequired: a,
1138
+ isInvalid: i,
1139
+ onBlur: M,
1140
+ onFocus: _,
1141
+ allowsCustomValue: !0,
1142
+ menuTrigger: "input",
1143
+ items: h
1144
+ }, F(N, {
1145
+ onFocus: _
1146
+ }), F(S, {
1147
+ options: h
1148
+ }), /* @__PURE__ */ r.createElement(Ye, {
1149
+ optionCount: h.length
1150
+ }));
1151
+ }, jn = ({ className: e, ...t }) => {
1152
+ const { id: o, placeholder: n } = P(), { inputId: l, ariaDescribedBy: a } = T(), { onFocus: i } = t, s = x(null);
1153
+ return ae(() => {
1154
+ var d;
1155
+ (d = s.current) == null || d.focus();
1156
+ }, o), /* @__PURE__ */ r.createElement(le, {
1157
+ ref: s,
1158
+ id: l,
1159
+ "aria-describedby": a,
1160
+ className: e,
1161
+ placeholder: n,
1162
+ onFocus: i
1163
+ });
1164
+ }, Xe = ({ children: e, className: t }) => {
1165
+ const o = E(e, Xe.Option);
1166
+ return /* @__PURE__ */ r.createElement(Se, {
1167
+ className: t,
1168
+ containerPadding: 0,
1169
+ offset: 0
1170
+ }, /* @__PURE__ */ r.createElement(Re, {
1171
+ renderEmptyState: () => null
1172
+ }, (n) => F(o, {
1173
+ id: n.id,
1174
+ label: n.label
1175
+ })));
1176
+ }, Jn = ({ className: e, ...t }) => {
1177
+ const { id: o, label: n } = t;
1178
+ return /* @__PURE__ */ r.createElement(Ae, {
1179
+ className: e,
1180
+ id: o,
1181
+ textValue: n
1182
+ }, n);
1183
+ };
1184
+ Xe.Option = Jn;
1185
+ W.Label = de;
1186
+ W.Input = jn;
1187
+ W.Options = Xe;
1188
+ W.Description = ie;
1189
+ W.Error = ce;
1190
+ const se = ({ children: e }) => {
1191
+ const { id: t, value: o, onChange: n, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: y } = T(), I = pe("streetNumber"), b = E(e, se.Label), p = E(e, se.Input), f = E(e, se.Description), N = E(e, se.Error);
1192
+ return /* @__PURE__ */ r.createElement(u, {
1193
+ fieldId: t,
1194
+ renderLabel: () => F(b, {
1195
+ label: I
1196
+ }),
1197
+ renderInput: () => /* @__PURE__ */ r.createElement(fe, {
1198
+ "aria-labelledby": y,
1199
+ value: o ?? "",
1200
+ onChange: n,
1201
+ isDisabled: l,
1202
+ isReadOnly: a,
1203
+ isRequired: i,
1204
+ isInvalid: s,
1205
+ onBlur: d,
1206
+ onFocus: m
1207
+ }, p),
1208
+ renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, N, f)
1209
+ });
1210
+ }, Gn = ({ className: e }) => {
1211
+ const { id: t, placeholder: o } = P(), { inputId: n, ariaDescribedBy: l } = T(), a = x(null);
1212
+ return ae(() => {
1213
+ var i;
1214
+ (i = a.current) == null || i.focus();
1215
+ }, t), /* @__PURE__ */ r.createElement(le, {
1216
+ ref: a,
1217
+ id: n,
1218
+ "aria-describedby": l,
1219
+ className: e,
1220
+ placeholder: o
1221
+ });
1222
+ };
1223
+ se.Label = de;
1224
+ se.Input = Gn;
1225
+ se.Description = ie;
1226
+ se.Error = ce;
1227
+ const H = ({ children: e }) => {
1228
+ const { id: t, value: o, onChange: n, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: y } = T(), { t: I } = Te(), b = Le(), p = b ? ve[b] : void 0, f = b && Bt.getCountryByShortKey(b), N = w(() => {
1229
+ var B;
1230
+ return (kt(((B = f == null ? void 0 : f.subdivisions) == null ? void 0 : B.list) || [], p) || []).map((q) => ({
1231
+ value: q.key,
1232
+ label: I(q.displayName)
1233
+ })).sort((q, D) => q.label.localeCompare(D.label));
1234
+ }, [
1235
+ p,
1236
+ I,
1237
+ f
1238
+ ]), S = R(() => n(""), [
1239
+ n
1240
+ ]), { onInputKeyDown: h, ...O } = At({
1241
+ options: N,
1242
+ value: o,
1243
+ commit: n,
1244
+ clear: S,
1245
+ onBlur: d
1246
+ }), A = pe("subdivision"), M = E(e, H.Label), _ = E(e, H.Control), g = E(e, H.Options), v = E(e, H.Description), me = E(e, H.Error);
1247
+ return /* @__PURE__ */ r.createElement(u, {
1248
+ fieldId: t,
1249
+ renderLabel: () => F(M, {
1250
+ label: A
1251
+ }),
1252
+ renderInput: () => /* @__PURE__ */ r.createElement(De, {
1253
+ "aria-labelledby": y,
1254
+ ...O,
1255
+ isDisabled: l,
1256
+ isReadOnly: a,
1257
+ isRequired: i,
1258
+ isInvalid: s,
1259
+ onFocus: m,
1260
+ menuTrigger: "input"
1261
+ }, F(_, {
1262
+ onKeyDown: h
1263
+ }), F(g, {
1264
+ options: N
1265
+ })),
1266
+ renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, me, v)
1267
+ });
1268
+ }, he = ({ children: e, className: t, ...o }) => {
1269
+ const { disabled: n, hasError: l } = P(), { onKeyDown: a } = o, i = E(e, he.Input), s = E(e, he.Trigger);
1270
+ return /* @__PURE__ */ r.createElement(Nt, {
1271
+ className: t,
1272
+ isDisabled: n,
1273
+ isInvalid: l
1274
+ }, F(i, {
1275
+ onKeyDown: a
1276
+ }), s);
1277
+ }, Xn = ({ className: e, ...t }) => {
1278
+ const { id: o, placeholder: n, readOnly: l, disabled: a } = P(), { inputId: i, ariaDescribedBy: s } = T(), { onKeyDown: d } = t, m = x(null), u = Rt({
1279
+ readOnly: l,
1280
+ disabled: a
1281
+ });
1282
+ return ae(() => {
1283
+ var y;
1284
+ (y = m.current) == null || y.focus();
1285
+ }, o), /* @__PURE__ */ r.createElement(le, {
1286
+ ref: m,
1287
+ id: i,
1288
+ "aria-describedby": s,
1289
+ className: e,
1290
+ placeholder: n,
1291
+ onClick: u,
1292
+ onKeyDown: d
1293
+ });
1294
+ }, zn = ({ children: e, className: t }) => /* @__PURE__ */ r.createElement(gt, {
1295
+ className: t
1296
+ }, e);
1297
+ he.Input = Xn;
1298
+ he.Trigger = zn;
1299
+ const ze = ({ children: e, className: t, ...o }) => {
1300
+ const { options: n } = o, l = E(e, ze.Option);
1301
+ return /* @__PURE__ */ r.createElement(Se, {
1302
+ className: t,
1303
+ containerPadding: 0,
1304
+ offset: 0
1305
+ }, /* @__PURE__ */ r.createElement(Re, null, n.map((a) => F(l, {
1306
+ key: a.value,
1307
+ value: a.value,
1308
+ label: a.label
1309
+ }))));
1310
+ }, Qn = ({ className: e, ...t }) => {
1311
+ const { value: o, label: n } = t;
1312
+ return /* @__PURE__ */ r.createElement(Ae, {
1313
+ className: e,
1314
+ id: o,
1315
+ textValue: n
1316
+ }, n);
1317
+ };
1318
+ ze.Option = Qn;
1319
+ H.Label = de;
1320
+ H.Control = he;
1321
+ H.Options = ze;
1322
+ H.Description = ie;
1323
+ H.Error = ce;
1324
+ const Zn = () => ue("country"), er = () => ue("subdivision"), tr = () => ue("city"), nr = () => ue("addressLine"), rr = () => ue("addressLine2"), or = () => ue("postalCode"), sr = () => ue("streetName"), ar = () => ue("streetNumber"), lr = () => ue("apartment"), ir = {
1325
+ [K.MLA_COUNTRY]: Zn,
1326
+ [K.MLA_SUBDIVISION]: er,
1327
+ [K.MLA_CITY]: tr,
1328
+ [K.MLA_ADDRESS_LINE]: nr,
1329
+ [K.MLA_ADDRESS_LINE_2]: rr,
1330
+ [K.MLA_POSTAL_CODE]: or,
1331
+ [K.MLA_STREET_NAME]: sr,
1332
+ [K.MLA_STREET_NUMBER]: ar,
1333
+ [K.MLA_APARTMENT]: lr
1334
+ }, cr = {}, dr = [], c = ({ children: e }) => {
1335
+ const { id: t, form: o, value: n, onChange: l, onFieldBlur: a, onFieldFocus: i, errors: s, FieldLayout: d, fieldSettings: m, label: u, validation: y, target: I, autocompleteEnabled: b, required: p, fieldType: f } = P(), [N, S] = be(null), h = $t(), O = w(() => ({
1336
+ ...h,
1337
+ ...ir
1338
+ }), [
1339
+ h
1340
+ ]), { isExperimentEnabled: A } = yt(), M = A(Ct.STREETLESS_LOCALITY_FALLBACK), { validateFields: _ } = Wt(), g = Ut(), v = Lt(), me = w(() => ({
1341
+ ...v,
1342
+ actions: {
1343
+ predict: Yt,
1344
+ getPlace: Kt,
1345
+ searchByPostalCode: Vt,
1346
+ ...v.actions
1347
+ }
1348
+ }), [
1349
+ v
1350
+ ]), { form: j, isMultilineAddressField: B } = yn({
1351
+ id: t,
1352
+ target: I,
1353
+ fieldType: f,
1354
+ form: o,
1355
+ country: n == null ? void 0 : n.country,
1356
+ fieldSettings: m,
1357
+ validation: y,
1358
+ required: p
1359
+ }), q = R((U) => {
1360
+ if (!n)
1361
+ return;
1362
+ const G = on(U, B, M), _e = {
1363
+ ...G,
1364
+ [ye.COUNTRY]: G[ye.COUNTRY] ?? n[ye.COUNTRY]
1365
+ };
1366
+ l == null || l(_e);
1367
+ }, [
1368
+ l,
1369
+ n,
1370
+ B,
1371
+ M
1372
+ ]), D = R((U, G) => {
1373
+ if (B && U === ye.COUNTRY && (n == null ? void 0 : n[U]) !== G) {
1374
+ l == null || l({
1375
+ [ye.COUNTRY]: G
1376
+ });
1377
+ return;
1378
+ }
1379
+ l == null || l({
1380
+ ...n,
1381
+ [U]: G
1382
+ });
1383
+ }, [
1384
+ l,
1385
+ n,
1386
+ B
1387
+ ]), J = R(async (U) => _(B ? [
1388
+ ...U,
1389
+ {
1390
+ path: `${I}/${ye.COUNTRY}`,
1391
+ value: n == null ? void 0 : n.country
1392
+ }
1393
+ ] : U), [
1394
+ n,
1395
+ I,
1396
+ _,
1397
+ B
1398
+ ]);
1399
+ Ht(t, () => {
1400
+ var _e;
1401
+ const U = s == null ? void 0 : s[0], G = (_e = j == null ? void 0 : j.fields) == null ? void 0 : _e.find((at) => "target" in at && at.target === (U == null ? void 0 : U.errorPath));
1402
+ return G == null ? void 0 : G.id;
1403
+ });
1404
+ const Ee = Xt(t), Ne = F(E(e, c.Country), {
1405
+ isForcedOpen: Ee
1406
+ }), Qe = E(e, c.Subdivision), Ze = E(e, c.City), et = E(e, c.AddressLine), tt = E(e, c.AddressLine2), nt = E(e, c.PostalCode), rt = E(e, c.StreetName), ot = E(e, c.StreetNumber), st = E(e, c.Apartment), _t = w(() => ({
1407
+ country: Ne,
1408
+ subdivision: Qe,
1409
+ city: Ze,
1410
+ addressLine: et,
1411
+ addressLine2: tt,
1412
+ postalCode: nt,
1413
+ streetName: rt,
1414
+ streetNumber: ot,
1415
+ apartment: st
1416
+ }), [
1417
+ Ne,
1418
+ Qe,
1419
+ Ze,
1420
+ et,
1421
+ tt,
1422
+ nt,
1423
+ rt,
1424
+ ot,
1425
+ st
1426
+ ]);
1427
+ return j ? /* @__PURE__ */ r.createElement(d, {
1428
+ fieldId: t
1429
+ }, /* @__PURE__ */ r.createElement(an, {
1430
+ countryCode: n == null ? void 0 : n.country
1431
+ }, /* @__PURE__ */ r.createElement(sn, {
1432
+ autocompleteEnabled: b,
1433
+ onAddressSelect: q
1434
+ }, /* @__PURE__ */ r.createElement(Cn, {
1435
+ fields: _t
1436
+ }, /* @__PURE__ */ r.createElement("div", {
1437
+ ref: S,
1438
+ style: {
1439
+ display: "contents"
1440
+ }
1441
+ }), /* @__PURE__ */ r.createElement(Pt, {
1442
+ getContainer: () => N
1443
+ }, /* @__PURE__ */ r.createElement("fieldset", {
1444
+ style: Jt
1445
+ }, /* @__PURE__ */ r.createElement("legend", {
1446
+ style: Gt
1447
+ }, u), /* @__PURE__ */ r.createElement(jt, {
1448
+ formSchema: g,
1449
+ form: j,
1450
+ values: n ?? cr,
1451
+ onFieldChange: D,
1452
+ onBlur: a,
1453
+ onFocus: i,
1454
+ errors: s ?? dr,
1455
+ validateFields: J,
1456
+ fields: O,
1457
+ fieldActions: me
1458
+ }))))))) : null;
1459
+ };
1460
+ c.Country = Y;
1461
+ c.Subdivision = H;
1462
+ c.City = oe;
1463
+ c.AddressLine = k;
1464
+ c.AddressLine2 = ne;
1465
+ c.PostalCode = $;
1466
+ c.StreetName = W;
1467
+ c.StreetNumber = se;
1468
+ c.Apartment = re;
1469
+ const ur = "_postalCodeControl_1tire_1", mr = "_comboControl_1tire_5", pr = "_comboTrigger_1tire_19", Oe = {
1470
+ postalCodeControl: ur,
1471
+ comboControl: mr,
1472
+ comboTrigger: pr
1473
+ }, Tr = () => {
1474
+ const e = nn(), t = zt(Me);
1475
+ return /* @__PURE__ */ r.createElement(c, null, /* @__PURE__ */ r.createElement(c.Country, null, /* @__PURE__ */ r.createElement(c.Country.Label, {
1476
+ className: L(Q, C.label)
1477
+ }, /* @__PURE__ */ r.createElement(c.Country.Label.Required, {
1478
+ className: L(Z, C.requiredMark)
1479
+ })), /* @__PURE__ */ r.createElement(c.Country.Control, {
1480
+ className: L(ct, C.input, Oe.comboControl)
1481
+ }, /* @__PURE__ */ r.createElement(c.Country.Control.Input, {
1482
+ className: L(C.innerInput, Me)
1483
+ }), /* @__PURE__ */ r.createElement(c.Country.Control.Trigger, {
1484
+ className: Oe.comboTrigger
1485
+ }, /* @__PURE__ */ r.createElement(it, {
1486
+ className: C.dropdownIcon
1487
+ }))), /* @__PURE__ */ r.createElement(c.Country.Options, {
1488
+ className: L(ge, C.selectPopover, C.dropdownPopover)
1489
+ }, /* @__PURE__ */ r.createElement(c.Country.Options.Option, {
1490
+ className: t
1491
+ })), /* @__PURE__ */ r.createElement(c.Country.Error, {
1492
+ className: L(ee, C.error)
1493
+ }, /* @__PURE__ */ r.createElement(z, null), /* @__PURE__ */ r.createElement(c.Country.Error.Text, null)), /* @__PURE__ */ r.createElement(c.Country.Description, {
1494
+ className: L(te, C.description)
1495
+ }, ({ content: o, locale: n }) => /* @__PURE__ */ r.createElement(X, {
1496
+ content: o,
1497
+ locale: n
1498
+ }))), /* @__PURE__ */ r.createElement(c.AddressLine, null, /* @__PURE__ */ r.createElement(c.AddressLine.Label, {
1499
+ className: L(Q, C.label)
1500
+ }, /* @__PURE__ */ r.createElement(c.AddressLine.Label.Required, {
1501
+ className: L(Z, C.requiredMark)
1502
+ })), /* @__PURE__ */ r.createElement(c.AddressLine.Input, {
1503
+ className: e
1504
+ }), /* @__PURE__ */ r.createElement(c.AddressLine.Options, {
1505
+ className: L(ge, C.selectPopover, C.dropdownPopover)
1506
+ }, /* @__PURE__ */ r.createElement(c.AddressLine.Options.Option, {
1507
+ className: t
1508
+ })), /* @__PURE__ */ r.createElement(c.AddressLine.Error, {
1509
+ className: L(ee, C.error)
1510
+ }, /* @__PURE__ */ r.createElement(z, null), /* @__PURE__ */ r.createElement(c.AddressLine.Error.Text, null)), /* @__PURE__ */ r.createElement(c.AddressLine.Description, {
1511
+ className: L(te, C.description)
1512
+ }, ({ content: o, locale: n }) => /* @__PURE__ */ r.createElement(X, {
1513
+ content: o,
1514
+ locale: n
1515
+ }))), /* @__PURE__ */ r.createElement(c.AddressLine2, null, /* @__PURE__ */ r.createElement(c.AddressLine2.Label, {
1516
+ className: L(Q, C.label)
1517
+ }, /* @__PURE__ */ r.createElement(c.AddressLine2.Label.Required, {
1518
+ className: L(Z, C.requiredMark)
1519
+ })), /* @__PURE__ */ r.createElement(c.AddressLine2.Input, {
1520
+ className: e
1521
+ }), /* @__PURE__ */ r.createElement(c.AddressLine2.Error, {
1522
+ className: L(ee, C.error)
1523
+ }, /* @__PURE__ */ r.createElement(z, null), /* @__PURE__ */ r.createElement(c.AddressLine2.Error.Text, null)), /* @__PURE__ */ r.createElement(c.AddressLine2.Description, {
1524
+ className: L(te, C.description)
1525
+ }, ({ content: o, locale: n }) => /* @__PURE__ */ r.createElement(X, {
1526
+ content: o,
1527
+ locale: n
1528
+ }))), /* @__PURE__ */ r.createElement(c.City, null, /* @__PURE__ */ r.createElement(c.City.Label, {
1529
+ className: L(Q, C.label)
1530
+ }, /* @__PURE__ */ r.createElement(c.City.Label.Required, {
1531
+ className: L(Z, C.requiredMark)
1532
+ })), /* @__PURE__ */ r.createElement(c.City.Input, {
1533
+ className: e
1534
+ }), /* @__PURE__ */ r.createElement(c.City.Error, {
1535
+ className: L(ee, C.error)
1536
+ }, /* @__PURE__ */ r.createElement(z, null), /* @__PURE__ */ r.createElement(c.City.Error.Text, null)), /* @__PURE__ */ r.createElement(c.City.Description, {
1537
+ className: L(te, C.description)
1538
+ }, ({ content: o, locale: n }) => /* @__PURE__ */ r.createElement(X, {
1539
+ content: o,
1540
+ locale: n
1541
+ }))), /* @__PURE__ */ r.createElement(c.PostalCode, null, /* @__PURE__ */ r.createElement(c.PostalCode.Label, {
1542
+ className: L(Q, C.label)
1543
+ }, /* @__PURE__ */ r.createElement(c.PostalCode.Label.Required, {
1544
+ className: L(Z, C.requiredMark)
1545
+ })), /* @__PURE__ */ r.createElement(c.PostalCode.Control, {
1546
+ className: Oe.postalCodeControl
1547
+ }, /* @__PURE__ */ r.createElement(c.PostalCode.Control.Input, {
1548
+ className: e
1549
+ })), /* @__PURE__ */ r.createElement(c.PostalCode.Options, {
1550
+ className: L(ge, C.selectPopover, C.dropdownPopover)
1551
+ }, /* @__PURE__ */ r.createElement(c.PostalCode.Options.Option, {
1552
+ className: t
1553
+ })), /* @__PURE__ */ r.createElement(c.PostalCode.Error, {
1554
+ className: L(ee, C.error)
1555
+ }, /* @__PURE__ */ r.createElement(z, null), /* @__PURE__ */ r.createElement(c.PostalCode.Error.Text, null)), /* @__PURE__ */ r.createElement(c.PostalCode.Description, {
1556
+ className: L(te, C.description)
1557
+ }, ({ content: o, locale: n }) => /* @__PURE__ */ r.createElement(X, {
1558
+ content: o,
1559
+ locale: n
1560
+ }))), /* @__PURE__ */ r.createElement(c.Subdivision, null, /* @__PURE__ */ r.createElement(c.Subdivision.Label, {
1561
+ className: L(Q, C.label)
1562
+ }, /* @__PURE__ */ r.createElement(c.Subdivision.Label.Required, {
1563
+ className: L(Z, C.requiredMark)
1564
+ })), /* @__PURE__ */ r.createElement(c.Subdivision.Control, {
1565
+ className: L(ct, C.input, Oe.comboControl)
1566
+ }, /* @__PURE__ */ r.createElement(c.Subdivision.Control.Input, {
1567
+ className: L(C.innerInput, Me)
1568
+ }), /* @__PURE__ */ r.createElement(c.Subdivision.Control.Trigger, {
1569
+ className: Oe.comboTrigger
1570
+ }, /* @__PURE__ */ r.createElement(it, {
1571
+ className: C.dropdownIcon
1572
+ }))), /* @__PURE__ */ r.createElement(c.Subdivision.Options, {
1573
+ className: L(ge, C.selectPopover, C.dropdownPopover)
1574
+ }, /* @__PURE__ */ r.createElement(c.Subdivision.Options.Option, {
1575
+ className: t
1576
+ })), /* @__PURE__ */ r.createElement(c.Subdivision.Error, {
1577
+ className: L(ee, C.error)
1578
+ }, /* @__PURE__ */ r.createElement(z, null), /* @__PURE__ */ r.createElement(c.Subdivision.Error.Text, null)), /* @__PURE__ */ r.createElement(c.Subdivision.Description, {
1579
+ className: L(te, C.description)
1580
+ }, ({ content: o, locale: n }) => /* @__PURE__ */ r.createElement(X, {
1581
+ content: o,
1582
+ locale: n
1583
+ }))), /* @__PURE__ */ r.createElement(c.StreetName, null, /* @__PURE__ */ r.createElement(c.StreetName.Label, {
1584
+ className: L(Q, C.label)
1585
+ }, /* @__PURE__ */ r.createElement(c.StreetName.Label.Required, {
1586
+ className: L(Z, C.requiredMark)
1587
+ })), /* @__PURE__ */ r.createElement(c.StreetName.Input, {
1588
+ className: e
1589
+ }), /* @__PURE__ */ r.createElement(c.StreetName.Options, {
1590
+ className: L(ge, C.selectPopover, C.dropdownPopover)
1591
+ }, /* @__PURE__ */ r.createElement(c.StreetName.Options.Option, {
1592
+ className: t
1593
+ })), /* @__PURE__ */ r.createElement(c.StreetName.Error, {
1594
+ className: L(ee, C.error)
1595
+ }, /* @__PURE__ */ r.createElement(z, null), /* @__PURE__ */ r.createElement(c.StreetName.Error.Text, null)), /* @__PURE__ */ r.createElement(c.StreetName.Description, {
1596
+ className: L(te, C.description)
1597
+ }, ({ content: o, locale: n }) => /* @__PURE__ */ r.createElement(X, {
1598
+ content: o,
1599
+ locale: n
1600
+ }))), /* @__PURE__ */ r.createElement(c.StreetNumber, null, /* @__PURE__ */ r.createElement(c.StreetNumber.Label, {
1601
+ className: L(Q, C.label)
1602
+ }, /* @__PURE__ */ r.createElement(c.StreetNumber.Label.Required, {
1603
+ className: L(Z, C.requiredMark)
1604
+ })), /* @__PURE__ */ r.createElement(c.StreetNumber.Input, {
1605
+ className: e
1606
+ }), /* @__PURE__ */ r.createElement(c.StreetNumber.Error, {
1607
+ className: L(ee, C.error)
1608
+ }, /* @__PURE__ */ r.createElement(z, null), /* @__PURE__ */ r.createElement(c.StreetNumber.Error.Text, null)), /* @__PURE__ */ r.createElement(c.StreetNumber.Description, {
1609
+ className: L(te, C.description)
1610
+ }, ({ content: o, locale: n }) => /* @__PURE__ */ r.createElement(X, {
1611
+ content: o,
1612
+ locale: n
1613
+ }))), /* @__PURE__ */ r.createElement(c.Apartment, null, /* @__PURE__ */ r.createElement(c.Apartment.Label, {
1614
+ className: L(Q, C.label)
1615
+ }, /* @__PURE__ */ r.createElement(c.Apartment.Label.Required, {
1616
+ className: L(Z, C.requiredMark)
1617
+ })), /* @__PURE__ */ r.createElement(c.Apartment.Input, {
1618
+ className: e
1619
+ }), /* @__PURE__ */ r.createElement(c.Apartment.Error, {
1620
+ className: L(ee, C.error)
1621
+ }, /* @__PURE__ */ r.createElement(z, null), /* @__PURE__ */ r.createElement(c.Apartment.Error.Text, null)), /* @__PURE__ */ r.createElement(c.Apartment.Description, {
1622
+ className: L(te, C.description)
1623
+ }, ({ content: o, locale: n }) => /* @__PURE__ */ r.createElement(X, {
1624
+ content: o,
1625
+ locale: n
1626
+ }))));
1627
+ };
1628
+ export {
1629
+ Tr as M
1630
+ };