@fluid-app/fluid-cli-theme-dev 0.1.63 → 0.1.65

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 (137) hide show
  1. package/README.md +1 -1
  2. package/dist/dist-cli-preview/.vite/manifest.json +225 -225
  3. package/dist/dist-cli-preview/account-screens.js +1 -1
  4. package/dist/dist-cli-preview/chunks/{Breadcrumb-CZ-skiUy.js → Breadcrumb-BQKo8hPc.js} +1 -1
  5. package/dist/dist-cli-preview/chunks/{Combobox-BGiCYa56.js → Combobox-cf11L_T-.js} +4 -4
  6. package/dist/dist-cli-preview/chunks/{ContactsScreen-vsNgy_gn.js → ContactsScreen-gIiy4u7c.js} +1160 -1155
  7. package/dist/dist-cli-preview/chunks/{MemberManagementProviders-DMwkh3JW.js → MemberManagementProviders-C1bwc3tB.js} +258 -224
  8. package/dist/dist-cli-preview/chunks/{MessagingScreen-DzJOwPGH.js → MessagingScreen-B8ZxAE0L.js} +3904 -3927
  9. package/dist/dist-cli-preview/chunks/{MobileActionSheet-DqVPgFKI.js → MobileActionSheet-DMeTsLlK.js} +100 -100
  10. package/dist/dist-cli-preview/chunks/{MySiteScreen-BSmWlCKA.js → MySiteScreen-Dtw1rsF9.js} +69 -69
  11. package/dist/dist-cli-preview/chunks/OrdersScreen-C-b6i5jB.js +9 -0
  12. package/dist/dist-cli-preview/chunks/{OrdersScreen-CVEl9FnN.js → OrdersScreen-D9HfcTaa.js} +247 -249
  13. package/dist/dist-cli-preview/chunks/{ProfileScreen-BC5gyJDY.js → ProfileScreen-DwXozaLs.js} +1051 -965
  14. package/dist/dist-cli-preview/chunks/{SubscriptionsScreen-CFM4Pufg.js → SubscriptionsScreen-CIdYNpWT.js} +3 -3
  15. package/dist/dist-cli-preview/chunks/{account-screen-runtime-DxhJm6Qd.js → account-screen-runtime-DYMunv0A.js} +2482 -2407
  16. package/dist/dist-cli-preview/chunks/ar-DaN3xEy4.js +351 -0
  17. package/dist/dist-cli-preview/chunks/{arrow-left-UFKI-PQf.js → arrow-left-Bd7dJtIV.js} +1 -1
  18. package/dist/dist-cli-preview/chunks/bg-D3Np0de3.js +351 -0
  19. package/dist/dist-cli-preview/chunks/bn-BDSehnZ3.js +351 -0
  20. package/dist/dist-cli-preview/chunks/{cli-preview-DunPfnjU.js → cli-preview-BT_ARKjk.js} +13 -13
  21. package/dist/dist-cli-preview/chunks/{client.gen-CSTBgfxj.js → client.gen-Ck6Pm2jV.js} +246 -236
  22. package/dist/dist-cli-preview/chunks/contacts-ChSWj70z.js +4 -0
  23. package/dist/dist-cli-preview/chunks/{countries-api-adapter-B3usO25w.js → countries-api-adapter-lxSE748x.js} +2 -2
  24. package/dist/dist-cli-preview/chunks/{create-card-entry-container-DHgsbSyr.js → create-card-entry-container-D6kSC2Aw.js} +20726 -20509
  25. package/dist/dist-cli-preview/chunks/cs-CrmATj4L.js +351 -0
  26. package/dist/dist-cli-preview/chunks/da-CmJdErjd.js +351 -0
  27. package/dist/dist-cli-preview/chunks/de-C0KTNBZq.js +351 -0
  28. package/dist/dist-cli-preview/chunks/el-BOQs49GU.js +351 -0
  29. package/dist/dist-cli-preview/chunks/es-Dt3VSQPu.js +351 -0
  30. package/dist/dist-cli-preview/chunks/fi-B8UZ7eJL.js +351 -0
  31. package/dist/dist-cli-preview/chunks/fr-BomEiNL0.js +351 -0
  32. package/dist/dist-cli-preview/chunks/he-CfmnXjsr.js +351 -0
  33. package/dist/dist-cli-preview/chunks/{hey-api-client-DSvKWGPq.js → hey-api-client-DGRBsZ7Y.js} +3 -3
  34. package/dist/dist-cli-preview/chunks/hi-CTk5zGoJ.js +351 -0
  35. package/dist/dist-cli-preview/chunks/hr-DaNToqEm.js +351 -0
  36. package/dist/dist-cli-preview/chunks/hu-lcAuIwez.js +351 -0
  37. package/dist/dist-cli-preview/chunks/id-CEThcKZG.js +351 -0
  38. package/dist/dist-cli-preview/chunks/it-BCRCoDOg.js +351 -0
  39. package/dist/dist-cli-preview/chunks/ja-BIkFdIfq.js +351 -0
  40. package/dist/dist-cli-preview/chunks/ko-CD3bk6gv.js +351 -0
  41. package/dist/dist-cli-preview/chunks/{log-out-CBUq5Hd-.js → log-out-CSPZjXTK.js} +1 -1
  42. package/dist/dist-cli-preview/chunks/{map-pin-DHfjSyoR.js → map-pin-B2ScoijR.js} +1 -1
  43. package/dist/dist-cli-preview/chunks/messaging-Bq5UPkvG.js +4 -0
  44. package/dist/dist-cli-preview/chunks/{mount-account-screen-pc1VISwF.js → mount-account-screen-C_CdoGir.js} +2453 -2392
  45. package/dist/dist-cli-preview/chunks/ms-DI4mGa5X.js +351 -0
  46. package/dist/dist-cli-preview/chunks/mysite-DcpuKsuW.js +4 -0
  47. package/dist/dist-cli-preview/chunks/nl-B-XAD3Ra.js +351 -0
  48. package/dist/dist-cli-preview/chunks/no-C_NmYGbe.js +351 -0
  49. package/dist/dist-cli-preview/chunks/orders-B_57xKkq.js +4 -0
  50. package/dist/dist-cli-preview/chunks/pl-mQRzJZEW.js +351 -0
  51. package/dist/dist-cli-preview/chunks/{plus-C-lo0pFM.js → plus-CocoE5gC.js} +1 -1
  52. package/dist/dist-cli-preview/chunks/profile-BfM2KxKe.js +4 -0
  53. package/dist/dist-cli-preview/chunks/pt-BYMWPjog.js +351 -0
  54. package/dist/dist-cli-preview/chunks/ro-B98EuFQI.js +351 -0
  55. package/dist/dist-cli-preview/chunks/ru-DBO9IasC.js +351 -0
  56. package/dist/dist-cli-preview/chunks/schemas-D94nZk5x.js +5374 -0
  57. package/dist/dist-cli-preview/chunks/{screen-route-slug-utils-B254xI_J.js → screen-route-slug-utils-BDjSpDoe.js} +1 -1
  58. package/dist/dist-cli-preview/chunks/{sheet-haptics-context-D2WUiXJm.js → sheet-haptics-context-iOjKcNDj.js} +1 -1
  59. package/dist/dist-cli-preview/chunks/{sidebar-CMSWZCPS.js → sidebar-Ckzom4Xc.js} +12 -12
  60. package/dist/dist-cli-preview/chunks/sk-hRvNJfiN.js +351 -0
  61. package/dist/dist-cli-preview/chunks/{store-api-context-BIdILNWL.js → store-api-context-B96Ip2FB.js} +1 -1
  62. package/dist/dist-cli-preview/chunks/subscriptions-8VtIA4w9.js +4 -0
  63. package/dist/dist-cli-preview/chunks/sv-noYtTQbO.js +351 -0
  64. package/dist/dist-cli-preview/chunks/th-CJCAKsR-.js +351 -0
  65. package/dist/dist-cli-preview/chunks/tl-Bx8pJ7p7.js +351 -0
  66. package/dist/dist-cli-preview/chunks/tr-C4tCNiV7.js +351 -0
  67. package/dist/dist-cli-preview/chunks/{trash-2-Bq4IqH0j.js → trash-2-wVweQZMw.js} +4 -4
  68. package/dist/dist-cli-preview/chunks/uk-xFjXQDP3.js +351 -0
  69. package/dist/dist-cli-preview/chunks/{use-optional-store-Csor1Z3z.js → use-optional-store-lZUz976C.js} +2 -2
  70. package/dist/dist-cli-preview/chunks/use-store-DVmgsDXy.js +103 -0
  71. package/dist/dist-cli-preview/chunks/{useInfiniteQuery-BpFtQ7DH.js → useInfiniteQuery-Dtzov9uh.js} +1 -1
  72. package/dist/dist-cli-preview/chunks/{user-BGrQJ1GJ.js → user-B81IrSgp.js} +1 -1
  73. package/dist/dist-cli-preview/chunks/{users-DBL0isYy.js → users-BXTjoCUz.js} +1 -1
  74. package/dist/dist-cli-preview/chunks/vi-BAvhRTgb.js +351 -0
  75. package/dist/dist-cli-preview/chunks/zh_CN-Cyq9zeex.js +351 -0
  76. package/dist/dist-cli-preview/chunks/zh_TW-DFM5MhMA.js +351 -0
  77. package/dist/index.mjs +346 -32
  78. package/dist/index.mjs.map +1 -1
  79. package/dist/skills/themes-cart-feedback/SKILL.md +9 -14
  80. package/dist/skills/themes-review/SKILL.md +40 -34
  81. package/dist/skills/themes-review/references/blocks-vs-sections.md +2 -2
  82. package/dist/skills/themes-review/references/dead-code.md +1 -1
  83. package/dist/skills/themes-review/references/dynamism.md +9 -3
  84. package/dist/skills/themes-review/references/editor-attributes.md +25 -26
  85. package/dist/skills/themes-review/references/examples.md +3 -4
  86. package/dist/skills/themes-review/references/fairshare-attributes.md +5 -5
  87. package/dist/skills/themes-review/references/global-settings.md +56 -67
  88. package/dist/skills/themes-review/references/liquid-correctness.md +10 -15
  89. package/dist/skills/themes-review/references/media-tag.md +8 -7
  90. package/dist/skills/themes-review/references/navigation.md +18 -13
  91. package/dist/skills/themes-review/references/security-accessibility.md +11 -6
  92. package/dist/skills/themes-review/references/setting-types.md +136 -77
  93. package/dist/skills/themes-settings-schema/SKILL.md +15 -2
  94. package/package.json +2 -2
  95. package/dist/dist-cli-preview/chunks/OrdersScreen-d4fJE_dm.js +0 -9
  96. package/dist/dist-cli-preview/chunks/ar-B7NQmkZ1.js +0 -341
  97. package/dist/dist-cli-preview/chunks/bg-CxfL8rZN.js +0 -341
  98. package/dist/dist-cli-preview/chunks/bn-CdhHCK--.js +0 -341
  99. package/dist/dist-cli-preview/chunks/contacts-CpYlEgAq.js +0 -4
  100. package/dist/dist-cli-preview/chunks/cs-DTe-xGeI.js +0 -341
  101. package/dist/dist-cli-preview/chunks/da-B8Cl_vkl.js +0 -341
  102. package/dist/dist-cli-preview/chunks/de-D8cYy8G-.js +0 -341
  103. package/dist/dist-cli-preview/chunks/el-Chjin2JW.js +0 -341
  104. package/dist/dist-cli-preview/chunks/es-mp8RwFN4.js +0 -341
  105. package/dist/dist-cli-preview/chunks/fi-91gcpxoy.js +0 -341
  106. package/dist/dist-cli-preview/chunks/fr-ekvUCKTH.js +0 -341
  107. package/dist/dist-cli-preview/chunks/he-B7QiuquT.js +0 -341
  108. package/dist/dist-cli-preview/chunks/hi-DNNhi7ud.js +0 -341
  109. package/dist/dist-cli-preview/chunks/hr-CAwxMKX_.js +0 -341
  110. package/dist/dist-cli-preview/chunks/hu-D_oQwH4Q.js +0 -341
  111. package/dist/dist-cli-preview/chunks/id-oeAszBoo.js +0 -341
  112. package/dist/dist-cli-preview/chunks/isAfter-BUGgByEf.js +0 -1414
  113. package/dist/dist-cli-preview/chunks/it-Dme6GXSG.js +0 -341
  114. package/dist/dist-cli-preview/chunks/ja-CRnvQNCa.js +0 -341
  115. package/dist/dist-cli-preview/chunks/ko-8mk8A3_I.js +0 -341
  116. package/dist/dist-cli-preview/chunks/messaging-DkyH4CPP.js +0 -4
  117. package/dist/dist-cli-preview/chunks/ms-Bs0GvdOw.js +0 -341
  118. package/dist/dist-cli-preview/chunks/mysite-wvfITV7T.js +0 -4
  119. package/dist/dist-cli-preview/chunks/nl-tsI6lLxl.js +0 -341
  120. package/dist/dist-cli-preview/chunks/no-DMot6qX0.js +0 -341
  121. package/dist/dist-cli-preview/chunks/orders-c13r499A.js +0 -4
  122. package/dist/dist-cli-preview/chunks/pl-DmTxONNg.js +0 -341
  123. package/dist/dist-cli-preview/chunks/profile-CoWo9Sxe.js +0 -4
  124. package/dist/dist-cli-preview/chunks/pt-DgmwnAV-.js +0 -341
  125. package/dist/dist-cli-preview/chunks/ro-B4M17oRc.js +0 -341
  126. package/dist/dist-cli-preview/chunks/ru-BS2gZnbs.js +0 -341
  127. package/dist/dist-cli-preview/chunks/schemas-9_ZwC5nC.js +0 -3977
  128. package/dist/dist-cli-preview/chunks/sk-BdDjjHfn.js +0 -341
  129. package/dist/dist-cli-preview/chunks/subscriptions-BHALQrcU.js +0 -4
  130. package/dist/dist-cli-preview/chunks/sv-CW7FL5HA.js +0 -341
  131. package/dist/dist-cli-preview/chunks/th-BYBMKmSh.js +0 -341
  132. package/dist/dist-cli-preview/chunks/tl-CDigaLsK.js +0 -341
  133. package/dist/dist-cli-preview/chunks/tr-PxiurNCr.js +0 -341
  134. package/dist/dist-cli-preview/chunks/uk-B4aYnJ8t.js +0 -341
  135. package/dist/dist-cli-preview/chunks/vi-BoKSdzH3.js +0 -341
  136. package/dist/dist-cli-preview/chunks/zh_CN-DrCrXsZC.js +0 -341
  137. package/dist/dist-cli-preview/chunks/zh_TW-JmyC1W5K.js +0 -341
@@ -1,59 +1,59 @@
1
- import { c as H, i as mt, l as v, j as a, G as ht, H as se, J as pt, K as J, M as ae, I as ve, N as P, R as S, B as ie, D as Pe, E as oe, x as gt, O as B, U as xt, V as $, W as D, X as _t, Y as bt, Z as yt, P as vt, _ as Y, z as le, $ as Ae, q as jt, a0 as wt, a1 as Ct } from "./account-screen-runtime-DxhJm6Qd.js";
2
- import { u as M, a as Nt, b as O, c as St, d as Et, M as Pt } from "./MemberManagementProviders-DMwkh3JW.js";
3
- import { O as At } from "./OrdersScreen-CVEl9FnN.js";
4
- import { F as W, e as Mt, f as Rt, S as Lt, P as Ft, a as It, b as kt, d as Dt, A as Ot, B as Me, C as Re, c as zt, g as Tt, u as Bt, i as Ut, h as $t, T as qt, j as Qt, k as Vt, m as Ht, E as Kt, l as Le } from "./create-card-entry-container-DHgsbSyr.js";
5
- import { u as ce } from "./isAfter-BUGgByEf.js";
6
- import { u as Gt } from "./trash-2-Bq4IqH0j.js";
7
- import { R as Fe, D as Yt, u as q, o as ee, s as F } from "./schemas-9_ZwC5nC.js";
8
- import { I as Wt } from "./sheet-haptics-context-D2WUiXJm.js";
9
- import { u as K } from "./sidebar-CMSWZCPS.js";
10
- import { u as Xt } from "./countries-api-adapter-B3usO25w.js";
11
- import { M as Zt } from "./map-pin-DHfjSyoR.js";
12
- import { A as je } from "./arrow-left-UFKI-PQf.js";
13
- import { L as Jt } from "./log-out-CBUq5Hd-.js";
1
+ import { c as Y, i as mt, l as v, j as n, G as ht, H as le, J as pt, K as ne, M as ce, N as gt, O as E, I as je, R as A, B as de, D as Ae, E as ue, x as xt, U as $, V as _t, W as H, X as T, Y as bt, Z as vt, _ as yt, P as jt, $ as J, z as fe, a0 as Me, q as wt, a1 as Ct, a2 as Nt } from "./account-screen-runtime-DYMunv0A.js";
2
+ import { u as R, a as St, b as B, c as Et, d as Pt, M as At } from "./MemberManagementProviders-C1bwc3tB.js";
3
+ import { O as Mt } from "./OrdersScreen-D9HfcTaa.js";
4
+ import { F as ee, e as Rt, f as Ft, S as It, P as Lt, a as kt, b as Dt, d as Ot, A as zt, B as Re, C as Fe, c as Tt, g as Bt, u as Ut, i as $t, h as qt, T as Qt, j as Vt, k as Ht, m as Kt, E as Gt, l as Ie } from "./create-card-entry-container-D6kSC2Aw.js";
5
+ import { u as me } from "./use-store-DVmgsDXy.js";
6
+ import { u as Yt } from "./trash-2-wVweQZMw.js";
7
+ import { R as Le, D as Wt, u as K, o as se, s as L } from "./schemas-D94nZk5x.js";
8
+ import { I as Xt } from "./sheet-haptics-context-iOjKcNDj.js";
9
+ import { u as W } from "./sidebar-Ckzom4Xc.js";
10
+ import { u as Zt } from "./countries-api-adapter-lxSE748x.js";
11
+ import { M as Jt } from "./map-pin-B2ScoijR.js";
12
+ import { A as we } from "./arrow-left-Bd7dJtIV.js";
13
+ import { L as er } from "./log-out-CSPZjXTK.js";
14
14
  /**
15
15
  * @license lucide-react v0.575.0 - ISC
16
16
  *
17
17
  * This source code is licensed under the ISC license.
18
18
  * See the LICENSE file in the root directory of this source tree.
19
19
  */
20
- const er = [
20
+ const tr = [
21
21
  ["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
22
22
  ["line", { x1: "2", x2: "22", y1: "10", y2: "10", key: "1b3vmo" }]
23
- ], Ie = H("credit-card", er);
23
+ ], ke = Y("credit-card", tr);
24
24
  /**
25
25
  * @license lucide-react v0.575.0 - ISC
26
26
  *
27
27
  * This source code is licensed under the ISC license.
28
28
  * See the LICENSE file in the root directory of this source tree.
29
29
  */
30
- const tr = [
30
+ const rr = [
31
31
  ["path", { d: "m5 8 6 6", key: "1wu5hv" }],
32
32
  ["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
33
33
  ["path", { d: "M2 5h12", key: "or177f" }],
34
34
  ["path", { d: "M7 2h1", key: "1t2jsx" }],
35
35
  ["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
36
36
  ["path", { d: "M14 18h6", key: "1m8k6r" }]
37
- ], rr = H("languages", tr);
37
+ ], nr = Y("languages", rr);
38
38
  /**
39
39
  * @license lucide-react v0.575.0 - ISC
40
40
  *
41
41
  * This source code is licensed under the ISC license.
42
42
  * See the LICENSE file in the root directory of this source tree.
43
43
  */
44
- const nr = [
44
+ const sr = [
45
45
  ["path", { d: "m2 9 3-3 3 3", key: "1ltn5i" }],
46
46
  ["path", { d: "M13 18H7a2 2 0 0 1-2-2V6", key: "1r6tfw" }],
47
47
  ["path", { d: "m22 15-3 3-3-3", key: "4rnwn2" }],
48
48
  ["path", { d: "M11 6h6a2 2 0 0 1 2 2v10", key: "2f72bc" }]
49
- ], ke = H("repeat-2", nr);
49
+ ], De = Y("repeat-2", sr);
50
50
  /**
51
51
  * @license lucide-react v0.575.0 - ISC
52
52
  *
53
53
  * This source code is licensed under the ISC license.
54
54
  * See the LICENSE file in the root directory of this source tree.
55
55
  */
56
- const sr = [
56
+ const ar = [
57
57
  [
58
58
  "path",
59
59
  {
@@ -61,18 +61,18 @@ const sr = [
61
61
  key: "r04s7s"
62
62
  }
63
63
  ]
64
- ], ar = H("star", sr);
64
+ ], ir = Y("star", ar);
65
65
  /**
66
66
  * @license lucide-react v0.575.0 - ISC
67
67
  *
68
68
  * This source code is licensed under the ISC license.
69
69
  * See the LICENSE file in the root directory of this source tree.
70
70
  */
71
- const ir = [
71
+ const or = [
72
72
  ["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
73
73
  ["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
74
- ], or = H("user-round", ir);
75
- var X = { exports: {} }, Z = {};
74
+ ], lr = Y("user-round", or);
75
+ var te = { exports: {} }, re = {};
76
76
  /**
77
77
  * @license React
78
78
  * use-sync-external-store-shim.production.js
@@ -82,37 +82,37 @@ var X = { exports: {} }, Z = {};
82
82
  * This source code is licensed under the MIT license found in the
83
83
  * LICENSE file in the root directory of this source tree.
84
84
  */
85
- var we;
86
- function lr() {
87
- if (we) return Z;
88
- we = 1;
85
+ var Ce;
86
+ function cr() {
87
+ if (Ce) return re;
88
+ Ce = 1;
89
89
  var e = mt();
90
90
  function i(o, c) {
91
91
  return o === c && (o !== 0 || 1 / o === 1 / c) || o !== o && c !== c;
92
92
  }
93
- var t = typeof Object.is == "function" ? Object.is : i, l = e.useState, d = e.useEffect, u = e.useLayoutEffect, h = e.useDebugValue;
94
- function p(o, c) {
95
- var f = c(), m = l({ inst: { value: f, getSnapshot: c } }), g = m[0].inst, x = m[1];
93
+ var t = typeof Object.is == "function" ? Object.is : i, l = e.useState, d = e.useEffect, u = e.useLayoutEffect, p = e.useDebugValue;
94
+ function g(o, c) {
95
+ var m = c(), f = l({ inst: { value: m, getSnapshot: c } }), h = f[0].inst, x = f[1];
96
96
  return u(
97
97
  function() {
98
- g.value = f, g.getSnapshot = c, s(g) && x({ inst: g });
98
+ h.value = m, h.getSnapshot = c, a(h) && x({ inst: h });
99
99
  },
100
- [o, f, c]
100
+ [o, m, c]
101
101
  ), d(
102
102
  function() {
103
- return s(g) && x({ inst: g }), o(function() {
104
- s(g) && x({ inst: g });
103
+ return a(h) && x({ inst: h }), o(function() {
104
+ a(h) && x({ inst: h });
105
105
  });
106
106
  },
107
107
  [o]
108
- ), h(f), f;
108
+ ), p(m), m;
109
109
  }
110
- function s(o) {
110
+ function a(o) {
111
111
  var c = o.getSnapshot;
112
112
  o = o.value;
113
113
  try {
114
- var f = c();
115
- return !t(o, f);
114
+ var m = c();
115
+ return !t(o, m);
116
116
  } catch {
117
117
  return !0;
118
118
  }
@@ -120,96 +120,96 @@ function lr() {
120
120
  function r(o, c) {
121
121
  return c();
122
122
  }
123
- var n = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : p;
124
- return Z.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : n, Z;
123
+ var s = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : g;
124
+ return re.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : s, re;
125
125
  }
126
- var Ce;
127
- function cr() {
128
- return Ce || (Ce = 1, X.exports = lr()), X.exports;
126
+ var Ne;
127
+ function dr() {
128
+ return Ne || (Ne = 1, te.exports = cr()), te.exports;
129
129
  }
130
- var dr = cr();
131
- function ur() {
132
- return dr.useSyncExternalStore(
133
- fr,
130
+ var ur = dr();
131
+ function fr() {
132
+ return ur.useSyncExternalStore(
133
+ mr,
134
134
  () => !0,
135
135
  () => !1
136
136
  );
137
137
  }
138
- function fr() {
138
+ function mr() {
139
139
  return () => {
140
140
  };
141
141
  }
142
- var de = "Avatar", [mr] = ht(de), [hr, De] = mr(de), Oe = v.forwardRef(
142
+ var he = "Avatar", [hr] = ht(he), [pr, Oe] = hr(he), ze = v.forwardRef(
143
143
  (e, i) => {
144
144
  const { __scopeAvatar: t, ...l } = e, [d, u] = v.useState("idle");
145
- return /* @__PURE__ */ a.jsx(
146
- hr,
145
+ return /* @__PURE__ */ n.jsx(
146
+ pr,
147
147
  {
148
148
  scope: t,
149
149
  imageLoadingStatus: d,
150
150
  onImageLoadingStatusChange: u,
151
- children: /* @__PURE__ */ a.jsx(se.span, { ...l, ref: i })
151
+ children: /* @__PURE__ */ n.jsx(le.span, { ...l, ref: i })
152
152
  }
153
153
  );
154
154
  }
155
155
  );
156
- Oe.displayName = de;
157
- var ze = "AvatarImage", Te = v.forwardRef(
156
+ ze.displayName = he;
157
+ var Te = "AvatarImage", Be = v.forwardRef(
158
158
  (e, i) => {
159
159
  const { __scopeAvatar: t, src: l, onLoadingStatusChange: d = () => {
160
- }, ...u } = e, h = De(ze, t), p = pr(l, u), s = pt((r) => {
161
- d(r), h.onImageLoadingStatusChange(r);
160
+ }, ...u } = e, p = Oe(Te, t), g = gr(l, u), a = pt((r) => {
161
+ d(r), p.onImageLoadingStatusChange(r);
162
162
  });
163
- return J(() => {
164
- p !== "idle" && s(p);
165
- }, [p, s]), p === "loaded" ? /* @__PURE__ */ a.jsx(se.img, { ...u, ref: i, src: l }) : null;
163
+ return ne(() => {
164
+ g !== "idle" && a(g);
165
+ }, [g, a]), g === "loaded" ? /* @__PURE__ */ n.jsx(le.img, { ...u, ref: i, src: l }) : null;
166
166
  }
167
167
  );
168
- Te.displayName = ze;
169
- var Be = "AvatarFallback", Ue = v.forwardRef(
168
+ Be.displayName = Te;
169
+ var Ue = "AvatarFallback", $e = v.forwardRef(
170
170
  (e, i) => {
171
- const { __scopeAvatar: t, delayMs: l, ...d } = e, u = De(Be, t), [h, p] = v.useState(l === void 0);
171
+ const { __scopeAvatar: t, delayMs: l, ...d } = e, u = Oe(Ue, t), [p, g] = v.useState(l === void 0);
172
172
  return v.useEffect(() => {
173
173
  if (l !== void 0) {
174
- const s = window.setTimeout(() => p(!0), l);
175
- return () => window.clearTimeout(s);
174
+ const a = window.setTimeout(() => g(!0), l);
175
+ return () => window.clearTimeout(a);
176
176
  }
177
- }, [l]), h && u.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ a.jsx(se.span, { ...d, ref: i }) : null;
177
+ }, [l]), p && u.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ n.jsx(le.span, { ...d, ref: i }) : null;
178
178
  }
179
179
  );
180
- Ue.displayName = Be;
181
- function Ne(e, i) {
180
+ $e.displayName = Ue;
181
+ function Se(e, i) {
182
182
  return e ? i ? (e.src !== i && (e.src = i), e.complete && e.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
183
183
  }
184
- function pr(e, { referrerPolicy: i, crossOrigin: t }) {
185
- const l = ur(), d = v.useRef(null), u = l ? (d.current || (d.current = new window.Image()), d.current) : null, [h, p] = v.useState(
186
- () => Ne(u, e)
184
+ function gr(e, { referrerPolicy: i, crossOrigin: t }) {
185
+ const l = fr(), d = v.useRef(null), u = l ? (d.current || (d.current = new window.Image()), d.current) : null, [p, g] = v.useState(
186
+ () => Se(u, e)
187
187
  );
188
- return J(() => {
189
- p(Ne(u, e));
190
- }, [u, e]), J(() => {
191
- const s = (o) => () => {
192
- p(o);
188
+ return ne(() => {
189
+ g(Se(u, e));
190
+ }, [u, e]), ne(() => {
191
+ const a = (o) => () => {
192
+ g(o);
193
193
  };
194
194
  if (!u) return;
195
- const r = s("loaded"), n = s("error");
196
- return u.addEventListener("load", r), u.addEventListener("error", n), i && (u.referrerPolicy = i), typeof t == "string" && (u.crossOrigin = t), () => {
197
- u.removeEventListener("load", r), u.removeEventListener("error", n);
195
+ const r = a("loaded"), s = a("error");
196
+ return u.addEventListener("load", r), u.addEventListener("error", s), i && (u.referrerPolicy = i), typeof t == "string" && (u.crossOrigin = t), () => {
197
+ u.removeEventListener("load", r), u.removeEventListener("error", s);
198
198
  };
199
- }, [u, t, i]), h;
199
+ }, [u, t, i]), p;
200
200
  }
201
- var gr = Oe, xr = Te, _r = Ue;
202
- function br({
201
+ var xr = ze, _r = Be, br = $e;
202
+ function vr({
203
203
  className: e,
204
204
  size: i = "default",
205
205
  ...t
206
206
  }) {
207
- return /* @__PURE__ */ a.jsx(
208
- gr,
207
+ return /* @__PURE__ */ n.jsx(
208
+ xr,
209
209
  {
210
210
  "data-slot": "avatar",
211
211
  "data-size": i,
212
- className: ae(
212
+ className: ce(
213
213
  "group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",
214
214
  e
215
215
  ),
@@ -221,24 +221,24 @@ function yr({
221
221
  className: e,
222
222
  ...i
223
223
  }) {
224
- return /* @__PURE__ */ a.jsx(
225
- xr,
224
+ return /* @__PURE__ */ n.jsx(
225
+ _r,
226
226
  {
227
227
  "data-slot": "avatar-image",
228
- className: ae("aspect-square size-full", e),
228
+ className: ce("aspect-square size-full", e),
229
229
  ...i
230
230
  }
231
231
  );
232
232
  }
233
- function vr({
233
+ function jr({
234
234
  className: e,
235
235
  ...i
236
236
  }) {
237
- return /* @__PURE__ */ a.jsx(
238
- _r,
237
+ return /* @__PURE__ */ n.jsx(
238
+ br,
239
239
  {
240
240
  "data-slot": "avatar-fallback",
241
- className: ae(
241
+ className: ce(
242
242
  "bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",
243
243
  e
244
244
  ),
@@ -246,205 +246,291 @@ function vr({
246
246
  }
247
247
  );
248
248
  }
249
- function jr({
249
+ function wr({
250
250
  control: e,
251
251
  isOpen: i,
252
252
  onSubmit: t,
253
253
  handleClose: l,
254
254
  languageOptions: d,
255
255
  errorMsg: u,
256
- isSubmitting: h,
257
- email: p,
258
- onChangeEmail: s,
256
+ isSubmitting: p,
257
+ email: g,
258
+ onChangeEmail: a,
259
259
  isChangingEmail: r,
260
- pendingEmail: n,
260
+ pendingEmail: s,
261
261
  disableNameEdit: o = !1,
262
- presentation: c = "dialog"
262
+ presentation: c = "dialog",
263
+ fullName: m,
264
+ onUploadAvatar: f
263
265
  }) {
264
- const { t: f } = M(), [m, g] = v.useState(!1), [x, N] = v.useState(""), [j, _] = v.useState(void 0), w = async () => {
265
- _(void 0);
266
- const A = x.trim();
267
- if (!A) {
268
- _(f("please_enter_new_email"));
266
+ const { t: h } = R(), { field: x } = gt({ control: e, name: "avatar_url" }), [N, C] = v.useState(!1), _ = v.useRef(null), w = v.useRef(0);
267
+ v.useEffect(() => {
268
+ w.current += 1, C(!1);
269
+ }, [i]);
270
+ const M = async (j) => {
271
+ const Q = j.target.files?.[0];
272
+ if (j.target.value = "", !Q || !f) return;
273
+ const I = ++w.current;
274
+ C(!0);
275
+ try {
276
+ const G = await f(Q);
277
+ G && w.current === I && x.onChange(G);
278
+ } finally {
279
+ w.current === I && C(!1);
280
+ }
281
+ }, [k, z] = v.useState(!1), [F, y] = v.useState(""), [D, P] = v.useState(void 0), X = async () => {
282
+ P(void 0);
283
+ const j = F.trim();
284
+ if (!j) {
285
+ P(h("please_enter_new_email"));
269
286
  return;
270
287
  }
271
- if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(A)) {
272
- _(f("please_enter_valid_email"));
288
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(j)) {
289
+ P(h("please_enter_valid_email"));
273
290
  return;
274
291
  }
275
- if (p && A.toLowerCase() === p.toLowerCase()) {
276
- _(f("new_email_must_be_different"));
292
+ if (g && j.toLowerCase() === g.toLowerCase()) {
293
+ P(h("new_email_must_be_different"));
277
294
  return;
278
295
  }
279
296
  try {
280
- await s?.(A), g(!1), N("");
281
- } catch (y) {
282
- _(
283
- y instanceof Error ? y.message : f("failed_to_initiate_email_change")
297
+ await a?.(j), z(!1), y("");
298
+ } catch (I) {
299
+ P(
300
+ I instanceof Error ? I.message : h("failed_to_initiate_email_change")
284
301
  );
285
302
  }
286
- }, E = () => {
287
- g(!1), N(""), _(void 0);
288
- }, I = () => {
289
- E(), l();
303
+ }, q = () => {
304
+ z(!1), y(""), P(void 0);
305
+ }, O = () => {
306
+ q(), l();
290
307
  };
291
- return /* @__PURE__ */ a.jsxs(
292
- Fe,
308
+ return /* @__PURE__ */ n.jsxs(
309
+ Le,
293
310
  {
294
311
  open: i,
295
- onOpenChange: (A) => !A && I(),
296
- title: f("edit_profile"),
312
+ onOpenChange: (j) => !j && O(),
313
+ title: h("edit_profile"),
297
314
  presentation: c,
298
315
  children: [
299
- /* @__PURE__ */ a.jsxs("div", { className: "space-y-4", children: [
300
- /* @__PURE__ */ a.jsx(
301
- W,
316
+ /* @__PURE__ */ n.jsxs("div", { className: "space-y-4", children: [
317
+ f && /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-4", children: [
318
+ /* @__PURE__ */ n.jsx("div", { className: "ring-border relative size-16 shrink-0 overflow-hidden rounded-full ring-1", children: x.value ? /* @__PURE__ */ n.jsx(
319
+ "img",
320
+ {
321
+ src: x.value,
322
+ alt: h("profile_image_alt"),
323
+ className: "h-full w-full object-cover"
324
+ }
325
+ ) : /* @__PURE__ */ n.jsx("div", { className: "bg-primary text-primary-foreground flex h-full w-full items-center justify-center text-xl font-semibold", children: (m ?? "").trim().charAt(0).toUpperCase() }) }),
326
+ /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col gap-2", children: [
327
+ /* @__PURE__ */ n.jsx(
328
+ "label",
329
+ {
330
+ htmlFor: "avatar-file-input",
331
+ className: "text-foreground text-sm font-medium",
332
+ children: h("profile_photo")
333
+ }
334
+ ),
335
+ /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
336
+ /* @__PURE__ */ n.jsxs(
337
+ E,
338
+ {
339
+ type: "button",
340
+ variant: "outline",
341
+ size: "sm",
342
+ disabled: N,
343
+ onClick: () => _.current?.click(),
344
+ children: [
345
+ N && /* @__PURE__ */ n.jsx("div", { className: "mr-2 size-3.5 animate-spin rounded-full border-2 border-current/30 border-t-current" }),
346
+ h(N ? "uploading" : "change")
347
+ ]
348
+ }
349
+ ),
350
+ x.value && !N && /* @__PURE__ */ n.jsx(
351
+ E,
352
+ {
353
+ type: "button",
354
+ variant: "ghost",
355
+ size: "sm",
356
+ onClick: () => x.onChange(""),
357
+ children: h("remove")
358
+ }
359
+ )
360
+ ] }),
361
+ /* @__PURE__ */ n.jsx(
362
+ "input",
363
+ {
364
+ ref: _,
365
+ id: "avatar-file-input",
366
+ "aria-label": h("profile_photo"),
367
+ type: "file",
368
+ accept: "image/*",
369
+ disabled: N,
370
+ className: "hidden",
371
+ onChange: (j) => {
372
+ M(j);
373
+ }
374
+ }
375
+ )
376
+ ] })
377
+ ] }),
378
+ /* @__PURE__ */ n.jsx(
379
+ ee,
302
380
  {
303
381
  control: e,
304
382
  name: "first_name",
305
- label: f("first_name"),
383
+ label: h("first_name"),
306
384
  disabled: o,
307
385
  readOnly: o,
308
386
  "aria-readonly": o || void 0,
309
387
  "aria-describedby": o ? "name-edit-disabled-hint" : void 0
310
388
  }
311
389
  ),
312
- /* @__PURE__ */ a.jsx(
313
- W,
390
+ /* @__PURE__ */ n.jsx(
391
+ ee,
314
392
  {
315
393
  control: e,
316
394
  name: "last_name",
317
- label: f("last_name"),
395
+ label: h("last_name"),
318
396
  disabled: o,
319
397
  readOnly: o,
320
398
  "aria-readonly": o || void 0,
321
399
  "aria-describedby": o ? "name-edit-disabled-hint" : void 0
322
400
  }
323
401
  ),
324
- o && /* @__PURE__ */ a.jsx(
402
+ o && /* @__PURE__ */ n.jsx(
325
403
  "p",
326
404
  {
327
405
  id: "name-edit-disabled-hint",
328
406
  className: "text-muted-foreground text-xs",
329
- children: f("name_change_disabled_hint")
407
+ children: h("name_change_disabled_hint")
330
408
  }
331
409
  ),
332
- /* @__PURE__ */ a.jsx(
333
- W,
410
+ /* @__PURE__ */ n.jsx(
411
+ ee,
334
412
  {
335
413
  control: e,
336
414
  name: "phone_number",
337
- label: f("phone_number"),
415
+ label: h("phone_number"),
338
416
  type: "tel"
339
417
  }
340
418
  ),
341
- /* @__PURE__ */ a.jsx(
342
- Mt,
419
+ /* @__PURE__ */ n.jsx(
420
+ Rt,
343
421
  {
344
422
  control: e,
345
423
  name: "bio",
346
- label: f("bio"),
424
+ label: h("bio"),
347
425
  rows: 3,
348
- placeholder: f("add_a_short_bio")
426
+ placeholder: h("add_a_short_bio")
349
427
  }
350
428
  ),
351
- /* @__PURE__ */ a.jsx(
352
- Rt,
429
+ /* @__PURE__ */ n.jsx(
430
+ Ft,
353
431
  {
354
432
  control: e,
355
433
  name: "language",
356
- label: f("language"),
434
+ label: h("language"),
357
435
  options: d,
358
- placeholder: f("select_an_option")
436
+ placeholder: h("select_an_option")
359
437
  }
360
438
  )
361
439
  ] }),
362
- p && /* @__PURE__ */ a.jsxs("div", { className: "space-y-2", children: [
363
- /* @__PURE__ */ a.jsx("label", { className: "text-foreground text-sm font-medium", children: f("email") }),
364
- m ? /* @__PURE__ */ a.jsxs("div", { className: "space-y-2", children: [
365
- /* @__PURE__ */ a.jsx(
366
- Wt,
440
+ g && /* @__PURE__ */ n.jsxs("div", { className: "space-y-2", children: [
441
+ /* @__PURE__ */ n.jsx("label", { className: "text-foreground text-sm font-medium", children: h("email") }),
442
+ k ? /* @__PURE__ */ n.jsxs("div", { className: "space-y-2", children: [
443
+ /* @__PURE__ */ n.jsx(
444
+ Xt,
367
445
  {
368
446
  type: "email",
369
- placeholder: f("enter_new_email_placeholder"),
370
- value: x,
371
- onChange: (A) => {
372
- N(A.target.value), _(void 0);
447
+ placeholder: h("enter_new_email_placeholder"),
448
+ value: F,
449
+ onChange: (j) => {
450
+ y(j.target.value), P(void 0);
373
451
  },
374
- onKeyDown: (A) => {
375
- A.key === "Enter" && (A.preventDefault(), w()), A.key === "Escape" && E();
452
+ onKeyDown: (j) => {
453
+ j.key === "Enter" && (j.preventDefault(), X()), j.key === "Escape" && q();
376
454
  },
377
- "aria-invalid": !!j || void 0,
455
+ "aria-invalid": !!D || void 0,
378
456
  autoFocus: !0
379
457
  }
380
458
  ),
381
- j && /* @__PURE__ */ a.jsx("p", { className: "text-destructive text-xs", children: j }),
382
- /* @__PURE__ */ a.jsxs("div", { className: "bg-muted flex items-start gap-2.5 rounded-md px-3 py-2.5", children: [
383
- /* @__PURE__ */ a.jsx(ve, { className: "text-primary mt-0.5 size-4 shrink-0" }),
384
- /* @__PURE__ */ a.jsx("p", { className: "text-muted-foreground text-xs", children: f("email_verification_hint") })
459
+ D && /* @__PURE__ */ n.jsx("p", { className: "text-destructive text-xs", children: D }),
460
+ /* @__PURE__ */ n.jsxs("div", { className: "bg-muted flex items-start gap-2.5 rounded-md px-3 py-2.5", children: [
461
+ /* @__PURE__ */ n.jsx(je, { className: "text-primary mt-0.5 size-4 shrink-0" }),
462
+ /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-xs", children: h("email_verification_hint") })
385
463
  ] }),
386
- /* @__PURE__ */ a.jsxs("div", { className: "flex gap-2", children: [
387
- /* @__PURE__ */ a.jsx(
388
- P,
464
+ /* @__PURE__ */ n.jsxs("div", { className: "flex gap-2", children: [
465
+ /* @__PURE__ */ n.jsx(
466
+ E,
389
467
  {
390
468
  type: "button",
391
469
  variant: "outline",
392
470
  size: "sm",
393
- onClick: E,
394
- children: f("cancel")
471
+ onClick: q,
472
+ children: h("cancel")
395
473
  }
396
474
  ),
397
- /* @__PURE__ */ a.jsxs(
398
- P,
475
+ /* @__PURE__ */ n.jsxs(
476
+ E,
399
477
  {
400
478
  type: "button",
401
479
  size: "sm",
402
- onClick: w,
403
- disabled: !x.trim() || r,
480
+ onClick: X,
481
+ disabled: !F.trim() || r,
404
482
  children: [
405
- r && /* @__PURE__ */ a.jsx("div", { className: "mr-2 size-3.5 animate-spin rounded-full border-2 border-current/30 border-t-current" }),
406
- f(r ? "sending" : "send_verification")
483
+ r && /* @__PURE__ */ n.jsx("div", { className: "mr-2 size-3.5 animate-spin rounded-full border-2 border-current/30 border-t-current" }),
484
+ h(r ? "sending" : "send_verification")
407
485
  ]
408
486
  }
409
487
  )
410
488
  ] })
411
- ] }) : n ? /* @__PURE__ */ a.jsxs("div", { className: "space-y-2", children: [
412
- /* @__PURE__ */ a.jsx("div", { className: "bg-muted text-muted-foreground min-w-0 rounded-md px-3 py-2 text-sm", children: p }),
413
- /* @__PURE__ */ a.jsxs("div", { className: "bg-muted flex items-start gap-2.5 rounded-md px-3 py-2.5", children: [
414
- /* @__PURE__ */ a.jsx(ve, { className: "text-primary mt-0.5 size-4 shrink-0" }),
415
- /* @__PURE__ */ a.jsxs("p", { className: "text-muted-foreground text-xs", children: [
416
- f("changing_email_to"),
489
+ ] }) : s ? /* @__PURE__ */ n.jsxs("div", { className: "space-y-2", children: [
490
+ /* @__PURE__ */ n.jsx("div", { className: "bg-muted text-muted-foreground min-w-0 rounded-md px-3 py-2 text-sm", children: g }),
491
+ /* @__PURE__ */ n.jsxs("div", { className: "bg-muted flex items-start gap-2.5 rounded-md px-3 py-2.5", children: [
492
+ /* @__PURE__ */ n.jsx(je, { className: "text-primary mt-0.5 size-4 shrink-0" }),
493
+ /* @__PURE__ */ n.jsxs("p", { className: "text-muted-foreground text-xs", children: [
494
+ h("changing_email_to"),
417
495
  " ",
418
- /* @__PURE__ */ a.jsx("span", { className: "text-foreground font-medium", children: n }),
496
+ /* @__PURE__ */ n.jsx("span", { className: "text-foreground font-medium", children: s }),
419
497
  ". ",
420
- f("check_new_email_verification")
498
+ h("check_new_email_verification")
421
499
  ] })
422
500
  ] })
423
- ] }) : /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
424
- /* @__PURE__ */ a.jsx("div", { className: "bg-muted text-muted-foreground min-w-0 flex-1 rounded-md px-3 py-2 text-sm", children: p }),
425
- s && /* @__PURE__ */ a.jsx(
426
- P,
501
+ ] }) : /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
502
+ /* @__PURE__ */ n.jsx("div", { className: "bg-muted text-muted-foreground min-w-0 flex-1 rounded-md px-3 py-2 text-sm", children: g }),
503
+ a && /* @__PURE__ */ n.jsx(
504
+ E,
427
505
  {
428
506
  type: "button",
429
507
  variant: "outline",
430
508
  size: "sm",
431
- onClick: () => g(!0),
509
+ onClick: () => z(!0),
432
510
  className: "shrink-0",
433
- children: f("change")
511
+ children: h("change")
434
512
  }
435
513
  )
436
514
  ] })
437
515
  ] }),
438
- u && /* @__PURE__ */ a.jsx("p", { className: "text-destructive text-sm", children: u }),
439
- /* @__PURE__ */ a.jsx(Yt, { className: "flex flex-row items-center justify-end", children: /* @__PURE__ */ a.jsx("div", { className: "flex-1 text-right", children: /* @__PURE__ */ a.jsxs(P, { type: "button", onClick: t, children: [
440
- h && /* @__PURE__ */ a.jsx("div", { className: "mr-2 size-4 animate-spin rounded-full border-2 border-current/30 border-t-current" }),
441
- f(h ? "saving" : "save_changes")
442
- ] }) }) })
516
+ u && /* @__PURE__ */ n.jsx("p", { className: "text-destructive text-sm", children: u }),
517
+ /* @__PURE__ */ n.jsx(Wt, { className: "flex flex-row items-center justify-end", children: /* @__PURE__ */ n.jsx("div", { className: "flex-1 text-right", children: /* @__PURE__ */ n.jsxs(
518
+ E,
519
+ {
520
+ type: "button",
521
+ onClick: t,
522
+ disabled: N || p,
523
+ children: [
524
+ p && /* @__PURE__ */ n.jsx("div", { className: "mr-2 size-4 animate-spin rounded-full border-2 border-current/30 border-t-current" }),
525
+ h(p ? "saving" : "save_changes")
526
+ ]
527
+ }
528
+ ) }) })
443
529
  ]
444
530
  }
445
531
  );
446
532
  }
447
- function wr(e, i) {
533
+ function Cr(e, i) {
448
534
  if (!e) return !1;
449
535
  const t = e.member_type_detail?.permissions;
450
536
  if (t) {
@@ -453,23 +539,23 @@ function wr(e, i) {
453
539
  }
454
540
  return e.member_type !== "customer";
455
541
  }
456
- function Cr(e) {
457
- return wr(e, "rep_eligible");
542
+ function Nr(e) {
543
+ return Cr(e, "rep_eligible");
458
544
  }
459
- var Nr = Object.defineProperty, G = Object.getOwnPropertySymbols, $e = Object.prototype.hasOwnProperty, qe = Object.prototype.propertyIsEnumerable, Se = (e, i, t) => i in e ? Nr(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, te = (e, i) => {
545
+ var Sr = Object.defineProperty, Z = Object.getOwnPropertySymbols, qe = Object.prototype.hasOwnProperty, Qe = Object.prototype.propertyIsEnumerable, Ee = (e, i, t) => i in e ? Sr(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, ae = (e, i) => {
460
546
  for (var t in i || (i = {}))
461
- $e.call(i, t) && Se(e, t, i[t]);
462
- if (G)
463
- for (var t of G(i))
464
- qe.call(i, t) && Se(e, t, i[t]);
547
+ qe.call(i, t) && Ee(e, t, i[t]);
548
+ if (Z)
549
+ for (var t of Z(i))
550
+ Qe.call(i, t) && Ee(e, t, i[t]);
465
551
  return e;
466
- }, re = (e, i) => {
552
+ }, ie = (e, i) => {
467
553
  var t = {};
468
554
  for (var l in e)
469
- $e.call(e, l) && i.indexOf(l) < 0 && (t[l] = e[l]);
470
- if (e != null && G)
471
- for (var l of G(e))
472
- i.indexOf(l) < 0 && qe.call(e, l) && (t[l] = e[l]);
555
+ qe.call(e, l) && i.indexOf(l) < 0 && (t[l] = e[l]);
556
+ if (e != null && Z)
557
+ for (var l of Z(e))
558
+ i.indexOf(l) < 0 && Qe.call(e, l) && (t[l] = e[l]);
473
559
  return t;
474
560
  };
475
561
  /**
@@ -477,7 +563,7 @@ var Nr = Object.defineProperty, G = Object.getOwnPropertySymbols, $e = Object.pr
477
563
  * Copyright (c) Project Nayuki.
478
564
  * SPDX-License-Identifier: MIT
479
565
  */
480
- var T;
566
+ var U;
481
567
  ((e) => {
482
568
  const i = class b {
483
569
  /*-- Constructor (low level) and fields --*/
@@ -485,25 +571,25 @@ var T;
485
571
  // error correction level, data codeword bytes, and mask number.
486
572
  // This is a low-level API that most users should not use directly.
487
573
  // A mid-level API is the encodeSegments() function.
488
- constructor(s, r, n, o) {
489
- if (this.version = s, this.errorCorrectionLevel = r, this.modules = [], this.isFunction = [], s < b.MIN_VERSION || s > b.MAX_VERSION)
574
+ constructor(a, r, s, o) {
575
+ if (this.version = a, this.errorCorrectionLevel = r, this.modules = [], this.isFunction = [], a < b.MIN_VERSION || a > b.MAX_VERSION)
490
576
  throw new RangeError("Version value out of range");
491
577
  if (o < -1 || o > 7)
492
578
  throw new RangeError("Mask value out of range");
493
- this.size = s * 4 + 17;
579
+ this.size = a * 4 + 17;
494
580
  let c = [];
495
- for (let m = 0; m < this.size; m++)
581
+ for (let f = 0; f < this.size; f++)
496
582
  c.push(!1);
497
- for (let m = 0; m < this.size; m++)
583
+ for (let f = 0; f < this.size; f++)
498
584
  this.modules.push(c.slice()), this.isFunction.push(c.slice());
499
585
  this.drawFunctionPatterns();
500
- const f = this.addEccAndInterleave(n);
501
- if (this.drawCodewords(f), o == -1) {
502
- let m = 1e9;
503
- for (let g = 0; g < 8; g++) {
504
- this.applyMask(g), this.drawFormatBits(g);
586
+ const m = this.addEccAndInterleave(s);
587
+ if (this.drawCodewords(m), o == -1) {
588
+ let f = 1e9;
589
+ for (let h = 0; h < 8; h++) {
590
+ this.applyMask(h), this.drawFormatBits(h);
505
591
  const x = this.getPenaltyScore();
506
- x < m && (o = g, m = x), this.applyMask(g);
592
+ x < f && (o = h, f = x), this.applyMask(h);
507
593
  }
508
594
  }
509
595
  d(0 <= o && o <= 7), this.mask = o, this.applyMask(o), this.drawFormatBits(o), this.isFunction = [];
@@ -514,17 +600,17 @@ var T;
514
600
  // Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
515
601
  // QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
516
602
  // ecl argument if it can be done without increasing the version.
517
- static encodeText(s, r) {
518
- const n = e.QrSegment.makeSegments(s);
519
- return b.encodeSegments(n, r);
603
+ static encodeText(a, r) {
604
+ const s = e.QrSegment.makeSegments(a);
605
+ return b.encodeSegments(s, r);
520
606
  }
521
607
  // Returns a QR Code representing the given binary data at the given error correction level.
522
608
  // This function always encodes using the binary segment mode, not any text mode. The maximum number of
523
609
  // bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
524
610
  // The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
525
- static encodeBinary(s, r) {
526
- const n = e.QrSegment.makeBytes(s);
527
- return b.encodeSegments([n], r);
611
+ static encodeBinary(a, r) {
612
+ const s = e.QrSegment.makeBytes(a);
613
+ return b.encodeSegments([s], r);
528
614
  }
529
615
  /*-- Static factory functions (mid level) --*/
530
616
  // Returns a QR Code representing the given segments with the given encoding parameters.
@@ -536,43 +622,43 @@ var T;
536
622
  // This function allows the user to create a custom sequence of segments that switches
537
623
  // between modes (such as alphanumeric and byte) to encode text in less space.
538
624
  // This is a mid-level API; the high-level API is encodeText() and encodeBinary().
539
- static encodeSegments(s, r, n = 1, o = 40, c = -1, f = !0) {
540
- if (!(b.MIN_VERSION <= n && n <= o && o <= b.MAX_VERSION) || c < -1 || c > 7)
625
+ static encodeSegments(a, r, s = 1, o = 40, c = -1, m = !0) {
626
+ if (!(b.MIN_VERSION <= s && s <= o && o <= b.MAX_VERSION) || c < -1 || c > 7)
541
627
  throw new RangeError("Invalid value");
542
- let m, g;
543
- for (m = n; ; m++) {
544
- const _ = b.getNumDataCodewords(m, r) * 8, w = h.getTotalBits(s, m);
628
+ let f, h;
629
+ for (f = s; ; f++) {
630
+ const _ = b.getNumDataCodewords(f, r) * 8, w = p.getTotalBits(a, f);
545
631
  if (w <= _) {
546
- g = w;
632
+ h = w;
547
633
  break;
548
634
  }
549
- if (m >= o)
635
+ if (f >= o)
550
636
  throw new RangeError("Data too long");
551
637
  }
552
638
  for (const _ of [b.Ecc.MEDIUM, b.Ecc.QUARTILE, b.Ecc.HIGH])
553
- f && g <= b.getNumDataCodewords(m, _) * 8 && (r = _);
639
+ m && h <= b.getNumDataCodewords(f, _) * 8 && (r = _);
554
640
  let x = [];
555
- for (const _ of s) {
556
- t(_.mode.modeBits, 4, x), t(_.numChars, _.mode.numCharCountBits(m), x);
641
+ for (const _ of a) {
642
+ t(_.mode.modeBits, 4, x), t(_.numChars, _.mode.numCharCountBits(f), x);
557
643
  for (const w of _.getData())
558
644
  x.push(w);
559
645
  }
560
- d(x.length == g);
561
- const N = b.getNumDataCodewords(m, r) * 8;
646
+ d(x.length == h);
647
+ const N = b.getNumDataCodewords(f, r) * 8;
562
648
  d(x.length <= N), t(0, Math.min(4, N - x.length), x), t(0, (8 - x.length % 8) % 8, x), d(x.length % 8 == 0);
563
649
  for (let _ = 236; x.length < N; _ ^= 253)
564
650
  t(_, 8, x);
565
- let j = [];
566
- for (; j.length * 8 < x.length; )
567
- j.push(0);
568
- return x.forEach((_, w) => j[w >>> 3] |= _ << 7 - (w & 7)), new b(m, r, j, c);
651
+ let C = [];
652
+ for (; C.length * 8 < x.length; )
653
+ C.push(0);
654
+ return x.forEach((_, w) => C[w >>> 3] |= _ << 7 - (w & 7)), new b(f, r, C, c);
569
655
  }
570
656
  /*-- Accessor methods --*/
571
657
  // Returns the color of the module (pixel) at the given coordinates, which is false
572
658
  // for light or true for dark. The top left corner has the coordinates (x=0, y=0).
573
659
  // If the given coordinates are out of bounds, then false (light) is returned.
574
- getModule(s, r) {
575
- return 0 <= s && s < this.size && 0 <= r && r < this.size && this.modules[r][s];
660
+ getModule(a, r) {
661
+ return 0 <= a && a < this.size && 0 <= r && r < this.size && this.modules[r][a];
576
662
  }
577
663
  // Modified to expose modules for easy access
578
664
  getModules() {
@@ -581,23 +667,23 @@ var T;
581
667
  /*-- Private helper methods for constructor: Drawing function modules --*/
582
668
  // Reads this object's version field, and draws and marks all function modules.
583
669
  drawFunctionPatterns() {
584
- for (let n = 0; n < this.size; n++)
585
- this.setFunctionModule(6, n, n % 2 == 0), this.setFunctionModule(n, 6, n % 2 == 0);
670
+ for (let s = 0; s < this.size; s++)
671
+ this.setFunctionModule(6, s, s % 2 == 0), this.setFunctionModule(s, 6, s % 2 == 0);
586
672
  this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
587
- const s = this.getAlignmentPatternPositions(), r = s.length;
588
- for (let n = 0; n < r; n++)
673
+ const a = this.getAlignmentPatternPositions(), r = a.length;
674
+ for (let s = 0; s < r; s++)
589
675
  for (let o = 0; o < r; o++)
590
- n == 0 && o == 0 || n == 0 && o == r - 1 || n == r - 1 && o == 0 || this.drawAlignmentPattern(s[n], s[o]);
676
+ s == 0 && o == 0 || s == 0 && o == r - 1 || s == r - 1 && o == 0 || this.drawAlignmentPattern(a[s], a[o]);
591
677
  this.drawFormatBits(0), this.drawVersion();
592
678
  }
593
679
  // Draws two copies of the format bits (with its own error correction code)
594
680
  // based on the given mask and this object's error correction level field.
595
- drawFormatBits(s) {
596
- const r = this.errorCorrectionLevel.formatBits << 3 | s;
597
- let n = r;
681
+ drawFormatBits(a) {
682
+ const r = this.errorCorrectionLevel.formatBits << 3 | a;
683
+ let s = r;
598
684
  for (let c = 0; c < 10; c++)
599
- n = n << 1 ^ (n >>> 9) * 1335;
600
- const o = (r << 10 | n) ^ 21522;
685
+ s = s << 1 ^ (s >>> 9) * 1335;
686
+ const o = (r << 10 | s) ^ 21522;
601
687
  d(o >>> 15 == 0);
602
688
  for (let c = 0; c <= 5; c++)
603
689
  this.setFunctionModule(8, c, l(o, c));
@@ -615,144 +701,144 @@ var T;
615
701
  drawVersion() {
616
702
  if (this.version < 7)
617
703
  return;
618
- let s = this.version;
619
- for (let n = 0; n < 12; n++)
620
- s = s << 1 ^ (s >>> 11) * 7973;
621
- const r = this.version << 12 | s;
704
+ let a = this.version;
705
+ for (let s = 0; s < 12; s++)
706
+ a = a << 1 ^ (a >>> 11) * 7973;
707
+ const r = this.version << 12 | a;
622
708
  d(r >>> 18 == 0);
623
- for (let n = 0; n < 18; n++) {
624
- const o = l(r, n), c = this.size - 11 + n % 3, f = Math.floor(n / 3);
625
- this.setFunctionModule(c, f, o), this.setFunctionModule(f, c, o);
709
+ for (let s = 0; s < 18; s++) {
710
+ const o = l(r, s), c = this.size - 11 + s % 3, m = Math.floor(s / 3);
711
+ this.setFunctionModule(c, m, o), this.setFunctionModule(m, c, o);
626
712
  }
627
713
  }
628
714
  // Draws a 9*9 finder pattern including the border separator,
629
715
  // with the center module at (x, y). Modules can be out of bounds.
630
- drawFinderPattern(s, r) {
631
- for (let n = -4; n <= 4; n++)
716
+ drawFinderPattern(a, r) {
717
+ for (let s = -4; s <= 4; s++)
632
718
  for (let o = -4; o <= 4; o++) {
633
- const c = Math.max(Math.abs(o), Math.abs(n)), f = s + o, m = r + n;
634
- 0 <= f && f < this.size && 0 <= m && m < this.size && this.setFunctionModule(f, m, c != 2 && c != 4);
719
+ const c = Math.max(Math.abs(o), Math.abs(s)), m = a + o, f = r + s;
720
+ 0 <= m && m < this.size && 0 <= f && f < this.size && this.setFunctionModule(m, f, c != 2 && c != 4);
635
721
  }
636
722
  }
637
723
  // Draws a 5*5 alignment pattern, with the center module
638
724
  // at (x, y). All modules must be in bounds.
639
- drawAlignmentPattern(s, r) {
640
- for (let n = -2; n <= 2; n++)
725
+ drawAlignmentPattern(a, r) {
726
+ for (let s = -2; s <= 2; s++)
641
727
  for (let o = -2; o <= 2; o++)
642
- this.setFunctionModule(s + o, r + n, Math.max(Math.abs(o), Math.abs(n)) != 1);
728
+ this.setFunctionModule(a + o, r + s, Math.max(Math.abs(o), Math.abs(s)) != 1);
643
729
  }
644
730
  // Sets the color of a module and marks it as a function module.
645
731
  // Only used by the constructor. Coordinates must be in bounds.
646
- setFunctionModule(s, r, n) {
647
- this.modules[r][s] = n, this.isFunction[r][s] = !0;
732
+ setFunctionModule(a, r, s) {
733
+ this.modules[r][a] = s, this.isFunction[r][a] = !0;
648
734
  }
649
735
  /*-- Private helper methods for constructor: Codewords and masking --*/
650
736
  // Returns a new byte string representing the given data with the appropriate error correction
651
737
  // codewords appended to it, based on this object's version and error correction level.
652
- addEccAndInterleave(s) {
653
- const r = this.version, n = this.errorCorrectionLevel;
654
- if (s.length != b.getNumDataCodewords(r, n))
738
+ addEccAndInterleave(a) {
739
+ const r = this.version, s = this.errorCorrectionLevel;
740
+ if (a.length != b.getNumDataCodewords(r, s))
655
741
  throw new RangeError("Invalid argument");
656
- const o = b.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][r], c = b.ECC_CODEWORDS_PER_BLOCK[n.ordinal][r], f = Math.floor(b.getNumRawDataModules(r) / 8), m = o - f % o, g = Math.floor(f / o);
742
+ const o = b.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][r], c = b.ECC_CODEWORDS_PER_BLOCK[s.ordinal][r], m = Math.floor(b.getNumRawDataModules(r) / 8), f = o - m % o, h = Math.floor(m / o);
657
743
  let x = [];
658
744
  const N = b.reedSolomonComputeDivisor(c);
659
745
  for (let _ = 0, w = 0; _ < o; _++) {
660
- let E = s.slice(w, w + g - c + (_ < m ? 0 : 1));
661
- w += E.length;
662
- const I = b.reedSolomonComputeRemainder(E, N);
663
- _ < m && E.push(0), x.push(E.concat(I));
746
+ let M = a.slice(w, w + h - c + (_ < f ? 0 : 1));
747
+ w += M.length;
748
+ const k = b.reedSolomonComputeRemainder(M, N);
749
+ _ < f && M.push(0), x.push(M.concat(k));
664
750
  }
665
- let j = [];
751
+ let C = [];
666
752
  for (let _ = 0; _ < x[0].length; _++)
667
- x.forEach((w, E) => {
668
- (_ != g - c || E >= m) && j.push(w[_]);
753
+ x.forEach((w, M) => {
754
+ (_ != h - c || M >= f) && C.push(w[_]);
669
755
  });
670
- return d(j.length == f), j;
756
+ return d(C.length == m), C;
671
757
  }
672
758
  // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
673
759
  // data area of this QR Code. Function modules need to be marked off before this is called.
674
- drawCodewords(s) {
675
- if (s.length != Math.floor(b.getNumRawDataModules(this.version) / 8))
760
+ drawCodewords(a) {
761
+ if (a.length != Math.floor(b.getNumRawDataModules(this.version) / 8))
676
762
  throw new RangeError("Invalid argument");
677
763
  let r = 0;
678
- for (let n = this.size - 1; n >= 1; n -= 2) {
679
- n == 6 && (n = 5);
764
+ for (let s = this.size - 1; s >= 1; s -= 2) {
765
+ s == 6 && (s = 5);
680
766
  for (let o = 0; o < this.size; o++)
681
767
  for (let c = 0; c < 2; c++) {
682
- const f = n - c, g = (n + 1 & 2) == 0 ? this.size - 1 - o : o;
683
- !this.isFunction[g][f] && r < s.length * 8 && (this.modules[g][f] = l(s[r >>> 3], 7 - (r & 7)), r++);
768
+ const m = s - c, h = (s + 1 & 2) == 0 ? this.size - 1 - o : o;
769
+ !this.isFunction[h][m] && r < a.length * 8 && (this.modules[h][m] = l(a[r >>> 3], 7 - (r & 7)), r++);
684
770
  }
685
771
  }
686
- d(r == s.length * 8);
772
+ d(r == a.length * 8);
687
773
  }
688
774
  // XORs the codeword modules in this QR Code with the given mask pattern.
689
775
  // The function modules must be marked and the codeword bits must be drawn
690
776
  // before masking. Due to the arithmetic of XOR, calling applyMask() with
691
777
  // the same mask value a second time will undo the mask. A final well-formed
692
778
  // QR Code needs exactly one (not zero, two, etc.) mask applied.
693
- applyMask(s) {
694
- if (s < 0 || s > 7)
779
+ applyMask(a) {
780
+ if (a < 0 || a > 7)
695
781
  throw new RangeError("Mask value out of range");
696
782
  for (let r = 0; r < this.size; r++)
697
- for (let n = 0; n < this.size; n++) {
783
+ for (let s = 0; s < this.size; s++) {
698
784
  let o;
699
- switch (s) {
785
+ switch (a) {
700
786
  case 0:
701
- o = (n + r) % 2 == 0;
787
+ o = (s + r) % 2 == 0;
702
788
  break;
703
789
  case 1:
704
790
  o = r % 2 == 0;
705
791
  break;
706
792
  case 2:
707
- o = n % 3 == 0;
793
+ o = s % 3 == 0;
708
794
  break;
709
795
  case 3:
710
- o = (n + r) % 3 == 0;
796
+ o = (s + r) % 3 == 0;
711
797
  break;
712
798
  case 4:
713
- o = (Math.floor(n / 3) + Math.floor(r / 2)) % 2 == 0;
799
+ o = (Math.floor(s / 3) + Math.floor(r / 2)) % 2 == 0;
714
800
  break;
715
801
  case 5:
716
- o = n * r % 2 + n * r % 3 == 0;
802
+ o = s * r % 2 + s * r % 3 == 0;
717
803
  break;
718
804
  case 6:
719
- o = (n * r % 2 + n * r % 3) % 2 == 0;
805
+ o = (s * r % 2 + s * r % 3) % 2 == 0;
720
806
  break;
721
807
  case 7:
722
- o = ((n + r) % 2 + n * r % 3) % 2 == 0;
808
+ o = ((s + r) % 2 + s * r % 3) % 2 == 0;
723
809
  break;
724
810
  default:
725
811
  throw new Error("Unreachable");
726
812
  }
727
- !this.isFunction[r][n] && o && (this.modules[r][n] = !this.modules[r][n]);
813
+ !this.isFunction[r][s] && o && (this.modules[r][s] = !this.modules[r][s]);
728
814
  }
729
815
  }
730
816
  // Calculates and returns the penalty score based on state of this QR Code's current modules.
731
817
  // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.
732
818
  getPenaltyScore() {
733
- let s = 0;
819
+ let a = 0;
734
820
  for (let c = 0; c < this.size; c++) {
735
- let f = !1, m = 0, g = [0, 0, 0, 0, 0, 0, 0];
821
+ let m = !1, f = 0, h = [0, 0, 0, 0, 0, 0, 0];
736
822
  for (let x = 0; x < this.size; x++)
737
- this.modules[c][x] == f ? (m++, m == 5 ? s += b.PENALTY_N1 : m > 5 && s++) : (this.finderPenaltyAddHistory(m, g), f || (s += this.finderPenaltyCountPatterns(g) * b.PENALTY_N3), f = this.modules[c][x], m = 1);
738
- s += this.finderPenaltyTerminateAndCount(f, m, g) * b.PENALTY_N3;
823
+ this.modules[c][x] == m ? (f++, f == 5 ? a += b.PENALTY_N1 : f > 5 && a++) : (this.finderPenaltyAddHistory(f, h), m || (a += this.finderPenaltyCountPatterns(h) * b.PENALTY_N3), m = this.modules[c][x], f = 1);
824
+ a += this.finderPenaltyTerminateAndCount(m, f, h) * b.PENALTY_N3;
739
825
  }
740
826
  for (let c = 0; c < this.size; c++) {
741
- let f = !1, m = 0, g = [0, 0, 0, 0, 0, 0, 0];
827
+ let m = !1, f = 0, h = [0, 0, 0, 0, 0, 0, 0];
742
828
  for (let x = 0; x < this.size; x++)
743
- this.modules[x][c] == f ? (m++, m == 5 ? s += b.PENALTY_N1 : m > 5 && s++) : (this.finderPenaltyAddHistory(m, g), f || (s += this.finderPenaltyCountPatterns(g) * b.PENALTY_N3), f = this.modules[x][c], m = 1);
744
- s += this.finderPenaltyTerminateAndCount(f, m, g) * b.PENALTY_N3;
829
+ this.modules[x][c] == m ? (f++, f == 5 ? a += b.PENALTY_N1 : f > 5 && a++) : (this.finderPenaltyAddHistory(f, h), m || (a += this.finderPenaltyCountPatterns(h) * b.PENALTY_N3), m = this.modules[x][c], f = 1);
830
+ a += this.finderPenaltyTerminateAndCount(m, f, h) * b.PENALTY_N3;
745
831
  }
746
832
  for (let c = 0; c < this.size - 1; c++)
747
- for (let f = 0; f < this.size - 1; f++) {
748
- const m = this.modules[c][f];
749
- m == this.modules[c][f + 1] && m == this.modules[c + 1][f] && m == this.modules[c + 1][f + 1] && (s += b.PENALTY_N2);
833
+ for (let m = 0; m < this.size - 1; m++) {
834
+ const f = this.modules[c][m];
835
+ f == this.modules[c][m + 1] && f == this.modules[c + 1][m] && f == this.modules[c + 1][m + 1] && (a += b.PENALTY_N2);
750
836
  }
751
837
  let r = 0;
752
838
  for (const c of this.modules)
753
- r = c.reduce((f, m) => f + (m ? 1 : 0), r);
754
- const n = this.size * this.size, o = Math.ceil(Math.abs(r * 20 - n * 10) / n) - 1;
755
- return d(0 <= o && o <= 9), s += o * b.PENALTY_N4, d(0 <= s && s <= 2568888), s;
839
+ r = c.reduce((m, f) => m + (f ? 1 : 0), r);
840
+ const s = this.size * this.size, o = Math.ceil(Math.abs(r * 20 - s * 10) / s) - 1;
841
+ return d(0 <= o && o <= 9), a += o * b.PENALTY_N4, d(0 <= a && a <= 2568888), a;
756
842
  }
757
843
  /*-- Private helper functions --*/
758
844
  // Returns an ascending list of positions of alignment patterns for this version number.
@@ -762,83 +848,83 @@ var T;
762
848
  if (this.version == 1)
763
849
  return [];
764
850
  {
765
- const s = Math.floor(this.version / 7) + 2, r = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (s * 2 - 2)) * 2;
766
- let n = [6];
767
- for (let o = this.size - 7; n.length < s; o -= r)
768
- n.splice(1, 0, o);
769
- return n;
851
+ const a = Math.floor(this.version / 7) + 2, r = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (a * 2 - 2)) * 2;
852
+ let s = [6];
853
+ for (let o = this.size - 7; s.length < a; o -= r)
854
+ s.splice(1, 0, o);
855
+ return s;
770
856
  }
771
857
  }
772
858
  // Returns the number of data bits that can be stored in a QR Code of the given version number, after
773
859
  // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.
774
860
  // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.
775
- static getNumRawDataModules(s) {
776
- if (s < b.MIN_VERSION || s > b.MAX_VERSION)
861
+ static getNumRawDataModules(a) {
862
+ if (a < b.MIN_VERSION || a > b.MAX_VERSION)
777
863
  throw new RangeError("Version number out of range");
778
- let r = (16 * s + 128) * s + 64;
779
- if (s >= 2) {
780
- const n = Math.floor(s / 7) + 2;
781
- r -= (25 * n - 10) * n - 55, s >= 7 && (r -= 36);
864
+ let r = (16 * a + 128) * a + 64;
865
+ if (a >= 2) {
866
+ const s = Math.floor(a / 7) + 2;
867
+ r -= (25 * s - 10) * s - 55, a >= 7 && (r -= 36);
782
868
  }
783
869
  return d(208 <= r && r <= 29648), r;
784
870
  }
785
871
  // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
786
872
  // QR Code of the given version number and error correction level, with remainder bits discarded.
787
873
  // This stateless pure function could be implemented as a (40*4)-cell lookup table.
788
- static getNumDataCodewords(s, r) {
789
- return Math.floor(b.getNumRawDataModules(s) / 8) - b.ECC_CODEWORDS_PER_BLOCK[r.ordinal][s] * b.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][s];
874
+ static getNumDataCodewords(a, r) {
875
+ return Math.floor(b.getNumRawDataModules(a) / 8) - b.ECC_CODEWORDS_PER_BLOCK[r.ordinal][a] * b.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][a];
790
876
  }
791
877
  // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
792
878
  // implemented as a lookup table over all possible parameter values, instead of as an algorithm.
793
- static reedSolomonComputeDivisor(s) {
794
- if (s < 1 || s > 255)
879
+ static reedSolomonComputeDivisor(a) {
880
+ if (a < 1 || a > 255)
795
881
  throw new RangeError("Degree out of range");
796
882
  let r = [];
797
- for (let o = 0; o < s - 1; o++)
883
+ for (let o = 0; o < a - 1; o++)
798
884
  r.push(0);
799
885
  r.push(1);
800
- let n = 1;
801
- for (let o = 0; o < s; o++) {
886
+ let s = 1;
887
+ for (let o = 0; o < a; o++) {
802
888
  for (let c = 0; c < r.length; c++)
803
- r[c] = b.reedSolomonMultiply(r[c], n), c + 1 < r.length && (r[c] ^= r[c + 1]);
804
- n = b.reedSolomonMultiply(n, 2);
889
+ r[c] = b.reedSolomonMultiply(r[c], s), c + 1 < r.length && (r[c] ^= r[c + 1]);
890
+ s = b.reedSolomonMultiply(s, 2);
805
891
  }
806
892
  return r;
807
893
  }
808
894
  // Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.
809
- static reedSolomonComputeRemainder(s, r) {
810
- let n = r.map((o) => 0);
811
- for (const o of s) {
812
- const c = o ^ n.shift();
813
- n.push(0), r.forEach((f, m) => n[m] ^= b.reedSolomonMultiply(f, c));
895
+ static reedSolomonComputeRemainder(a, r) {
896
+ let s = r.map((o) => 0);
897
+ for (const o of a) {
898
+ const c = o ^ s.shift();
899
+ s.push(0), r.forEach((m, f) => s[f] ^= b.reedSolomonMultiply(m, c));
814
900
  }
815
- return n;
901
+ return s;
816
902
  }
817
903
  // Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result
818
904
  // are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.
819
- static reedSolomonMultiply(s, r) {
820
- if (s >>> 8 || r >>> 8)
905
+ static reedSolomonMultiply(a, r) {
906
+ if (a >>> 8 || r >>> 8)
821
907
  throw new RangeError("Byte out of range");
822
- let n = 0;
908
+ let s = 0;
823
909
  for (let o = 7; o >= 0; o--)
824
- n = n << 1 ^ (n >>> 7) * 285, n ^= (r >>> o & 1) * s;
825
- return d(n >>> 8 == 0), n;
910
+ s = s << 1 ^ (s >>> 7) * 285, s ^= (r >>> o & 1) * a;
911
+ return d(s >>> 8 == 0), s;
826
912
  }
827
913
  // Can only be called immediately after a light run is added, and
828
914
  // returns either 0, 1, or 2. A helper function for getPenaltyScore().
829
- finderPenaltyCountPatterns(s) {
830
- const r = s[1];
915
+ finderPenaltyCountPatterns(a) {
916
+ const r = a[1];
831
917
  d(r <= this.size * 3);
832
- const n = r > 0 && s[2] == r && s[3] == r * 3 && s[4] == r && s[5] == r;
833
- return (n && s[0] >= r * 4 && s[6] >= r ? 1 : 0) + (n && s[6] >= r * 4 && s[0] >= r ? 1 : 0);
918
+ const s = r > 0 && a[2] == r && a[3] == r * 3 && a[4] == r && a[5] == r;
919
+ return (s && a[0] >= r * 4 && a[6] >= r ? 1 : 0) + (s && a[6] >= r * 4 && a[0] >= r ? 1 : 0);
834
920
  }
835
921
  // Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().
836
- finderPenaltyTerminateAndCount(s, r, n) {
837
- return s && (this.finderPenaltyAddHistory(r, n), r = 0), r += this.size, this.finderPenaltyAddHistory(r, n), this.finderPenaltyCountPatterns(n);
922
+ finderPenaltyTerminateAndCount(a, r, s) {
923
+ return a && (this.finderPenaltyAddHistory(r, s), r = 0), r += this.size, this.finderPenaltyAddHistory(r, s), this.finderPenaltyCountPatterns(s);
838
924
  }
839
925
  // Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().
840
- finderPenaltyAddHistory(s, r) {
841
- r[0] == 0 && (s += this.size), r.pop(), r.unshift(s);
926
+ finderPenaltyAddHistory(a, r) {
927
+ r[0] == 0 && (a += this.size), r.pop(), r.unshift(a);
842
928
  }
843
929
  };
844
930
  i.MIN_VERSION = 1, i.MAX_VERSION = 40, i.PENALTY_N1 = 3, i.PENALTY_N2 = 3, i.PENALTY_N3 = 40, i.PENALTY_N4 = 10, i.ECC_CODEWORDS_PER_BLOCK = [
@@ -864,94 +950,94 @@ var T;
864
950
  [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
865
951
  // High
866
952
  ], e.QrCode = i;
867
- function t(p, s, r) {
868
- if (s < 0 || s > 31 || p >>> s)
953
+ function t(g, a, r) {
954
+ if (a < 0 || a > 31 || g >>> a)
869
955
  throw new RangeError("Value out of range");
870
- for (let n = s - 1; n >= 0; n--)
871
- r.push(p >>> n & 1);
956
+ for (let s = a - 1; s >= 0; s--)
957
+ r.push(g >>> s & 1);
872
958
  }
873
- function l(p, s) {
874
- return (p >>> s & 1) != 0;
959
+ function l(g, a) {
960
+ return (g >>> a & 1) != 0;
875
961
  }
876
- function d(p) {
877
- if (!p)
962
+ function d(g) {
963
+ if (!g)
878
964
  throw new Error("Assertion error");
879
965
  }
880
- const u = class C {
966
+ const u = class S {
881
967
  /*-- Constructor (low level) and fields --*/
882
968
  // Creates a new QR Code segment with the given attributes and data.
883
969
  // The character count (numChars) must agree with the mode and the bit buffer length,
884
970
  // but the constraint isn't checked. The given bit buffer is cloned and stored.
885
- constructor(s, r, n) {
886
- if (this.mode = s, this.numChars = r, this.bitData = n, r < 0)
971
+ constructor(a, r, s) {
972
+ if (this.mode = a, this.numChars = r, this.bitData = s, r < 0)
887
973
  throw new RangeError("Invalid argument");
888
- this.bitData = n.slice();
974
+ this.bitData = s.slice();
889
975
  }
890
976
  /*-- Static factory functions (mid level) --*/
891
977
  // Returns a segment representing the given binary data encoded in
892
978
  // byte mode. All input byte arrays are acceptable. Any text string
893
979
  // can be converted to UTF-8 bytes and encoded as a byte mode segment.
894
- static makeBytes(s) {
980
+ static makeBytes(a) {
895
981
  let r = [];
896
- for (const n of s)
897
- t(n, 8, r);
898
- return new C(C.Mode.BYTE, s.length, r);
982
+ for (const s of a)
983
+ t(s, 8, r);
984
+ return new S(S.Mode.BYTE, a.length, r);
899
985
  }
900
986
  // Returns a segment representing the given string of decimal digits encoded in numeric mode.
901
- static makeNumeric(s) {
902
- if (!C.isNumeric(s))
987
+ static makeNumeric(a) {
988
+ if (!S.isNumeric(a))
903
989
  throw new RangeError("String contains non-numeric characters");
904
990
  let r = [];
905
- for (let n = 0; n < s.length; ) {
906
- const o = Math.min(s.length - n, 3);
907
- t(parseInt(s.substring(n, n + o), 10), o * 3 + 1, r), n += o;
991
+ for (let s = 0; s < a.length; ) {
992
+ const o = Math.min(a.length - s, 3);
993
+ t(parseInt(a.substring(s, s + o), 10), o * 3 + 1, r), s += o;
908
994
  }
909
- return new C(C.Mode.NUMERIC, s.length, r);
995
+ return new S(S.Mode.NUMERIC, a.length, r);
910
996
  }
911
997
  // Returns a segment representing the given text string encoded in alphanumeric mode.
912
998
  // The characters allowed are: 0 to 9, A to Z (uppercase only), space,
913
999
  // dollar, percent, asterisk, plus, hyphen, period, slash, colon.
914
- static makeAlphanumeric(s) {
915
- if (!C.isAlphanumeric(s))
1000
+ static makeAlphanumeric(a) {
1001
+ if (!S.isAlphanumeric(a))
916
1002
  throw new RangeError("String contains unencodable characters in alphanumeric mode");
917
- let r = [], n;
918
- for (n = 0; n + 2 <= s.length; n += 2) {
919
- let o = C.ALPHANUMERIC_CHARSET.indexOf(s.charAt(n)) * 45;
920
- o += C.ALPHANUMERIC_CHARSET.indexOf(s.charAt(n + 1)), t(o, 11, r);
1003
+ let r = [], s;
1004
+ for (s = 0; s + 2 <= a.length; s += 2) {
1005
+ let o = S.ALPHANUMERIC_CHARSET.indexOf(a.charAt(s)) * 45;
1006
+ o += S.ALPHANUMERIC_CHARSET.indexOf(a.charAt(s + 1)), t(o, 11, r);
921
1007
  }
922
- return n < s.length && t(C.ALPHANUMERIC_CHARSET.indexOf(s.charAt(n)), 6, r), new C(C.Mode.ALPHANUMERIC, s.length, r);
1008
+ return s < a.length && t(S.ALPHANUMERIC_CHARSET.indexOf(a.charAt(s)), 6, r), new S(S.Mode.ALPHANUMERIC, a.length, r);
923
1009
  }
924
1010
  // Returns a new mutable list of zero or more segments to represent the given Unicode text string.
925
1011
  // The result may use various segment modes and switch modes to optimize the length of the bit stream.
926
- static makeSegments(s) {
927
- return s == "" ? [] : C.isNumeric(s) ? [C.makeNumeric(s)] : C.isAlphanumeric(s) ? [C.makeAlphanumeric(s)] : [C.makeBytes(C.toUtf8ByteArray(s))];
1012
+ static makeSegments(a) {
1013
+ return a == "" ? [] : S.isNumeric(a) ? [S.makeNumeric(a)] : S.isAlphanumeric(a) ? [S.makeAlphanumeric(a)] : [S.makeBytes(S.toUtf8ByteArray(a))];
928
1014
  }
929
1015
  // Returns a segment representing an Extended Channel Interpretation
930
1016
  // (ECI) designator with the given assignment value.
931
- static makeEci(s) {
1017
+ static makeEci(a) {
932
1018
  let r = [];
933
- if (s < 0)
1019
+ if (a < 0)
934
1020
  throw new RangeError("ECI assignment value out of range");
935
- if (s < 128)
936
- t(s, 8, r);
937
- else if (s < 16384)
938
- t(2, 2, r), t(s, 14, r);
939
- else if (s < 1e6)
940
- t(6, 3, r), t(s, 21, r);
1021
+ if (a < 128)
1022
+ t(a, 8, r);
1023
+ else if (a < 16384)
1024
+ t(2, 2, r), t(a, 14, r);
1025
+ else if (a < 1e6)
1026
+ t(6, 3, r), t(a, 21, r);
941
1027
  else
942
1028
  throw new RangeError("ECI assignment value out of range");
943
- return new C(C.Mode.ECI, 0, r);
1029
+ return new S(S.Mode.ECI, 0, r);
944
1030
  }
945
1031
  // Tests whether the given string can be encoded as a segment in numeric mode.
946
1032
  // A string is encodable iff each character is in the range 0 to 9.
947
- static isNumeric(s) {
948
- return C.NUMERIC_REGEX.test(s);
1033
+ static isNumeric(a) {
1034
+ return S.NUMERIC_REGEX.test(a);
949
1035
  }
950
1036
  // Tests whether the given string can be encoded as a segment in alphanumeric mode.
951
1037
  // A string is encodable iff each character is in the following set: 0 to 9, A to Z
952
1038
  // (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
953
- static isAlphanumeric(s) {
954
- return C.ALPHANUMERIC_REGEX.test(s);
1039
+ static isAlphanumeric(a) {
1040
+ return S.ALPHANUMERIC_REGEX.test(a);
955
1041
  }
956
1042
  /*-- Methods --*/
957
1043
  // Returns a new copy of the data bits of this segment.
@@ -960,29 +1046,29 @@ var T;
960
1046
  }
961
1047
  // (Package-private) Calculates and returns the number of bits needed to encode the given segments at
962
1048
  // the given version. The result is infinity if a segment has too many characters to fit its length field.
963
- static getTotalBits(s, r) {
964
- let n = 0;
965
- for (const o of s) {
1049
+ static getTotalBits(a, r) {
1050
+ let s = 0;
1051
+ for (const o of a) {
966
1052
  const c = o.mode.numCharCountBits(r);
967
1053
  if (o.numChars >= 1 << c)
968
1054
  return 1 / 0;
969
- n += 4 + c + o.bitData.length;
1055
+ s += 4 + c + o.bitData.length;
970
1056
  }
971
- return n;
1057
+ return s;
972
1058
  }
973
1059
  // Returns a new array of bytes representing the given string encoded in UTF-8.
974
- static toUtf8ByteArray(s) {
975
- s = encodeURI(s);
1060
+ static toUtf8ByteArray(a) {
1061
+ a = encodeURI(a);
976
1062
  let r = [];
977
- for (let n = 0; n < s.length; n++)
978
- s.charAt(n) != "%" ? r.push(s.charCodeAt(n)) : (r.push(parseInt(s.substring(n + 1, n + 3), 16)), n += 2);
1063
+ for (let s = 0; s < a.length; s++)
1064
+ a.charAt(s) != "%" ? r.push(a.charCodeAt(s)) : (r.push(parseInt(a.substring(s + 1, s + 3), 16)), s += 2);
979
1065
  return r;
980
1066
  }
981
1067
  };
982
1068
  u.NUMERIC_REGEX = /^[0-9]*$/, u.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, u.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
983
- let h = u;
1069
+ let p = u;
984
1070
  e.QrSegment = u;
985
- })(T || (T = {}));
1071
+ })(U || (U = {}));
986
1072
  ((e) => {
987
1073
  ((i) => {
988
1074
  const t = class {
@@ -994,7 +1080,7 @@ var T;
994
1080
  };
995
1081
  t.LOW = new t(0, 1), t.MEDIUM = new t(1, 0), t.QUARTILE = new t(2, 3), t.HIGH = new t(3, 2), i.Ecc = t;
996
1082
  })(e.QrCode || (e.QrCode = {}));
997
- })(T || (T = {}));
1083
+ })(U || (U = {}));
998
1084
  ((e) => {
999
1085
  ((i) => {
1000
1086
  const t = class {
@@ -1011,125 +1097,125 @@ var T;
1011
1097
  };
1012
1098
  t.NUMERIC = new t(1, [10, 12, 14]), t.ALPHANUMERIC = new t(2, [9, 11, 13]), t.BYTE = new t(4, [8, 16, 16]), t.KANJI = new t(8, [8, 10, 12]), t.ECI = new t(7, [0, 0, 0]), i.Mode = t;
1013
1099
  })(e.QrSegment || (e.QrSegment = {}));
1014
- })(T || (T = {}));
1015
- var U = T;
1100
+ })(U || (U = {}));
1101
+ var V = U;
1016
1102
  /**
1017
1103
  * @license qrcode.react
1018
1104
  * Copyright (c) Paul O'Shannessy
1019
1105
  * SPDX-License-Identifier: ISC
1020
1106
  */
1021
- var Sr = {
1022
- L: U.QrCode.Ecc.LOW,
1023
- M: U.QrCode.Ecc.MEDIUM,
1024
- Q: U.QrCode.Ecc.QUARTILE,
1025
- H: U.QrCode.Ecc.HIGH
1026
- }, Qe = 128, Ve = "L", He = "#FFFFFF", Ke = "#000000", Ge = !1, Ye = 1, Er = 4, Pr = 0, Ar = 0.1;
1027
- function We(e, i = 0) {
1107
+ var Er = {
1108
+ L: V.QrCode.Ecc.LOW,
1109
+ M: V.QrCode.Ecc.MEDIUM,
1110
+ Q: V.QrCode.Ecc.QUARTILE,
1111
+ H: V.QrCode.Ecc.HIGH
1112
+ }, Ve = 128, He = "L", Ke = "#FFFFFF", Ge = "#000000", Ye = !1, We = 1, Pr = 4, Ar = 0, Mr = 0.1;
1113
+ function Xe(e, i = 0) {
1028
1114
  const t = [];
1029
1115
  return e.forEach(function(l, d) {
1030
1116
  let u = null;
1031
- l.forEach(function(h, p) {
1032
- if (!h && u !== null) {
1117
+ l.forEach(function(p, g) {
1118
+ if (!p && u !== null) {
1033
1119
  t.push(
1034
- `M${u + i} ${d + i}h${p - u}v1H${u + i}z`
1120
+ `M${u + i} ${d + i}h${g - u}v1H${u + i}z`
1035
1121
  ), u = null;
1036
1122
  return;
1037
1123
  }
1038
- if (p === l.length - 1) {
1039
- if (!h)
1124
+ if (g === l.length - 1) {
1125
+ if (!p)
1040
1126
  return;
1041
- u === null ? t.push(`M${p + i},${d + i} h1v1H${p + i}z`) : t.push(
1042
- `M${u + i},${d + i} h${p + 1 - u}v1H${u + i}z`
1127
+ u === null ? t.push(`M${g + i},${d + i} h1v1H${g + i}z`) : t.push(
1128
+ `M${u + i},${d + i} h${g + 1 - u}v1H${u + i}z`
1043
1129
  );
1044
1130
  return;
1045
1131
  }
1046
- h && u === null && (u = p);
1132
+ p && u === null && (u = g);
1047
1133
  });
1048
1134
  }), t.join("");
1049
1135
  }
1050
- function Xe(e, i) {
1136
+ function Ze(e, i) {
1051
1137
  return e.slice().map((t, l) => l < i.y || l >= i.y + i.h ? t : t.map((d, u) => u < i.x || u >= i.x + i.w ? d : !1));
1052
1138
  }
1053
- function Mr(e, i, t, l) {
1139
+ function Rr(e, i, t, l) {
1054
1140
  if (l == null)
1055
1141
  return null;
1056
- const d = e.length + t * 2, u = Math.floor(i * Ar), h = d / i, p = (l.width || u) * h, s = (l.height || u) * h, r = l.x == null ? e.length / 2 - p / 2 : l.x * h, n = l.y == null ? e.length / 2 - s / 2 : l.y * h, o = l.opacity == null ? 1 : l.opacity;
1142
+ const d = e.length + t * 2, u = Math.floor(i * Mr), p = d / i, g = (l.width || u) * p, a = (l.height || u) * p, r = l.x == null ? e.length / 2 - g / 2 : l.x * p, s = l.y == null ? e.length / 2 - a / 2 : l.y * p, o = l.opacity == null ? 1 : l.opacity;
1057
1143
  let c = null;
1058
1144
  if (l.excavate) {
1059
- let m = Math.floor(r), g = Math.floor(n), x = Math.ceil(p + r - m), N = Math.ceil(s + n - g);
1060
- c = { x: m, y: g, w: x, h: N };
1145
+ let f = Math.floor(r), h = Math.floor(s), x = Math.ceil(g + r - f), N = Math.ceil(a + s - h);
1146
+ c = { x: f, y: h, w: x, h: N };
1061
1147
  }
1062
- const f = l.crossOrigin;
1063
- return { x: r, y: n, h: s, w: p, excavation: c, opacity: o, crossOrigin: f };
1148
+ const m = l.crossOrigin;
1149
+ return { x: r, y: s, h: a, w: g, excavation: c, opacity: o, crossOrigin: m };
1064
1150
  }
1065
- function Rr(e, i) {
1066
- return i != null ? Math.max(Math.floor(i), 0) : e ? Er : Pr;
1151
+ function Fr(e, i) {
1152
+ return i != null ? Math.max(Math.floor(i), 0) : e ? Pr : Ar;
1067
1153
  }
1068
- function Ze({
1154
+ function Je({
1069
1155
  value: e,
1070
1156
  level: i,
1071
1157
  minVersion: t,
1072
1158
  includeMargin: l,
1073
1159
  marginSize: d,
1074
1160
  imageSettings: u,
1075
- size: h,
1076
- boostLevel: p
1161
+ size: p,
1162
+ boostLevel: g
1077
1163
  }) {
1078
- let s = S.useMemo(() => {
1079
- const m = (Array.isArray(e) ? e : [e]).reduce((g, x) => (g.push(...U.QrSegment.makeSegments(x)), g), []);
1080
- return U.QrCode.encodeSegments(
1081
- m,
1082
- Sr[i],
1164
+ let a = A.useMemo(() => {
1165
+ const f = (Array.isArray(e) ? e : [e]).reduce((h, x) => (h.push(...V.QrSegment.makeSegments(x)), h), []);
1166
+ return V.QrCode.encodeSegments(
1167
+ f,
1168
+ Er[i],
1083
1169
  t,
1084
1170
  void 0,
1085
1171
  void 0,
1086
- p
1172
+ g
1087
1173
  );
1088
- }, [e, i, t, p]);
1089
- const { cells: r, margin: n, numCells: o, calculatedImageSettings: c } = S.useMemo(() => {
1090
- let f = s.getModules();
1091
- const m = Rr(l, d), g = f.length + m * 2, x = Mr(
1092
- f,
1093
- h,
1174
+ }, [e, i, t, g]);
1175
+ const { cells: r, margin: s, numCells: o, calculatedImageSettings: c } = A.useMemo(() => {
1176
+ let m = a.getModules();
1177
+ const f = Fr(l, d), h = m.length + f * 2, x = Rr(
1094
1178
  m,
1179
+ p,
1180
+ f,
1095
1181
  u
1096
1182
  );
1097
1183
  return {
1098
- cells: f,
1099
- margin: m,
1100
- numCells: g,
1184
+ cells: m,
1185
+ margin: f,
1186
+ numCells: h,
1101
1187
  calculatedImageSettings: x
1102
1188
  };
1103
- }, [s, h, u, l, d]);
1189
+ }, [a, p, u, l, d]);
1104
1190
  return {
1105
- qrcode: s,
1106
- margin: n,
1191
+ qrcode: a,
1192
+ margin: s,
1107
1193
  cells: r,
1108
1194
  numCells: o,
1109
1195
  calculatedImageSettings: c
1110
1196
  };
1111
1197
  }
1112
- var Lr = (function() {
1198
+ var Ir = (function() {
1113
1199
  try {
1114
1200
  new Path2D().addPath(new Path2D());
1115
1201
  } catch {
1116
1202
  return !1;
1117
1203
  }
1118
1204
  return !0;
1119
- })(), Fr = S.forwardRef(
1205
+ })(), Lr = A.forwardRef(
1120
1206
  function(i, t) {
1121
1207
  const l = i, {
1122
1208
  value: d,
1123
- size: u = Qe,
1124
- level: h = Ve,
1125
- bgColor: p = He,
1126
- fgColor: s = Ke,
1127
- includeMargin: r = Ge,
1128
- minVersion: n = Ye,
1209
+ size: u = Ve,
1210
+ level: p = He,
1211
+ bgColor: g = Ke,
1212
+ fgColor: a = Ge,
1213
+ includeMargin: r = Ye,
1214
+ minVersion: s = We,
1129
1215
  boostLevel: o,
1130
1216
  marginSize: c,
1131
- imageSettings: f
1132
- } = l, g = re(l, [
1217
+ imageSettings: m
1218
+ } = l, h = ie(l, [
1133
1219
  "value",
1134
1220
  "size",
1135
1221
  "level",
@@ -1140,92 +1226,92 @@ var Lr = (function() {
1140
1226
  "boostLevel",
1141
1227
  "marginSize",
1142
1228
  "imageSettings"
1143
- ]), { style: x } = g, N = re(g, ["style"]), j = f?.src, _ = S.useRef(null), w = S.useRef(null), E = S.useCallback(
1144
- (z) => {
1145
- _.current = z, typeof t == "function" ? t(z) : t && (t.current = z);
1229
+ ]), { style: x } = h, N = ie(h, ["style"]), C = m?.src, _ = A.useRef(null), w = A.useRef(null), M = A.useCallback(
1230
+ (O) => {
1231
+ _.current = O, typeof t == "function" ? t(O) : t && (t.current = O);
1146
1232
  },
1147
1233
  [t]
1148
- ), [I, A] = S.useState(!1), { margin: L, cells: y, numCells: Q, calculatedImageSettings: R } = Ze({
1234
+ ), [k, z] = A.useState(!1), { margin: F, cells: y, numCells: D, calculatedImageSettings: P } = Je({
1149
1235
  value: d,
1150
- level: h,
1151
- minVersion: n,
1236
+ level: p,
1237
+ minVersion: s,
1152
1238
  boostLevel: o,
1153
1239
  includeMargin: r,
1154
1240
  marginSize: c,
1155
- imageSettings: f,
1241
+ imageSettings: m,
1156
1242
  size: u
1157
1243
  });
1158
- S.useEffect(() => {
1244
+ A.useEffect(() => {
1159
1245
  if (_.current != null) {
1160
- const z = _.current, k = z.getContext("2d");
1161
- if (!k)
1246
+ const O = _.current, j = O.getContext("2d");
1247
+ if (!j)
1162
1248
  return;
1163
- let xe = y;
1164
- const V = w.current, _e = R != null && V !== null && V.complete && V.naturalHeight !== 0 && V.naturalWidth !== 0;
1165
- _e && R.excavation != null && (xe = Xe(
1249
+ let Q = y;
1250
+ const I = w.current, G = P != null && I !== null && I.complete && I.naturalHeight !== 0 && I.naturalWidth !== 0;
1251
+ G && P.excavation != null && (Q = Ze(
1166
1252
  y,
1167
- R.excavation
1253
+ P.excavation
1168
1254
  ));
1169
- const be = window.devicePixelRatio || 1;
1170
- z.height = z.width = u * be;
1171
- const ye = u / Q * be;
1172
- k.scale(ye, ye), k.fillStyle = p, k.fillRect(0, 0, Q, Q), k.fillStyle = s, Lr ? k.fill(new Path2D(We(xe, L))) : y.forEach(function(ct, dt) {
1255
+ const ve = window.devicePixelRatio || 1;
1256
+ O.height = O.width = u * ve;
1257
+ const ye = u / D * ve;
1258
+ j.scale(ye, ye), j.fillStyle = g, j.fillRect(0, 0, D, D), j.fillStyle = a, Ir ? j.fill(new Path2D(Xe(Q, F))) : y.forEach(function(ct, dt) {
1173
1259
  ct.forEach(function(ut, ft) {
1174
- ut && k.fillRect(ft + L, dt + L, 1, 1);
1260
+ ut && j.fillRect(ft + F, dt + F, 1, 1);
1175
1261
  });
1176
- }), R && (k.globalAlpha = R.opacity), _e && k.drawImage(
1177
- V,
1178
- R.x + L,
1179
- R.y + L,
1180
- R.w,
1181
- R.h
1262
+ }), P && (j.globalAlpha = P.opacity), G && j.drawImage(
1263
+ I,
1264
+ P.x + F,
1265
+ P.y + F,
1266
+ P.w,
1267
+ P.h
1182
1268
  );
1183
1269
  }
1184
- }), S.useEffect(() => {
1185
- A(!1);
1186
- }, [j]);
1187
- const lt = te({ height: u, width: u }, x);
1188
- let ge = null;
1189
- return j != null && (ge = /* @__PURE__ */ S.createElement(
1270
+ }), A.useEffect(() => {
1271
+ z(!1);
1272
+ }, [C]);
1273
+ const X = ae({ height: u, width: u }, x);
1274
+ let q = null;
1275
+ return C != null && (q = /* @__PURE__ */ A.createElement(
1190
1276
  "img",
1191
1277
  {
1192
- src: j,
1193
- key: j,
1278
+ src: C,
1279
+ key: C,
1194
1280
  style: { display: "none" },
1195
1281
  onLoad: () => {
1196
- A(!0);
1282
+ z(!0);
1197
1283
  },
1198
1284
  ref: w,
1199
- crossOrigin: R?.crossOrigin
1285
+ crossOrigin: P?.crossOrigin
1200
1286
  }
1201
- )), /* @__PURE__ */ S.createElement(S.Fragment, null, /* @__PURE__ */ S.createElement(
1287
+ )), /* @__PURE__ */ A.createElement(A.Fragment, null, /* @__PURE__ */ A.createElement(
1202
1288
  "canvas",
1203
- te({
1204
- style: lt,
1289
+ ae({
1290
+ style: X,
1205
1291
  height: u,
1206
1292
  width: u,
1207
- ref: E,
1293
+ ref: M,
1208
1294
  role: "img"
1209
1295
  }, N)
1210
- ), ge);
1296
+ ), q);
1211
1297
  }
1212
1298
  );
1213
- Fr.displayName = "QRCodeCanvas";
1214
- var Je = S.forwardRef(
1299
+ Lr.displayName = "QRCodeCanvas";
1300
+ var et = A.forwardRef(
1215
1301
  function(i, t) {
1216
1302
  const l = i, {
1217
1303
  value: d,
1218
- size: u = Qe,
1219
- level: h = Ve,
1220
- bgColor: p = He,
1221
- fgColor: s = Ke,
1222
- includeMargin: r = Ge,
1223
- minVersion: n = Ye,
1304
+ size: u = Ve,
1305
+ level: p = He,
1306
+ bgColor: g = Ke,
1307
+ fgColor: a = Ge,
1308
+ includeMargin: r = Ye,
1309
+ minVersion: s = We,
1224
1310
  boostLevel: o,
1225
1311
  title: c,
1226
- marginSize: f,
1227
- imageSettings: m
1228
- } = l, g = re(l, [
1312
+ marginSize: m,
1313
+ imageSettings: f
1314
+ } = l, h = ie(l, [
1229
1315
  "value",
1230
1316
  "size",
1231
1317
  "level",
@@ -1237,24 +1323,24 @@ var Je = S.forwardRef(
1237
1323
  "title",
1238
1324
  "marginSize",
1239
1325
  "imageSettings"
1240
- ]), { margin: x, cells: N, numCells: j, calculatedImageSettings: _ } = Ze({
1326
+ ]), { margin: x, cells: N, numCells: C, calculatedImageSettings: _ } = Je({
1241
1327
  value: d,
1242
- level: h,
1243
- minVersion: n,
1328
+ level: p,
1329
+ minVersion: s,
1244
1330
  boostLevel: o,
1245
1331
  includeMargin: r,
1246
- marginSize: f,
1247
- imageSettings: m,
1332
+ marginSize: m,
1333
+ imageSettings: f,
1248
1334
  size: u
1249
1335
  });
1250
- let w = N, E = null;
1251
- m != null && _ != null && (_.excavation != null && (w = Xe(
1336
+ let w = N, M = null;
1337
+ f != null && _ != null && (_.excavation != null && (w = Ze(
1252
1338
  N,
1253
1339
  _.excavation
1254
- )), E = /* @__PURE__ */ S.createElement(
1340
+ )), M = /* @__PURE__ */ A.createElement(
1255
1341
  "image",
1256
1342
  {
1257
- href: m.src,
1343
+ href: f.src,
1258
1344
  height: _.h,
1259
1345
  width: _.w,
1260
1346
  x: _.x + x,
@@ -1264,35 +1350,35 @@ var Je = S.forwardRef(
1264
1350
  crossOrigin: _.crossOrigin
1265
1351
  }
1266
1352
  ));
1267
- const I = We(w, x);
1268
- return /* @__PURE__ */ S.createElement(
1353
+ const k = Xe(w, x);
1354
+ return /* @__PURE__ */ A.createElement(
1269
1355
  "svg",
1270
- te({
1356
+ ae({
1271
1357
  height: u,
1272
1358
  width: u,
1273
- viewBox: `0 0 ${j} ${j}`,
1359
+ viewBox: `0 0 ${C} ${C}`,
1274
1360
  ref: t,
1275
1361
  role: "img"
1276
- }, g),
1277
- !!c && /* @__PURE__ */ S.createElement("title", null, c),
1278
- /* @__PURE__ */ S.createElement(
1362
+ }, h),
1363
+ !!c && /* @__PURE__ */ A.createElement("title", null, c),
1364
+ /* @__PURE__ */ A.createElement(
1279
1365
  "path",
1280
1366
  {
1281
- fill: p,
1282
- d: `M0,0 h${j}v${j}H0z`,
1367
+ fill: g,
1368
+ d: `M0,0 h${C}v${C}H0z`,
1283
1369
  shapeRendering: "crispEdges"
1284
1370
  }
1285
1371
  ),
1286
- /* @__PURE__ */ S.createElement("path", { fill: s, d: I, shapeRendering: "crispEdges" }),
1287
- E
1372
+ /* @__PURE__ */ A.createElement("path", { fill: a, d: k, shapeRendering: "crispEdges" }),
1373
+ M
1288
1374
  );
1289
1375
  }
1290
1376
  );
1291
- Je.displayName = "QRCodeSVG";
1292
- function Ir(e, i) {
1293
- oe({ title: e, type: i });
1377
+ et.displayName = "QRCodeSVG";
1378
+ function kr(e, i) {
1379
+ ue({ title: e, type: i });
1294
1380
  }
1295
- function kr({
1381
+ function Dr({
1296
1382
  onToast: e,
1297
1383
  /* eslint-disable @typescript-eslint/no-unused-vars -- destructured to exclude from divProps spread */
1298
1384
  background: i,
@@ -1301,41 +1387,41 @@ function kr({
1301
1387
  padding: d,
1302
1388
  borderRadius: u,
1303
1389
  /* eslint-enable @typescript-eslint/no-unused-vars */
1304
- ...h
1390
+ ...p
1305
1391
  }) {
1306
- const { currentSlug: p } = ie(), s = e ?? Ir, r = p.split("/")[1], n = r !== void 0, { data: o } = Pe(), c = o?.id, f = o === void 0;
1307
- return /* @__PURE__ */ a.jsx("div", { ...h, children: /* @__PURE__ */ a.jsx(Lt, { children: /* @__PURE__ */ a.jsx(Ft, { children: /* @__PURE__ */ a.jsx(It, { children: n ? /* @__PURE__ */ a.jsx(
1308
- kt,
1392
+ const { currentSlug: g } = de(), a = e ?? kr, r = g.split("/")[1], s = r !== void 0, { data: o } = Ae(), c = o?.id, m = o === void 0;
1393
+ return /* @__PURE__ */ n.jsx("div", { ...p, children: /* @__PURE__ */ n.jsx(It, { children: /* @__PURE__ */ n.jsx(Lt, { children: /* @__PURE__ */ n.jsx(kt, { children: s ? /* @__PURE__ */ n.jsx(
1394
+ Dt,
1309
1395
  {
1310
1396
  token: r,
1311
- onToast: s
1397
+ onToast: a
1312
1398
  }
1313
- ) : /* @__PURE__ */ a.jsx(
1314
- Dt,
1399
+ ) : /* @__PURE__ */ n.jsx(
1400
+ Ot,
1315
1401
  {
1316
1402
  customerId: c,
1317
- isLoadingCustomer: f,
1318
- onToast: s
1403
+ isLoadingCustomer: m,
1404
+ onToast: a
1319
1405
  }
1320
1406
  ) }) }) }) });
1321
1407
  }
1322
- const ne = "profile/", Dr = /* @__PURE__ */ new Set(["orders", "subscriptions"]);
1323
- function Ee(e) {
1324
- return e.startsWith(ne) ? e.slice(ne.length) : e;
1408
+ const oe = "profile/", Or = /* @__PURE__ */ new Set(["orders", "subscriptions"]);
1409
+ function Pe(e) {
1410
+ return e.startsWith(oe) ? e.slice(oe.length) : e;
1325
1411
  }
1326
- function Or({
1412
+ function zr({
1327
1413
  children: e
1328
1414
  }) {
1329
- const { currentSlug: i, previousSlug: t, navigate: l } = ie();
1415
+ const { currentSlug: i, previousSlug: t, navigate: l } = de();
1330
1416
  function d(u) {
1331
- const h = u.split("/")[0] ?? "";
1332
- l(Dr.has(h) ? `${ne}${u}` : u);
1417
+ const p = u.split("/")[0] ?? "";
1418
+ l(Or.has(p) ? `${oe}${u}` : u);
1333
1419
  }
1334
- return /* @__PURE__ */ a.jsx(
1335
- gt,
1420
+ return /* @__PURE__ */ n.jsx(
1421
+ xt,
1336
1422
  {
1337
- currentSlug: Ee(i),
1338
- previousSlug: t === null ? null : Ee(t),
1423
+ currentSlug: Pe(i),
1424
+ previousSlug: t === null ? null : Pe(t),
1339
1425
  navItems: [],
1340
1426
  basePath: "/profile",
1341
1427
  navigate: d,
@@ -1343,10 +1429,10 @@ function Or({
1343
1429
  }
1344
1430
  );
1345
1431
  }
1346
- function et() {
1347
- const e = Nt();
1348
- return B({
1349
- queryKey: _t.languages(),
1432
+ function tt() {
1433
+ const e = St();
1434
+ return $({
1435
+ queryKey: bt.languages(),
1350
1436
  queryFn: async () => {
1351
1437
  const i = [];
1352
1438
  let t;
@@ -1364,26 +1450,26 @@ function et() {
1364
1450
  }
1365
1451
  });
1366
1452
  }
1367
- function tt() {
1368
- const e = xt(), i = $(), { setLocale: t } = D();
1369
- return q({
1453
+ function rt() {
1454
+ const e = _t(), i = H(), { setLocale: t } = T();
1455
+ return K({
1370
1456
  mutationFn: (l) => e.updateAccount({ account: l }),
1371
1457
  onSuccess: (l, d) => {
1372
- i.setQueryData(bt.detail(), l.account), d.language_iso && l.account.language_iso && t(l.account.language_iso);
1458
+ i.setQueryData(vt.detail(), l.account), d.language_iso && l.account.language_iso && t(l.account.language_iso);
1373
1459
  }
1374
1460
  });
1375
1461
  }
1376
- function zr({
1462
+ function Tr({
1377
1463
  account: e,
1378
1464
  onClose: i
1379
1465
  }) {
1380
- const { t } = M(), { isMobile: l } = K(), d = ce(), u = et(), h = tt(), p = d.data?.allow_name_edit === !1, s = Gt(
1381
- ee({
1382
- first_name: p ? F() : F().min(1, t("first_name_is_required")),
1383
- last_name: p ? F() : F().min(1, t("last_name_is_required")),
1384
- phone_number: F().optional(),
1385
- bio: F().optional(),
1386
- language: F()
1466
+ const { t } = R(), { isMobile: l } = W(), d = me(), u = tt(), p = rt(), g = d.data?.allow_name_edit === !1, a = Yt(
1467
+ se({
1468
+ first_name: g ? L() : L().min(1, t("first_name_is_required")),
1469
+ last_name: g ? L() : L().min(1, t("last_name_is_required")),
1470
+ phone_number: L().optional(),
1471
+ bio: L().optional(),
1472
+ language: L()
1387
1473
  }),
1388
1474
  {
1389
1475
  defaultValues: {
@@ -1394,62 +1480,62 @@ function zr({
1394
1480
  language: e.language_iso ?? ""
1395
1481
  }
1396
1482
  }
1397
- ), r = s.handleSubmit(async (n) => {
1398
- if (!h.isPending)
1483
+ ), r = a.handleSubmit(async (s) => {
1484
+ if (!p.isPending)
1399
1485
  try {
1400
1486
  const o = await d.refetch({ throwOnError: !0 });
1401
- await h.mutateAsync({
1402
- ...o.data?.allow_name_edit !== !1 ? { first_name: n.first_name, last_name: n.last_name } : {},
1403
- phone: n.phone_number ?? "",
1404
- bio: n.bio ?? "",
1405
- ...n.language ? { language_iso: n.language } : {}
1406
- }), oe({ title: t("profile_updated"), type: "success" }), i();
1487
+ await p.mutateAsync({
1488
+ ...o.data?.allow_name_edit !== !1 ? { first_name: s.first_name, last_name: s.last_name } : {},
1489
+ phone: s.phone_number ?? "",
1490
+ bio: s.bio ?? "",
1491
+ ...s.language ? { language_iso: s.language } : {}
1492
+ }), ue({ title: t("profile_updated"), type: "success" }), i();
1407
1493
  } catch {
1408
- s.setError("root", { message: t("failed_to_update_profile") });
1494
+ a.setError("root", { message: t("failed_to_update_profile") });
1409
1495
  }
1410
1496
  });
1411
- return /* @__PURE__ */ a.jsx(
1412
- jr,
1497
+ return /* @__PURE__ */ n.jsx(
1498
+ wr,
1413
1499
  {
1414
- control: s.control,
1500
+ control: a.control,
1415
1501
  isOpen: !0,
1416
1502
  onSubmit: () => {
1417
1503
  r();
1418
1504
  },
1419
1505
  handleClose: () => {
1420
- !h.isPending && !s.formState.isSubmitting && i();
1506
+ !p.isPending && !a.formState.isSubmitting && i();
1421
1507
  },
1422
1508
  email: e.email,
1423
- languageOptions: u.data?.map((n) => ({
1424
- name: n.name,
1425
- value: n.code
1509
+ languageOptions: u.data?.map((s) => ({
1510
+ name: s.name,
1511
+ value: s.code
1426
1512
  })),
1427
- errorMsg: s.formState.errors.root?.message ?? (u.error ? t("profile_languages_unavailable") : void 0),
1428
- isSubmitting: h.isPending || s.formState.isSubmitting,
1429
- disableNameEdit: p,
1513
+ errorMsg: a.formState.errors.root?.message ?? (u.error ? t("profile_languages_unavailable") : void 0),
1514
+ isSubmitting: p.isPending || a.formState.isSubmitting,
1515
+ disableNameEdit: g,
1430
1516
  presentation: l ? "bottom-sheet" : "dialog"
1431
1517
  }
1432
1518
  );
1433
1519
  }
1434
- const ue = ["memberStorefront", "profile", "addresses"];
1435
- function fe() {
1436
- const e = O();
1437
- return B({
1438
- queryKey: ue,
1520
+ const pe = ["memberStorefront", "profile", "addresses"];
1521
+ function ge() {
1522
+ const e = B();
1523
+ return $({
1524
+ queryKey: pe,
1439
1525
  queryFn: () => e.fetchAddresses()
1440
1526
  });
1441
1527
  }
1442
- function rt(e) {
1443
- const i = Xt(), { locale: t } = D();
1444
- return B({
1528
+ function nt(e) {
1529
+ const i = Zt(), { locale: t } = T();
1530
+ return $({
1445
1531
  queryKey: ["memberStorefront", "profile", "countries", t],
1446
1532
  queryFn: () => i.listCountries({ languageIso: t }),
1447
1533
  enabled: e
1448
1534
  });
1449
1535
  }
1450
- function Tr() {
1451
- const e = O(), i = $();
1452
- return q({
1536
+ function Br() {
1537
+ const e = B(), i = H();
1538
+ return K({
1453
1539
  mutationFn: async ({
1454
1540
  addressId: t,
1455
1541
  body: l
@@ -1457,17 +1543,17 @@ function Tr() {
1457
1543
  if (t === void 0) return e.createAddress(l);
1458
1544
  await e.updateAddress(t, l);
1459
1545
  },
1460
- onSuccess: () => i.invalidateQueries({ queryKey: ue })
1546
+ onSuccess: () => i.invalidateQueries({ queryKey: pe })
1461
1547
  });
1462
1548
  }
1463
- function Br() {
1464
- const e = O(), i = $();
1465
- return q({
1549
+ function Ur() {
1550
+ const e = B(), i = H();
1551
+ return K({
1466
1552
  mutationFn: (t) => e.deleteAddress(t),
1467
- onSuccess: () => i.invalidateQueries({ queryKey: ue })
1553
+ onSuccess: () => i.invalidateQueries({ queryKey: pe })
1468
1554
  });
1469
1555
  }
1470
- function me(e) {
1556
+ function xe(e) {
1471
1557
  return {
1472
1558
  id: e.id,
1473
1559
  address1: e.street1,
@@ -1482,24 +1568,24 @@ function me(e) {
1482
1568
  subdivision_code: null
1483
1569
  };
1484
1570
  }
1485
- function nt({
1571
+ function st({
1486
1572
  isOpen: e,
1487
1573
  onClose: i,
1488
1574
  selectedAddress: t,
1489
1575
  onAddressCreated: l
1490
1576
  }) {
1491
- const { t: d } = M(), { isMobile: u } = K(), { locale: h } = D(), p = rt(e), s = fe(), r = Tr(), n = v.useCallback(
1577
+ const { t: d } = R(), { isMobile: u } = W(), { locale: p } = T(), g = nt(e), a = ge(), r = Br(), s = v.useCallback(
1492
1578
  (o) => Promise.resolve(
1493
- p.data?.countries.find((c) => c.code === o)?.states.map((c) => ({
1579
+ g.data?.countries.find((c) => c.code === o)?.states.map((c) => ({
1494
1580
  name: c.name,
1495
1581
  isoCode: c.code
1496
1582
  })) ?? []
1497
1583
  ),
1498
- [p.data]
1584
+ [g.data]
1499
1585
  );
1500
- if (e && p.error) throw p.error;
1501
- return e && p.isPending ? /* @__PURE__ */ a.jsx("p", { role: "status", children: d("profile_loading") }) : /* @__PURE__ */ a.jsx(
1502
- Ot,
1586
+ if (e && g.error) throw g.error;
1587
+ return e && g.isPending ? /* @__PURE__ */ n.jsx("p", { role: "status", children: d("profile_loading") }) : /* @__PURE__ */ n.jsx(
1588
+ zt,
1503
1589
  {
1504
1590
  isOpen: e,
1505
1591
  onClose: () => {
@@ -1507,18 +1593,18 @@ function nt({
1507
1593
  },
1508
1594
  selectedAddress: t,
1509
1595
  presentation: u ? "bottom-sheet" : "dialog",
1510
- defaultCountry: t?.country_code ?? s.data?.addresses.find((o) => o.default)?.country ?? "US",
1511
- languageIso: h,
1512
- countries: p.data?.countries.map((o) => ({
1596
+ defaultCountry: t?.country_code ?? a.data?.addresses.find((o) => o.default)?.country ?? "US",
1597
+ languageIso: p,
1598
+ countries: g.data?.countries.map((o) => ({
1513
1599
  iso: o.code,
1514
1600
  name: o.name
1515
1601
  })),
1516
- fetchStates: n,
1602
+ fetchStates: s,
1517
1603
  t: (o) => d(o),
1518
1604
  isSubmitting: r.isPending,
1519
1605
  error: r.error ? d(
1520
1606
  t ? "failed_to_update_address" : "failed_to_create_address"
1521
- ) : p.error ? d("unexpected_error") : void 0,
1607
+ ) : g.error ? d("unexpected_error") : void 0,
1522
1608
  onSubmit: (o) => {
1523
1609
  if (r.isPending) return;
1524
1610
  const c = o.address;
@@ -1540,8 +1626,8 @@ function nt({
1540
1626
  }
1541
1627
  },
1542
1628
  {
1543
- onSuccess: (f) => {
1544
- f && l?.(me(f)), r.reset(), i();
1629
+ onSuccess: (m) => {
1630
+ m && l?.(xe(m)), r.reset(), i();
1545
1631
  }
1546
1632
  }
1547
1633
  );
@@ -1549,13 +1635,13 @@ function nt({
1549
1635
  }
1550
1636
  );
1551
1637
  }
1552
- function Ur() {
1553
- const { t: e } = M(), i = fe(), t = Br(), l = v.useRef(null), [d, u] = v.useState(), [h, p] = v.useState(null);
1638
+ function $r() {
1639
+ const { t: e } = R(), i = ge(), t = Ur(), l = v.useRef(null), [d, u] = v.useState(), [p, g] = v.useState(null);
1554
1640
  if (i.error) throw i.error;
1555
- function s() {
1641
+ function a() {
1556
1642
  requestAnimationFrame(() => l.current?.focus());
1557
1643
  }
1558
- return /* @__PURE__ */ a.jsxs(
1644
+ return /* @__PURE__ */ n.jsxs(
1559
1645
  "div",
1560
1646
  {
1561
1647
  ref: l,
@@ -1564,27 +1650,27 @@ function Ur() {
1564
1650
  "aria-label": e("shipping_addresses"),
1565
1651
  className: "space-y-4 outline-none",
1566
1652
  children: [
1567
- i.isPending && /* @__PURE__ */ a.jsx("p", { role: "status", className: "text-muted-foreground text-sm", children: e("profile_loading") }),
1568
- !i.isPending && !i.data?.addresses.length && /* @__PURE__ */ a.jsx("p", { className: "text-muted-foreground text-sm", children: e("no_saved_addresses_found") }),
1569
- i.data?.addresses.map((r) => /* @__PURE__ */ a.jsxs(
1653
+ i.isPending && /* @__PURE__ */ n.jsx("p", { role: "status", className: "text-muted-foreground text-sm", children: e("profile_loading") }),
1654
+ !i.isPending && !i.data?.addresses.length && /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-sm", children: e("no_saved_addresses_found") }),
1655
+ i.data?.addresses.map((r) => /* @__PURE__ */ n.jsxs(
1570
1656
  "section",
1571
1657
  {
1572
1658
  "aria-label": r.street1,
1573
1659
  className: "bg-card text-card-foreground border-border space-y-4 rounded-xl border p-5",
1574
1660
  children: [
1575
- /* @__PURE__ */ a.jsxs("div", { className: "space-y-1 text-sm", children: [
1576
- /* @__PURE__ */ a.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
1577
- /* @__PURE__ */ a.jsx("p", { className: "font-medium", children: r.name }),
1578
- r.default && /* @__PURE__ */ a.jsx(Me, { variant: "secondary", children: e("default") })
1661
+ /* @__PURE__ */ n.jsxs("div", { className: "space-y-1 text-sm", children: [
1662
+ /* @__PURE__ */ n.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
1663
+ /* @__PURE__ */ n.jsx("p", { className: "font-medium", children: r.name }),
1664
+ r.default && /* @__PURE__ */ n.jsx(Re, { variant: "secondary", children: e("default") })
1579
1665
  ] }),
1580
- /* @__PURE__ */ a.jsx("p", { children: r.street1 }),
1581
- r.street2 && /* @__PURE__ */ a.jsx("p", { children: r.street2 }),
1582
- /* @__PURE__ */ a.jsx("p", { children: [r.city, r.state, r.zip].filter(Boolean).join(", ") }),
1583
- /* @__PURE__ */ a.jsx("p", { children: r.country })
1666
+ /* @__PURE__ */ n.jsx("p", { children: r.street1 }),
1667
+ r.street2 && /* @__PURE__ */ n.jsx("p", { children: r.street2 }),
1668
+ /* @__PURE__ */ n.jsx("p", { children: [r.city, r.state, r.zip].filter(Boolean).join(", ") }),
1669
+ /* @__PURE__ */ n.jsx("p", { children: r.country })
1584
1670
  ] }),
1585
- /* @__PURE__ */ a.jsxs("div", { className: "flex gap-2", children: [
1586
- /* @__PURE__ */ a.jsx(
1587
- P,
1671
+ /* @__PURE__ */ n.jsxs("div", { className: "flex gap-2", children: [
1672
+ /* @__PURE__ */ n.jsx(
1673
+ E,
1588
1674
  {
1589
1675
  variant: "outline",
1590
1676
  size: "sm",
@@ -1592,13 +1678,13 @@ function Ur() {
1592
1678
  children: e("edit_address")
1593
1679
  }
1594
1680
  ),
1595
- !r.default && /* @__PURE__ */ a.jsx(
1596
- P,
1681
+ !r.default && /* @__PURE__ */ n.jsx(
1682
+ E,
1597
1683
  {
1598
1684
  variant: "ghost",
1599
1685
  size: "sm",
1600
1686
  onClick: () => {
1601
- t.reset(), p(r);
1687
+ t.reset(), g(r);
1602
1688
  },
1603
1689
  children: e("delete_address")
1604
1690
  }
@@ -1608,33 +1694,33 @@ function Ur() {
1608
1694
  },
1609
1695
  r.id
1610
1696
  )),
1611
- /* @__PURE__ */ a.jsx(P, { onClick: () => u(null), children: e("add_address") }),
1612
- d !== void 0 && /* @__PURE__ */ a.jsx(
1613
- nt,
1697
+ /* @__PURE__ */ n.jsx(E, { onClick: () => u(null), children: e("add_address") }),
1698
+ d !== void 0 && /* @__PURE__ */ n.jsx(
1699
+ st,
1614
1700
  {
1615
1701
  isOpen: !0,
1616
- selectedAddress: d ? me(d) : null,
1702
+ selectedAddress: d ? xe(d) : null,
1617
1703
  onClose: () => {
1618
- u(void 0), s();
1704
+ u(void 0), a();
1619
1705
  }
1620
1706
  }
1621
1707
  ),
1622
- /* @__PURE__ */ a.jsx(
1623
- Re,
1708
+ /* @__PURE__ */ n.jsx(
1709
+ Fe,
1624
1710
  {
1625
1711
  title: e("delete_address"),
1626
1712
  description: e("delete_address_message"),
1627
1713
  actionText: e("delete"),
1628
- openDialog: h !== null,
1714
+ openDialog: p !== null,
1629
1715
  setOpenDialog: (r) => {
1630
- !r && !t.isPending && (p(null), s());
1716
+ !r && !t.isPending && (g(null), a());
1631
1717
  },
1632
1718
  isLoading: t.isPending,
1633
1719
  errorMsg: t.error ? e("unable_to_delete_address") : void 0,
1634
1720
  onAction: () => {
1635
- !h || t.isPending || t.mutate(h.id, {
1721
+ !p || t.isPending || t.mutate(p.id, {
1636
1722
  onSuccess: () => {
1637
- p(null), s();
1723
+ g(null), a();
1638
1724
  }
1639
1725
  });
1640
1726
  }
@@ -1644,9 +1730,9 @@ function Ur() {
1644
1730
  }
1645
1731
  );
1646
1732
  }
1647
- function st() {
1648
- const e = O();
1649
- return B({
1733
+ function at() {
1734
+ const e = B();
1735
+ return $({
1650
1736
  queryKey: ["memberStorefront", "profile", "points"],
1651
1737
  queryFn: async () => {
1652
1738
  try {
@@ -1659,32 +1745,32 @@ function st() {
1659
1745
  }
1660
1746
  });
1661
1747
  }
1662
- function $r() {
1663
- const { t: e } = M(), { locale: i } = D(), t = st(), l = ce();
1748
+ function qr() {
1749
+ const { t: e } = R(), { locale: i } = T(), t = at(), l = me();
1664
1750
  if (t.error) throw t.error;
1665
1751
  if (t.isPending || !l.data)
1666
- return /* @__PURE__ */ a.jsx("p", { role: "status", children: e("profile_loading") });
1752
+ return /* @__PURE__ */ n.jsx("p", { role: "status", children: e("profile_loading") });
1667
1753
  if (!t.data)
1668
- return /* @__PURE__ */ a.jsx("p", { role: "status", children: e("profile_points_unavailable") });
1669
- const d = t.data.points_ledgers, u = d[0]?.total_balance ?? 0, h = u === 1 ? l.data.reward_points_label_singular : l.data.reward_points_label_plural, p = l.data.reward_points_label_plural, s = h.charAt(0).toLocaleUpperCase(i) + h.slice(1), r = p.charAt(0).toLocaleUpperCase(i) + p.slice(1), n = new Intl.NumberFormat(i), o = new Intl.DateTimeFormat(i, { dateStyle: "medium" });
1670
- return /* @__PURE__ */ a.jsxs("div", { className: "space-y-6", children: [
1671
- /* @__PURE__ */ a.jsxs("section", { className: "bg-card text-card-foreground border-border space-y-2 rounded-xl border p-6", children: [
1672
- /* @__PURE__ */ a.jsx("h2", { className: "text-muted-foreground text-sm", children: e("points_available", { label: s }) }),
1673
- /* @__PURE__ */ a.jsx("p", { className: "text-4xl font-semibold tabular-nums", children: n.format(u) })
1754
+ return /* @__PURE__ */ n.jsx("p", { role: "status", children: e("profile_points_unavailable") });
1755
+ const d = t.data.points_ledgers, u = d[0]?.total_balance ?? 0, p = u === 1 ? l.data.reward_points_label_singular : l.data.reward_points_label_plural, g = l.data.reward_points_label_plural, a = p.charAt(0).toLocaleUpperCase(i) + p.slice(1), r = g.charAt(0).toLocaleUpperCase(i) + g.slice(1), s = new Intl.NumberFormat(i), o = new Intl.DateTimeFormat(i, { dateStyle: "medium" });
1756
+ return /* @__PURE__ */ n.jsxs("div", { className: "space-y-6", children: [
1757
+ /* @__PURE__ */ n.jsxs("section", { className: "bg-card text-card-foreground border-border space-y-2 rounded-xl border p-6", children: [
1758
+ /* @__PURE__ */ n.jsx("h2", { className: "text-muted-foreground text-sm", children: e("points_available", { label: a }) }),
1759
+ /* @__PURE__ */ n.jsx("p", { className: "text-4xl font-semibold tabular-nums", children: s.format(u) })
1674
1760
  ] }),
1675
- /* @__PURE__ */ a.jsxs("section", { className: "space-y-3", children: [
1676
- /* @__PURE__ */ a.jsx("h2", { className: "font-semibold", children: e("points_history", { label: r }) }),
1677
- d.length ? /* @__PURE__ */ a.jsx("ol", { className: "border-border divide-border divide-y rounded-xl border", children: d.map((c) => /* @__PURE__ */ a.jsxs(
1761
+ /* @__PURE__ */ n.jsxs("section", { className: "space-y-3", children: [
1762
+ /* @__PURE__ */ n.jsx("h2", { className: "font-semibold", children: e("points_history", { label: r }) }),
1763
+ d.length ? /* @__PURE__ */ n.jsx("ol", { className: "border-border divide-border divide-y rounded-xl border", children: d.map((c) => /* @__PURE__ */ n.jsxs(
1678
1764
  "li",
1679
1765
  {
1680
1766
  className: "flex items-center justify-between gap-4 p-4",
1681
1767
  children: [
1682
- /* @__PURE__ */ a.jsxs("div", { className: "space-y-1", children: [
1683
- /* @__PURE__ */ a.jsx("p", { className: "text-sm font-medium", children: c.metadata?.transaction_type === "order_refund" ? e("profile_points_refunded", { label: r }) : e(
1768
+ /* @__PURE__ */ n.jsxs("div", { className: "space-y-1", children: [
1769
+ /* @__PURE__ */ n.jsx("p", { className: "text-sm font-medium", children: c.metadata?.transaction_type === "order_refund" ? e("profile_points_refunded", { label: r }) : e(
1684
1770
  c.amount > 0 ? "points_awarded" : "points_redeemed",
1685
1771
  { label: r }
1686
1772
  ) }),
1687
- /* @__PURE__ */ a.jsx(
1773
+ /* @__PURE__ */ n.jsx(
1688
1774
  "time",
1689
1775
  {
1690
1776
  className: "text-muted-foreground text-xs",
@@ -1693,45 +1779,45 @@ function $r() {
1693
1779
  }
1694
1780
  )
1695
1781
  ] }),
1696
- /* @__PURE__ */ a.jsxs("span", { className: "font-medium tabular-nums", children: [
1782
+ /* @__PURE__ */ n.jsxs("span", { className: "font-medium tabular-nums", children: [
1697
1783
  c.amount > 0 ? "+" : "",
1698
- n.format(c.amount)
1784
+ s.format(c.amount)
1699
1785
  ] })
1700
1786
  ]
1701
1787
  },
1702
1788
  c.id
1703
- )) }) : /* @__PURE__ */ a.jsx("p", { className: "text-muted-foreground text-sm", children: e("no_points_history_found", { label: r }) })
1789
+ )) }) : /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-sm", children: e("no_points_history_found", { label: r }) })
1704
1790
  ] })
1705
1791
  ] });
1706
1792
  }
1707
- function qr({
1793
+ function Qr({
1708
1794
  children: e
1709
1795
  }) {
1710
1796
  const i = v.useRef(null), [t, l] = v.useState(null);
1711
1797
  return v.useEffect(() => {
1712
1798
  if (!i.current) return;
1713
- const d = zt(i.current);
1799
+ const d = Tt(i.current);
1714
1800
  return l(d), () => d.remove();
1715
- }, []), /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
1716
- /* @__PURE__ */ a.jsx("span", { ref: i, hidden: !0 }),
1801
+ }, []), /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
1802
+ /* @__PURE__ */ n.jsx("span", { ref: i, hidden: !0 }),
1717
1803
  t && yt.createPortal(
1718
- /* @__PURE__ */ a.jsx(vt, { container: t, children: e }),
1804
+ /* @__PURE__ */ n.jsx(jt, { container: t, children: e }),
1719
1805
  t
1720
1806
  )
1721
1807
  ] });
1722
1808
  }
1723
- function Qr({
1809
+ function Vr({
1724
1810
  onClose: e
1725
1811
  }) {
1726
- const i = fe(), { t } = M(), { isMobile: l } = K();
1727
- return /* @__PURE__ */ a.jsx(qr, { children: i.data ? /* @__PURE__ */ a.jsx(
1728
- Vr,
1812
+ const i = ge(), { t } = R(), { isMobile: l } = W();
1813
+ return /* @__PURE__ */ n.jsx(Qr, { children: i.data ? /* @__PURE__ */ n.jsx(
1814
+ Hr,
1729
1815
  {
1730
1816
  initialAddresses: i.data.addresses,
1731
1817
  onClose: e
1732
1818
  }
1733
- ) : /* @__PURE__ */ a.jsxs(
1734
- Fe,
1819
+ ) : /* @__PURE__ */ n.jsxs(
1820
+ Le,
1735
1821
  {
1736
1822
  open: !0,
1737
1823
  onOpenChange: (d) => {
@@ -1740,9 +1826,9 @@ function Qr({
1740
1826
  title: t("add_payment_method"),
1741
1827
  presentation: l ? "bottom-sheet" : "dialog",
1742
1828
  children: [
1743
- /* @__PURE__ */ a.jsx("p", { role: i.error ? "alert" : "status", children: t(i.error ? "unexpected_error" : "profile_loading") }),
1744
- i.error && /* @__PURE__ */ a.jsx(
1745
- P,
1829
+ /* @__PURE__ */ n.jsx("p", { role: i.error ? "alert" : "status", children: t(i.error ? "unexpected_error" : "profile_loading") }),
1830
+ i.error && /* @__PURE__ */ n.jsx(
1831
+ E,
1746
1832
  {
1747
1833
  disabled: i.isFetching,
1748
1834
  onClick: () => {
@@ -1755,69 +1841,69 @@ function Qr({
1755
1841
  }
1756
1842
  ) });
1757
1843
  }
1758
- function Vr({
1844
+ function Hr({
1759
1845
  initialAddresses: e,
1760
1846
  onClose: i
1761
1847
  }) {
1762
- const { t } = M(), { isMobile: l } = K(), d = O(), u = $(), [h, p] = v.useState(), s = v.useMemo(() => Tt(d), [d]), [r] = v.useState(
1763
- () => e.map(me)
1848
+ const { t } = R(), { isMobile: l } = W(), d = B(), u = H(), [p, g] = v.useState(), a = v.useMemo(() => Bt(d), [d]), [r] = v.useState(
1849
+ () => e.map(xe)
1764
1850
  );
1765
- async function n() {
1766
- await u.invalidateQueries({ queryKey: Y.paymentMethods.all }), i();
1851
+ async function s() {
1852
+ await u.invalidateQueries({ queryKey: J.paymentMethods.all }), i();
1767
1853
  }
1768
- const o = Bt({
1854
+ const o = Ut({
1769
1855
  payApi: d,
1770
- t: (f) => t(f),
1771
- onApproved: n,
1772
- onFailed: p,
1856
+ t: (m) => t(m),
1857
+ onApproved: s,
1858
+ onFailed: g,
1773
1859
  onCanceled: () => {
1774
1860
  }
1775
- }), c = q({
1776
- mutationFn: (f) => d.createPaymentMethod({
1861
+ }), c = K({
1862
+ mutationFn: (m) => d.createPaymentMethod({
1777
1863
  payment_method: {
1778
- ...f.payment_method,
1864
+ ...m.payment_method,
1779
1865
  type: "card",
1780
- token_provider: qt,
1781
- default: f.set_as_default
1866
+ token_provider: Qt,
1867
+ default: m.set_as_default
1782
1868
  },
1783
- billing_address_id: f.billing_address_id,
1784
- browser_info: $t()
1869
+ billing_address_id: m.billing_address_id,
1870
+ browser_info: qt()
1785
1871
  }),
1786
- onSuccess: async (f) => {
1787
- Ut(f) ? await o.begin(f) : await n();
1872
+ onSuccess: async (m) => {
1873
+ $t(m) ? await o.begin(m) : await s();
1788
1874
  },
1789
- onError: () => p(t("failed_to_add_payment_method"))
1875
+ onError: () => g(t("failed_to_add_payment_method"))
1790
1876
  });
1791
- return /* @__PURE__ */ a.jsxs(Qt, { api: s, children: [
1792
- /* @__PURE__ */ a.jsx(
1793
- Vt,
1877
+ return /* @__PURE__ */ n.jsxs(Vt, { api: a, children: [
1878
+ /* @__PURE__ */ n.jsx(
1879
+ Ht,
1794
1880
  {
1795
1881
  isOpen: !0,
1796
1882
  jwt: "",
1797
1883
  savedAddresses: r,
1798
- defaultBillingAddressId: r.find((f) => f.default)?.id,
1884
+ defaultBillingAddressId: r.find((m) => m.default)?.id,
1799
1885
  presentation: l ? "bottom-sheet" : "dialog",
1800
- t: (f) => t(f),
1801
- error: h,
1886
+ t: (m) => t(m),
1887
+ error: p,
1802
1888
  isSubmitting: c.isPending || o.isActive,
1803
1889
  preventClose: c.isPending || o.isActive,
1804
1890
  onClose: () => {
1805
1891
  !c.isPending && !o.isActive && i();
1806
1892
  },
1807
- onSubmit: (f) => {
1808
- c.isPending || o.isActive || (p(void 0), c.mutate(f));
1893
+ onSubmit: (m) => {
1894
+ c.isPending || o.isActive || (g(void 0), c.mutate(m));
1809
1895
  },
1810
1896
  renderAddressFormDialog: ({
1811
- isOpen: f,
1812
- onClose: m,
1813
- onAddressCreated: g
1814
- }) => f ? /* @__PURE__ */ a.jsx(
1815
- nt,
1897
+ isOpen: m,
1898
+ onClose: f,
1899
+ onAddressCreated: h
1900
+ }) => m ? /* @__PURE__ */ n.jsx(
1901
+ st,
1816
1902
  {
1817
1903
  isOpen: !0,
1818
- onClose: m,
1904
+ onClose: f,
1819
1905
  selectedAddress: null,
1820
- onAddressCreated: g
1906
+ onAddressCreated: h
1821
1907
  }
1822
1908
  ) : null
1823
1909
  }
@@ -1825,76 +1911,76 @@ function Vr({
1825
1911
  o.modal
1826
1912
  ] });
1827
1913
  }
1828
- function at() {
1829
- const e = O();
1830
- return B({
1831
- queryKey: Y.paymentMethods.list(),
1914
+ function it() {
1915
+ const e = B();
1916
+ return $({
1917
+ queryKey: J.paymentMethods.list(),
1832
1918
  queryFn: () => e.fetchPaymentMethods()
1833
1919
  });
1834
1920
  }
1835
- function it() {
1836
- const e = O(), i = $();
1837
- return q({
1921
+ function ot() {
1922
+ const e = B(), i = H();
1923
+ return K({
1838
1924
  mutationFn: ({ id: t, body: l }) => e.updatePaymentMethod(t, l),
1839
- onSuccess: () => i.invalidateQueries({ queryKey: Y.paymentMethods.all })
1925
+ onSuccess: () => i.invalidateQueries({ queryKey: J.paymentMethods.all })
1840
1926
  });
1841
1927
  }
1842
- function Hr() {
1843
- const e = O(), i = $();
1844
- return q({
1928
+ function Kr() {
1929
+ const e = B(), i = H();
1930
+ return K({
1845
1931
  mutationFn: (t) => e.deletePaymentMethod(t),
1846
- onSuccess: () => i.invalidateQueries({ queryKey: Y.paymentMethods.all })
1932
+ onSuccess: () => i.invalidateQueries({ queryKey: J.paymentMethods.all })
1847
1933
  });
1848
1934
  }
1849
- function Kr({
1935
+ function Gr({
1850
1936
  card: e,
1851
1937
  onClose: i
1852
1938
  }) {
1853
- const { t } = M(), { locale: l } = D(), { isMobile: d } = K(), u = rt(!0), h = it(), p = v.useMemo(() => Ht(e), [e]), s = v.useCallback(
1939
+ const { t } = R(), { locale: l } = T(), { isMobile: d } = W(), u = nt(!0), p = ot(), g = v.useMemo(() => Kt(e), [e]), a = v.useCallback(
1854
1940
  (r) => Promise.resolve(
1855
- u.data?.countries.find((n) => n.code === r)?.states.map((n) => ({
1856
- name: n.name,
1857
- isoCode: n.code
1941
+ u.data?.countries.find((s) => s.code === r)?.states.map((s) => ({
1942
+ name: s.name,
1943
+ isoCode: s.code
1858
1944
  })) ?? []
1859
1945
  ),
1860
1946
  [u.data]
1861
1947
  );
1862
1948
  if (u.error) throw u.error;
1863
- return u.isPending ? /* @__PURE__ */ a.jsx("p", { role: "status", children: t("profile_loading") }) : /* @__PURE__ */ a.jsx(
1864
- Kt,
1949
+ return u.isPending ? /* @__PURE__ */ n.jsx("p", { role: "status", children: t("profile_loading") }) : /* @__PURE__ */ n.jsx(
1950
+ Gt,
1865
1951
  {
1866
1952
  isOpen: !0,
1867
- paymentMethod: p,
1868
- billingAddress: p.billing_address,
1953
+ paymentMethod: g,
1954
+ billingAddress: g.billing_address,
1869
1955
  countries: u.data?.countries.map((r) => ({
1870
1956
  iso: r.code,
1871
1957
  name: r.name
1872
1958
  })),
1873
- fetchStates: s,
1959
+ fetchStates: a,
1874
1960
  languageIso: l,
1875
1961
  presentation: d ? "bottom-sheet" : "dialog",
1876
- isSubmitting: h.isPending,
1877
- error: h.error ? t("failed_to_update_payment_method") : void 0,
1962
+ isSubmitting: p.isPending,
1963
+ error: p.error ? t("failed_to_update_payment_method") : void 0,
1878
1964
  onClose: () => {
1879
- h.isPending || i();
1965
+ p.isPending || i();
1880
1966
  },
1881
1967
  onSubmit: (r) => {
1882
- if (h.isPending) return;
1883
- const n = r.billing_address;
1884
- h.mutate(
1968
+ if (p.isPending) return;
1969
+ const s = r.billing_address;
1970
+ p.mutate(
1885
1971
  {
1886
1972
  id: e.id,
1887
1973
  body: {
1888
1974
  payment_method: {
1889
1975
  default: r.set_as_default,
1890
1976
  billing_address: {
1891
- name: n.name,
1892
- street1: n.address1,
1893
- street2: n.address2,
1894
- city: n.city,
1895
- state: n.state,
1896
- zip: n.zip,
1897
- country: n.country_code
1977
+ name: s.name,
1978
+ street1: s.address1,
1979
+ street2: s.address2,
1980
+ city: s.city,
1981
+ state: s.state,
1982
+ zip: s.zip,
1983
+ country: s.country_code
1898
1984
  }
1899
1985
  }
1900
1986
  }
@@ -1905,27 +1991,27 @@ function Kr({
1905
1991
  }
1906
1992
  );
1907
1993
  }
1908
- function Gr() {
1909
- const { t: e } = M(), { preview: i } = le(), t = at(), l = it(), d = Hr(), u = v.useRef(null), h = v.useRef(null), [p, s] = v.useState(!1), [r, n] = v.useState(null), [o, c] = v.useState(null);
1910
- function f() {
1994
+ function Yr() {
1995
+ const { t: e } = R(), { preview: i } = fe(), t = it(), l = ot(), d = Kr(), u = v.useRef(null), p = v.useRef(null), [g, a] = v.useState(!1), [r, s] = v.useState(null), [o, c] = v.useState(null);
1996
+ function m() {
1911
1997
  requestAnimationFrame(() => {
1912
- (u.current?.isConnected ? u.current : h.current?.querySelector("button") ?? h.current)?.focus();
1998
+ (u.current?.isConnected ? u.current : p.current?.querySelector("button") ?? p.current)?.focus();
1913
1999
  });
1914
2000
  }
1915
- return /* @__PURE__ */ a.jsxs(
2001
+ return /* @__PURE__ */ n.jsxs(
1916
2002
  "div",
1917
2003
  {
1918
- ref: h,
2004
+ ref: p,
1919
2005
  role: "region",
1920
2006
  tabIndex: -1,
1921
2007
  "aria-label": e("payment_methods"),
1922
2008
  className: "space-y-4 outline-none",
1923
2009
  children: [
1924
- t.isPending && /* @__PURE__ */ a.jsx("p", { role: "status", children: e("profile_loading") }),
1925
- t.error && /* @__PURE__ */ a.jsxs("div", { role: "alert", className: "space-y-3", children: [
1926
- /* @__PURE__ */ a.jsx("p", { children: e("profile_payments_load_failed") }),
1927
- /* @__PURE__ */ a.jsx(
1928
- P,
2010
+ t.isPending && /* @__PURE__ */ n.jsx("p", { role: "status", children: e("profile_loading") }),
2011
+ t.error && /* @__PURE__ */ n.jsxs("div", { role: "alert", className: "space-y-3", children: [
2012
+ /* @__PURE__ */ n.jsx("p", { children: e("profile_payments_load_failed") }),
2013
+ /* @__PURE__ */ n.jsx(
2014
+ E,
1929
2015
  {
1930
2016
  variant: "outline",
1931
2017
  disabled: t.isFetching,
@@ -1936,62 +2022,62 @@ function Gr() {
1936
2022
  }
1937
2023
  )
1938
2024
  ] }),
1939
- t.data?.payment_methods.length === 0 && /* @__PURE__ */ a.jsx("p", { className: "text-muted-foreground text-sm", children: e("profile_no_saved_cards") }),
1940
- t.data?.payment_methods.map((m) => /* @__PURE__ */ a.jsxs(
2025
+ t.data?.payment_methods.length === 0 && /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-sm", children: e("profile_no_saved_cards") }),
2026
+ t.data?.payment_methods.map((f) => /* @__PURE__ */ n.jsxs(
1941
2027
  "section",
1942
2028
  {
1943
2029
  className: "bg-card text-card-foreground border-border space-y-4 rounded-xl border p-5",
1944
2030
  children: [
1945
- /* @__PURE__ */ a.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
1946
- /* @__PURE__ */ a.jsx("h2", { className: "font-medium", children: e("profile_card_ending", {
1947
- brand: m.brand || e("card_fallback"),
1948
- lastFour: m.last_four
2031
+ /* @__PURE__ */ n.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
2032
+ /* @__PURE__ */ n.jsx("h2", { className: "font-medium", children: e("profile_card_ending", {
2033
+ brand: f.brand || e("card_fallback"),
2034
+ lastFour: f.last_four
1949
2035
  }) }),
1950
- m.default && /* @__PURE__ */ a.jsx(Me, { variant: "secondary", children: e("default") })
2036
+ f.default && /* @__PURE__ */ n.jsx(Re, { variant: "secondary", children: e("default") })
1951
2037
  ] }),
1952
- m.exp_month !== null && m.exp_year !== null && /* @__PURE__ */ a.jsxs("p", { className: "text-muted-foreground text-sm", children: [
2038
+ f.exp_month !== null && f.exp_year !== null && /* @__PURE__ */ n.jsxs("p", { className: "text-muted-foreground text-sm", children: [
1953
2039
  e("card_expires"),
1954
2040
  " ",
1955
- m.exp_month,
2041
+ f.exp_month,
1956
2042
  "/",
1957
- m.exp_year
2043
+ f.exp_year
1958
2044
  ] }),
1959
- /* @__PURE__ */ a.jsxs("div", { className: "flex flex-wrap gap-2", children: [
1960
- /* @__PURE__ */ a.jsx(
1961
- P,
2045
+ /* @__PURE__ */ n.jsxs("div", { className: "flex flex-wrap gap-2", children: [
2046
+ /* @__PURE__ */ n.jsx(
2047
+ E,
1962
2048
  {
1963
2049
  variant: "outline",
1964
2050
  size: "sm",
1965
- onClick: (g) => {
1966
- u.current = g.currentTarget, n(m);
2051
+ onClick: (h) => {
2052
+ u.current = h.currentTarget, s(f);
1967
2053
  },
1968
2054
  disabled: i || l.isPending || d.isPending,
1969
2055
  children: e("edit_card")
1970
2056
  }
1971
2057
  ),
1972
- !m.default && /* @__PURE__ */ a.jsx(
1973
- P,
2058
+ !f.default && /* @__PURE__ */ n.jsx(
2059
+ E,
1974
2060
  {
1975
2061
  variant: "outline",
1976
2062
  size: "sm",
1977
2063
  disabled: i || l.isPending || d.isPending,
1978
2064
  onClick: () => {
1979
2065
  l.isPending || l.mutate({
1980
- id: m.id,
2066
+ id: f.id,
1981
2067
  body: { payment_method: { default: !0 } }
1982
2068
  });
1983
2069
  },
1984
2070
  children: e("set_as_default_payment_method")
1985
2071
  }
1986
2072
  ),
1987
- /* @__PURE__ */ a.jsx(
1988
- P,
2073
+ /* @__PURE__ */ n.jsx(
2074
+ E,
1989
2075
  {
1990
2076
  variant: "ghost",
1991
2077
  size: "sm",
1992
2078
  disabled: i || l.isPending || d.isPending,
1993
- onClick: (g) => {
1994
- u.current = g.currentTarget, d.reset(), c(m);
2079
+ onClick: (h) => {
2080
+ u.current = h.currentTarget, d.reset(), c(f);
1995
2081
  },
1996
2082
  children: e("delete_card")
1997
2083
  }
@@ -1999,52 +2085,52 @@ function Gr() {
1999
2085
  ] })
2000
2086
  ]
2001
2087
  },
2002
- m.id
2088
+ f.id
2003
2089
  )),
2004
- l.error && /* @__PURE__ */ a.jsx("p", { role: "alert", className: "text-destructive text-sm", children: e("failed_to_set_default_payment_method") }),
2005
- /* @__PURE__ */ a.jsx(
2006
- P,
2090
+ l.error && /* @__PURE__ */ n.jsx("p", { role: "alert", className: "text-destructive text-sm", children: e("failed_to_set_default_payment_method") }),
2091
+ /* @__PURE__ */ n.jsx(
2092
+ E,
2007
2093
  {
2008
- onClick: (m) => {
2009
- u.current = m.currentTarget, s(!0);
2094
+ onClick: (f) => {
2095
+ u.current = f.currentTarget, a(!0);
2010
2096
  },
2011
2097
  disabled: i || l.isPending || d.isPending,
2012
2098
  children: e("add_payment_method")
2013
2099
  }
2014
2100
  ),
2015
- p && /* @__PURE__ */ a.jsx(
2016
- Qr,
2101
+ g && /* @__PURE__ */ n.jsx(
2102
+ Vr,
2017
2103
  {
2018
2104
  onClose: () => {
2019
- s(!1), f();
2105
+ a(!1), m();
2020
2106
  }
2021
2107
  }
2022
2108
  ),
2023
- r && /* @__PURE__ */ a.jsx(
2024
- Kr,
2109
+ r && /* @__PURE__ */ n.jsx(
2110
+ Gr,
2025
2111
  {
2026
2112
  card: r,
2027
2113
  onClose: () => {
2028
- n(null), f();
2114
+ s(null), m();
2029
2115
  }
2030
2116
  }
2031
2117
  ),
2032
- /* @__PURE__ */ a.jsx(
2033
- Re,
2118
+ /* @__PURE__ */ n.jsx(
2119
+ Fe,
2034
2120
  {
2035
2121
  title: e("delete_credit_card"),
2036
2122
  description: e("delete_credit_card_message"),
2037
2123
  actionText: e("delete"),
2038
2124
  openDialog: o !== null,
2039
- setOpenDialog: (m) => {
2040
- !m && !d.isPending && (c(null), f());
2125
+ setOpenDialog: (f) => {
2126
+ !f && !d.isPending && (c(null), m());
2041
2127
  },
2042
2128
  isLoading: d.isPending,
2043
2129
  errorMsg: d.error ? e("unable_to_delete_payment_method") : void 0,
2044
2130
  onAction: () => {
2045
2131
  o && !d.isPending && d.mutate(o.id, {
2046
2132
  onSuccess: () => {
2047
- c(null), f();
2133
+ c(null), m();
2048
2134
  }
2049
2135
  });
2050
2136
  }
@@ -2054,7 +2140,7 @@ function Gr() {
2054
2140
  }
2055
2141
  );
2056
2142
  }
2057
- function he({
2143
+ function _e({
2058
2144
  icon: e,
2059
2145
  label: i,
2060
2146
  detail: t,
@@ -2062,7 +2148,7 @@ function he({
2062
2148
  onOpen: d,
2063
2149
  triggerRef: u
2064
2150
  }) {
2065
- return /* @__PURE__ */ a.jsxs(
2151
+ return /* @__PURE__ */ n.jsxs(
2066
2152
  "button",
2067
2153
  {
2068
2154
  type: "button",
@@ -2070,10 +2156,10 @@ function he({
2070
2156
  onClick: d,
2071
2157
  className: "bg-card text-card-foreground border-border hover:bg-muted focus-visible:ring-ring flex min-h-20 w-full items-center gap-4 rounded-xl border p-5 text-left focus-visible:ring-2",
2072
2158
  children: [
2073
- /* @__PURE__ */ a.jsx(e, { "aria-hidden": "true", className: "size-5" }),
2074
- /* @__PURE__ */ a.jsxs("span", { className: "flex-1 space-y-1", children: [
2075
- /* @__PURE__ */ a.jsx("span", { className: "block font-medium", children: i }),
2076
- /* @__PURE__ */ a.jsx(
2159
+ /* @__PURE__ */ n.jsx(e, { "aria-hidden": "true", className: "size-5" }),
2160
+ /* @__PURE__ */ n.jsxs("span", { className: "flex-1 space-y-1", children: [
2161
+ /* @__PURE__ */ n.jsx("span", { className: "block font-medium", children: i }),
2162
+ /* @__PURE__ */ n.jsx(
2077
2163
  "span",
2078
2164
  {
2079
2165
  className: "text-muted-foreground block text-sm",
@@ -2082,8 +2168,8 @@ function he({
2082
2168
  }
2083
2169
  )
2084
2170
  ] }),
2085
- /* @__PURE__ */ a.jsx(
2086
- Ae,
2171
+ /* @__PURE__ */ n.jsx(
2172
+ Me,
2087
2173
  {
2088
2174
  "aria-hidden": "true",
2089
2175
  className: "text-muted-foreground size-4"
@@ -2093,16 +2179,16 @@ function he({
2093
2179
  }
2094
2180
  );
2095
2181
  }
2096
- function pe({
2182
+ function be({
2097
2183
  message: e,
2098
2184
  retryLabel: i,
2099
2185
  isRetrying: t,
2100
2186
  onRetry: l
2101
2187
  }) {
2102
- return /* @__PURE__ */ a.jsxs("div", { role: "alert", className: "border-border space-y-3 rounded-xl border p-5", children: [
2103
- /* @__PURE__ */ a.jsx("p", { className: "text-sm", children: e }),
2104
- /* @__PURE__ */ a.jsx(
2105
- P,
2188
+ return /* @__PURE__ */ n.jsxs("div", { role: "alert", className: "border-border space-y-3 rounded-xl border p-5", children: [
2189
+ /* @__PURE__ */ n.jsx("p", { className: "text-sm", children: e }),
2190
+ /* @__PURE__ */ n.jsx(
2191
+ E,
2106
2192
  {
2107
2193
  variant: "outline",
2108
2194
  size: "sm",
@@ -2113,23 +2199,23 @@ function pe({
2113
2199
  )
2114
2200
  ] });
2115
2201
  }
2116
- function Yr({
2202
+ function Wr({
2117
2203
  onOpen: e,
2118
2204
  triggerRef: i
2119
2205
  }) {
2120
- const { t } = M(), l = at(), d = l.data?.payment_methods.find((u) => u.default);
2121
- return l.error ? /* @__PURE__ */ a.jsx(
2122
- pe,
2206
+ const { t } = R(), l = it(), d = l.data?.payment_methods.find((u) => u.default);
2207
+ return l.error ? /* @__PURE__ */ n.jsx(
2208
+ be,
2123
2209
  {
2124
2210
  message: t("profile_payments_load_failed"),
2125
2211
  retryLabel: t("profile_payments_retry"),
2126
2212
  isRetrying: l.isFetching,
2127
2213
  onRetry: () => void l.refetch()
2128
2214
  }
2129
- ) : /* @__PURE__ */ a.jsx(
2130
- he,
2215
+ ) : /* @__PURE__ */ n.jsx(
2216
+ _e,
2131
2217
  {
2132
- icon: Ie,
2218
+ icon: ke,
2133
2219
  label: t("profile_default_payment"),
2134
2220
  detail: l.isPending ? t("profile_loading") : d ? t("profile_card_ending", {
2135
2221
  brand: d.brand || t("card_fallback"),
@@ -2141,7 +2227,7 @@ function Yr({
2141
2227
  }
2142
2228
  );
2143
2229
  }
2144
- function ot(e, i, t) {
2230
+ function lt(e, i, t) {
2145
2231
  const l = {
2146
2232
  dateStyle: "medium",
2147
2233
  ...t ? { timeZone: t } : {}
@@ -2152,24 +2238,24 @@ function ot(e, i, t) {
2152
2238
  return new Intl.DateTimeFormat("en-US", l).format(e);
2153
2239
  }
2154
2240
  }
2155
- function Wr(e, i) {
2241
+ function Xr(e, i) {
2156
2242
  if (!e) return null;
2157
2243
  const t = new Date(e);
2158
- return Number.isNaN(t.getTime()) ? null : ot(t, i);
2244
+ return Number.isNaN(t.getTime()) ? null : lt(t, i);
2159
2245
  }
2160
- function Xr(e, i) {
2246
+ function Zr(e, i) {
2161
2247
  if (!e) return null;
2162
2248
  const t = /* @__PURE__ */ new Date(`${e.slice(0, 10)}T00:00:00Z`);
2163
- return Number.isNaN(t.getTime()) ? null : ot(t, i, "UTC");
2249
+ return Number.isNaN(t.getTime()) ? null : lt(t, i, "UTC");
2164
2250
  }
2165
- const Zr = ee({
2166
- subscription: ee({
2167
- token: F(),
2168
- plan_name: F().nullish(),
2169
- next_billing_date: F().nullish()
2251
+ const Jr = se({
2252
+ subscription: se({
2253
+ token: L(),
2254
+ plan_name: L().nullish(),
2255
+ next_billing_date: L().nullish()
2170
2256
  }).nullish()
2171
2257
  });
2172
- async function Jr(e = jt) {
2258
+ async function en(e = wt) {
2173
2259
  const i = await e(
2174
2260
  "/api/member-storefront/subscriptions/next",
2175
2261
  {
@@ -2179,35 +2265,35 @@ async function Jr(e = jt) {
2179
2265
  );
2180
2266
  if (!i.ok)
2181
2267
  throw new Error(`Next subscription request failed (${i.status})`);
2182
- const { subscription: t } = Zr.parse(await i.json());
2268
+ const { subscription: t } = Jr.parse(await i.json());
2183
2269
  return t ? {
2184
2270
  token: t.token,
2185
2271
  planName: t.plan_name ?? null,
2186
2272
  nextBillingDate: t.next_billing_date ?? null
2187
2273
  } : null;
2188
2274
  }
2189
- function en() {
2190
- const e = St(), i = v.useMemo(() => Et(e), [e]);
2191
- return B({
2275
+ function tn() {
2276
+ const e = Et(), i = v.useMemo(() => Pt(e), [e]);
2277
+ return $({
2192
2278
  queryKey: ["memberStorefront", "profile", "latest-order"],
2193
2279
  queryFn: async () => (await i.fetchCustomerOrders({ limit: 1 })).orders[0] ?? null
2194
2280
  });
2195
2281
  }
2196
- function tn() {
2197
- const { fetch: e } = le();
2198
- return B({
2282
+ function rn() {
2283
+ const { fetch: e } = fe();
2284
+ return $({
2199
2285
  queryKey: ["memberStorefront", "profile", "next-subscription"],
2200
- queryFn: () => Jr(e)
2286
+ queryFn: () => en(e)
2201
2287
  });
2202
2288
  }
2203
- function rn({
2289
+ function nn({
2204
2290
  onOpen: e,
2205
2291
  triggerRef: i
2206
2292
  }) {
2207
- const { t } = M(), { locale: l } = D(), d = en();
2293
+ const { t } = R(), { locale: l } = T(), d = tn();
2208
2294
  if (d.error)
2209
- return /* @__PURE__ */ a.jsx(
2210
- pe,
2295
+ return /* @__PURE__ */ n.jsx(
2296
+ be,
2211
2297
  {
2212
2298
  message: t("profile_orders_load_failed"),
2213
2299
  retryLabel: t("profile_orders_retry"),
@@ -2215,30 +2301,30 @@ function rn({
2215
2301
  onRetry: () => void d.refetch()
2216
2302
  }
2217
2303
  );
2218
- const u = d.data, h = d.isPending ? t("profile_loading") : u ? [
2304
+ const u = d.data, p = d.isPending ? t("profile_loading") : u ? [
2219
2305
  u.order_number ? `#${u.order_number}` : null,
2220
- Wr(u.created_at, l)
2306
+ Xr(u.created_at, l)
2221
2307
  ].filter(Boolean).join(" · ") || t("profile_view_orders") : t("profile_no_orders");
2222
- return /* @__PURE__ */ a.jsx(
2223
- he,
2308
+ return /* @__PURE__ */ n.jsx(
2309
+ _e,
2224
2310
  {
2225
- icon: Le,
2311
+ icon: Ie,
2226
2312
  label: t("profile_latest_order"),
2227
- detail: h,
2313
+ detail: p,
2228
2314
  busy: d.isPending,
2229
2315
  onOpen: () => e(u?.token ?? null),
2230
2316
  triggerRef: i
2231
2317
  }
2232
2318
  );
2233
2319
  }
2234
- function nn({
2320
+ function sn({
2235
2321
  onOpen: e,
2236
2322
  triggerRef: i
2237
2323
  }) {
2238
- const { t } = M(), { locale: l } = D(), d = tn();
2324
+ const { t } = R(), { locale: l } = T(), d = rn();
2239
2325
  if (d.error)
2240
- return /* @__PURE__ */ a.jsx(
2241
- pe,
2326
+ return /* @__PURE__ */ n.jsx(
2327
+ be,
2242
2328
  {
2243
2329
  message: t("profile_subscription_load_failed"),
2244
2330
  retryLabel: t("profile_subscription_retry"),
@@ -2246,23 +2332,23 @@ function nn({
2246
2332
  onRetry: () => void d.refetch()
2247
2333
  }
2248
2334
  );
2249
- const u = d.data, h = Xr(u?.nextBillingDate, l), p = d.isPending ? t("profile_loading") : u ? [
2335
+ const u = d.data, p = Zr(u?.nextBillingDate, l), g = d.isPending ? t("profile_loading") : u ? [
2250
2336
  u.planName,
2251
- h ? t("profile_next_bill_on", { date: h }) : null
2337
+ p ? t("profile_next_bill_on", { date: p }) : null
2252
2338
  ].filter(Boolean).join(" · ") || t("profile_view_subscriptions") : t("profile_no_next_subscription");
2253
- return /* @__PURE__ */ a.jsx(
2254
- he,
2339
+ return /* @__PURE__ */ n.jsx(
2340
+ _e,
2255
2341
  {
2256
- icon: ke,
2342
+ icon: De,
2257
2343
  label: t("profile_next_subscription"),
2258
- detail: p,
2344
+ detail: g,
2259
2345
  busy: d.isPending,
2260
2346
  onOpen: () => e(u?.token ?? null),
2261
2347
  triggerRef: i
2262
2348
  }
2263
2349
  );
2264
2350
  }
2265
- function sn({
2351
+ function an({
2266
2352
  onOpenPayment: e,
2267
2353
  paymentTriggerRef: i,
2268
2354
  onOpenOrder: t,
@@ -2270,20 +2356,20 @@ function sn({
2270
2356
  onOpenSubscription: d,
2271
2357
  subscriptionTriggerRef: u
2272
2358
  }) {
2273
- const { t: h } = M();
2274
- return /* @__PURE__ */ a.jsxs("section", { "aria-label": h("profile_at_a_glance"), className: "space-y-3", children: [
2275
- /* @__PURE__ */ a.jsx("h2", { className: "text-muted-foreground text-sm font-medium", children: h("profile_at_a_glance") }),
2276
- /* @__PURE__ */ a.jsxs("div", { className: "space-y-3", children: [
2277
- /* @__PURE__ */ a.jsx(
2278
- Yr,
2359
+ const { t: p } = R();
2360
+ return /* @__PURE__ */ n.jsxs("section", { "aria-label": p("profile_at_a_glance"), className: "space-y-3", children: [
2361
+ /* @__PURE__ */ n.jsx("h2", { className: "text-muted-foreground text-sm font-medium", children: p("profile_at_a_glance") }),
2362
+ /* @__PURE__ */ n.jsxs("div", { className: "space-y-3", children: [
2363
+ /* @__PURE__ */ n.jsx(
2364
+ Wr,
2279
2365
  {
2280
2366
  onOpen: e,
2281
2367
  triggerRef: i
2282
2368
  }
2283
2369
  ),
2284
- /* @__PURE__ */ a.jsx(rn, { onOpen: t, triggerRef: l }),
2285
- /* @__PURE__ */ a.jsx(
2286
- nn,
2370
+ /* @__PURE__ */ n.jsx(nn, { onOpen: t, triggerRef: l }),
2371
+ /* @__PURE__ */ n.jsx(
2372
+ sn,
2287
2373
  {
2288
2374
  onOpen: d,
2289
2375
  triggerRef: u
@@ -2292,46 +2378,46 @@ function sn({
2292
2378
  ] })
2293
2379
  ] });
2294
2380
  }
2295
- function an({
2381
+ function on({
2296
2382
  initialLanguage: e
2297
2383
  }) {
2298
- const { t: i } = M(), t = et(), l = tt(), [d, u] = v.useState(e);
2384
+ const { t: i } = R(), t = tt(), l = rt(), [d, u] = v.useState(e);
2299
2385
  if (t.error) throw t.error;
2300
- return /* @__PURE__ */ a.jsxs(
2386
+ return /* @__PURE__ */ n.jsxs(
2301
2387
  "form",
2302
2388
  {
2303
2389
  className: "bg-card border-border space-y-5 rounded-xl border p-6",
2304
- onSubmit: (h) => {
2305
- h.preventDefault(), !(!d || l.isPending) && l.mutate(
2390
+ onSubmit: (p) => {
2391
+ p.preventDefault(), !(!d || l.isPending) && l.mutate(
2306
2392
  { language_iso: d },
2307
2393
  {
2308
- onSuccess: () => oe({ title: i("profile_updated"), type: "success" })
2394
+ onSuccess: () => ue({ title: i("profile_updated"), type: "success" })
2309
2395
  }
2310
2396
  );
2311
2397
  },
2312
2398
  children: [
2313
- /* @__PURE__ */ a.jsxs("div", { className: "space-y-2", children: [
2314
- /* @__PURE__ */ a.jsx(wt, { htmlFor: "profile-language", children: i("language") }),
2315
- /* @__PURE__ */ a.jsx("p", { className: "text-muted-foreground text-sm", children: i("profile_language_hint") }),
2316
- /* @__PURE__ */ a.jsxs(
2399
+ /* @__PURE__ */ n.jsxs("div", { className: "space-y-2", children: [
2400
+ /* @__PURE__ */ n.jsx(Ct, { htmlFor: "profile-language", children: i("language") }),
2401
+ /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-sm", children: i("profile_language_hint") }),
2402
+ /* @__PURE__ */ n.jsxs(
2317
2403
  "select",
2318
2404
  {
2319
2405
  id: "profile-language",
2320
2406
  className: "border-input bg-background text-foreground focus-visible:ring-ring h-10 w-full rounded-md border px-3 text-sm focus-visible:ring-2",
2321
2407
  value: d,
2322
- onChange: (h) => u(h.target.value),
2408
+ onChange: (p) => u(p.target.value),
2323
2409
  disabled: t.isPending || l.isPending,
2324
2410
  required: !0,
2325
2411
  children: [
2326
- /* @__PURE__ */ a.jsx("option", { value: "", children: i("select_an_option") }),
2327
- t.data?.map((h) => /* @__PURE__ */ a.jsx("option", { value: h.code, children: h.name }, h.code))
2412
+ /* @__PURE__ */ n.jsx("option", { value: "", children: i("select_an_option") }),
2413
+ t.data?.map((p) => /* @__PURE__ */ n.jsx("option", { value: p.code, children: p.name }, p.code))
2328
2414
  ]
2329
2415
  }
2330
2416
  )
2331
2417
  ] }),
2332
- l.error && /* @__PURE__ */ a.jsx("p", { role: "alert", className: "text-destructive text-sm", children: i("failed_to_update_profile") }),
2333
- /* @__PURE__ */ a.jsx(
2334
- P,
2418
+ l.error && /* @__PURE__ */ n.jsx("p", { role: "alert", className: "text-destructive text-sm", children: i("failed_to_update_profile") }),
2419
+ /* @__PURE__ */ n.jsx(
2420
+ E,
2335
2421
  {
2336
2422
  type: "submit",
2337
2423
  disabled: !d || t.isPending || l.isPending,
@@ -2342,113 +2428,113 @@ function an({
2342
2428
  }
2343
2429
  );
2344
2430
  }
2345
- function on() {
2346
- const { t: e } = M(), i = Pe(), t = ce(), { currentSlug: l, navigate: d } = ie(), { preview: u } = le(), h = st(), { locale: p } = D(), s = v.useRef(""), r = v.useRef({});
2431
+ function ln() {
2432
+ const { t: e } = R(), i = Ae(), t = me(), { currentSlug: l, navigate: d } = de(), { preview: u } = fe(), p = at(), { locale: g } = T(), a = v.useRef(""), r = v.useRef({});
2347
2433
  if (i.error) throw i.error;
2348
2434
  if (t.error) throw t.error;
2349
2435
  if (!i.data || !t.data)
2350
- return /* @__PURE__ */ a.jsx("p", { role: "status", className: "text-muted-foreground p-6", children: e("profile_loading") });
2351
- const n = i.data, o = `${n.first_name} ${n.last_name}`.trim() || e("account_fallback"), c = Cr(n), f = l === "profile/language", m = l === "profile/addresses", g = l === "profile/payment-methods", x = l === "profile/points", N = l === "profile/orders" || l.startsWith("profile/orders/"), j = l === "profile/subscriptions" || l.startsWith("profile/subscriptions/"), _ = N || j, w = l === "profile/orders" || l === "profile/subscriptions", E = t.data.reward_points_label_plural, I = E.charAt(0).toLocaleUpperCase(p) + E.slice(1), A = [
2436
+ return /* @__PURE__ */ n.jsx("p", { role: "status", className: "text-muted-foreground p-6", children: e("profile_loading") });
2437
+ const s = i.data, o = `${s.first_name} ${s.last_name}`.trim() || e("account_fallback"), c = Nr(s), m = l === "profile/language", f = l === "profile/addresses", h = l === "profile/payment-methods", x = l === "profile/points", N = l === "profile/orders" || l.startsWith("profile/orders/"), C = l === "profile/subscriptions" || l.startsWith("profile/subscriptions/"), _ = N || C, w = l === "profile/orders" || l === "profile/subscriptions", M = t.data.reward_points_label_plural, k = M.charAt(0).toLocaleUpperCase(g) + M.slice(1), z = [
2352
2438
  {
2353
2439
  slug: "profile/information",
2354
2440
  label: e("personal_information"),
2355
- icon: or,
2441
+ icon: lr,
2356
2442
  dialog: !0
2357
2443
  },
2358
2444
  {
2359
2445
  slug: "profile/payment-methods",
2360
2446
  label: e("payment_methods"),
2361
- icon: Ie
2447
+ icon: ke
2362
2448
  },
2363
- { slug: "profile/addresses", label: e("shipping_addresses"), icon: Zt },
2449
+ { slug: "profile/addresses", label: e("shipping_addresses"), icon: Jt },
2364
2450
  {
2365
2451
  slug: "orders",
2366
2452
  label: e("orders"),
2367
- icon: Le
2453
+ icon: Ie
2368
2454
  },
2369
2455
  {
2370
2456
  slug: "subscriptions",
2371
2457
  label: e("subscriptions"),
2372
- icon: ke
2458
+ icon: De
2373
2459
  },
2374
2460
  {
2375
2461
  slug: "profile/language",
2376
2462
  label: e("language"),
2377
- icon: rr,
2378
- value: n.language_iso?.toUpperCase()
2463
+ icon: nr,
2464
+ value: s.language_iso?.toUpperCase()
2379
2465
  },
2380
- ...h.data ? [
2466
+ ...p.data ? [
2381
2467
  {
2382
2468
  slug: "profile/points",
2383
- label: I,
2384
- icon: ar,
2385
- value: new Intl.NumberFormat(p).format(
2386
- h.data.points_ledgers[0]?.total_balance ?? 0
2469
+ label: k,
2470
+ icon: ir,
2471
+ value: new Intl.NumberFormat(g).format(
2472
+ p.data.points_ledgers[0]?.total_balance ?? 0
2387
2473
  )
2388
2474
  }
2389
2475
  ] : []
2390
2476
  ];
2391
- function L() {
2392
- const y = s.current || l;
2477
+ function F() {
2478
+ const y = a.current || l;
2393
2479
  d("profile"), requestAnimationFrame(
2394
2480
  () => (r.current[y] ?? r.current[l])?.focus()
2395
2481
  );
2396
2482
  }
2397
- return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
2398
- /* @__PURE__ */ a.jsx(Ct, { children: /* @__PURE__ */ a.jsx("span", { className: "text-lg font-semibold", children: e("breadcrumb") }) }),
2399
- _ ? /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
2400
- w && /* @__PURE__ */ a.jsx("div", { className: "px-5 pt-6 md:px-8", children: /* @__PURE__ */ a.jsxs(P, { variant: "ghost", onClick: L, children: [
2401
- /* @__PURE__ */ a.jsx(je, { "aria-hidden": "true", className: "size-4" }),
2483
+ return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
2484
+ /* @__PURE__ */ n.jsx(Nt, { children: /* @__PURE__ */ n.jsx("span", { className: "text-lg font-semibold", children: e("breadcrumb") }) }),
2485
+ _ ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
2486
+ w && /* @__PURE__ */ n.jsx("div", { className: "px-5 pt-6 md:px-8", children: /* @__PURE__ */ n.jsxs(E, { variant: "ghost", onClick: F, children: [
2487
+ /* @__PURE__ */ n.jsx(we, { "aria-hidden": "true", className: "size-4" }),
2402
2488
  e("profile_back")
2403
2489
  ] }) }),
2404
- /* @__PURE__ */ a.jsx(Or, { children: N ? /* @__PURE__ */ a.jsx(At, {}) : /* @__PURE__ */ a.jsx(kr, {}) })
2405
- ] }) : /* @__PURE__ */ a.jsxs("main", { className: "mx-auto w-full max-w-3xl space-y-8 p-4 sm:p-8", children: [
2406
- f || m || x || g ? /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
2407
- /* @__PURE__ */ a.jsxs(P, { variant: "ghost", onClick: L, children: [
2408
- /* @__PURE__ */ a.jsx(je, { "aria-hidden": "true", className: "size-4" }),
2490
+ /* @__PURE__ */ n.jsx(zr, { children: N ? /* @__PURE__ */ n.jsx(Mt, {}) : /* @__PURE__ */ n.jsx(Dr, {}) })
2491
+ ] }) : /* @__PURE__ */ n.jsxs("main", { className: "mx-auto w-full max-w-3xl space-y-8 p-4 sm:p-8", children: [
2492
+ m || f || x || h ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
2493
+ /* @__PURE__ */ n.jsxs(E, { variant: "ghost", onClick: F, children: [
2494
+ /* @__PURE__ */ n.jsx(we, { "aria-hidden": "true", className: "size-4" }),
2409
2495
  e("profile_back")
2410
2496
  ] }),
2411
- /* @__PURE__ */ a.jsx("h1", { className: "text-2xl font-semibold", children: x ? I : e(
2412
- g ? "payment_methods" : m ? "shipping_addresses" : "language"
2497
+ /* @__PURE__ */ n.jsx("h1", { className: "text-2xl font-semibold", children: x ? k : e(
2498
+ h ? "payment_methods" : f ? "shipping_addresses" : "language"
2413
2499
  ) }),
2414
- g ? /* @__PURE__ */ a.jsx(Gr, {}) : m ? /* @__PURE__ */ a.jsx(Ur, {}) : x ? /* @__PURE__ */ a.jsx($r, {}) : /* @__PURE__ */ a.jsx(an, { initialLanguage: n.language_iso ?? "" })
2415
- ] }) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
2416
- /* @__PURE__ */ a.jsxs(
2500
+ h ? /* @__PURE__ */ n.jsx(Yr, {}) : f ? /* @__PURE__ */ n.jsx($r, {}) : x ? /* @__PURE__ */ n.jsx(qr, {}) : /* @__PURE__ */ n.jsx(on, { initialLanguage: s.language_iso ?? "" })
2501
+ ] }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
2502
+ /* @__PURE__ */ n.jsxs(
2417
2503
  "section",
2418
2504
  {
2419
2505
  "aria-label": e("personal_information"),
2420
2506
  className: c ? "bg-card text-card-foreground border-border rounded-2xl border p-6" : "py-4",
2421
2507
  children: [
2422
- /* @__PURE__ */ a.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-4 sm:gap-6", children: [
2423
- /* @__PURE__ */ a.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
2424
- /* @__PURE__ */ a.jsxs(br, { className: "size-12 shrink-0 sm:size-16", children: [
2425
- /* @__PURE__ */ a.jsx(
2508
+ /* @__PURE__ */ n.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-4 sm:gap-6", children: [
2509
+ /* @__PURE__ */ n.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
2510
+ /* @__PURE__ */ n.jsxs(vr, { className: "size-12 shrink-0 sm:size-16", children: [
2511
+ /* @__PURE__ */ n.jsx(
2426
2512
  yr,
2427
2513
  {
2428
- src: n.avatar_url ?? void 0,
2514
+ src: s.avatar_url ?? void 0,
2429
2515
  alt: ""
2430
2516
  }
2431
2517
  ),
2432
- /* @__PURE__ */ a.jsx(vr, { children: `${n.first_name[0] ?? ""}${n.last_name[0] ?? ""}` })
2518
+ /* @__PURE__ */ n.jsx(jr, { children: `${s.first_name[0] ?? ""}${s.last_name[0] ?? ""}` })
2433
2519
  ] }),
2434
- /* @__PURE__ */ a.jsxs("div", { className: "min-w-0 space-y-1", children: [
2435
- c && /* @__PURE__ */ a.jsx("p", { className: "text-muted-foreground text-xs font-medium", children: e("member_of", { company: t.data.name }) }),
2436
- /* @__PURE__ */ a.jsx("h1", { className: "text-xl font-semibold tracking-tight break-words sm:text-2xl", children: o }),
2437
- /* @__PURE__ */ a.jsx("p", { className: "text-muted-foreground text-sm break-all", children: n.email })
2520
+ /* @__PURE__ */ n.jsxs("div", { className: "min-w-0 space-y-1", children: [
2521
+ c && /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-xs font-medium", children: e("member_of", { company: t.data.name }) }),
2522
+ /* @__PURE__ */ n.jsx("h1", { className: "text-xl font-semibold tracking-tight break-words sm:text-2xl", children: o }),
2523
+ /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-sm break-all", children: s.email })
2438
2524
  ] })
2439
2525
  ] }),
2440
- c && n.mysite_url && /* @__PURE__ */ a.jsx(
2526
+ c && s.mysite_url && /* @__PURE__ */ n.jsx(
2441
2527
  "a",
2442
2528
  {
2443
- href: n.mysite_url,
2529
+ href: s.mysite_url,
2444
2530
  target: "_blank",
2445
2531
  rel: "noopener noreferrer",
2446
2532
  "aria-label": e("profile_qr_code"),
2447
2533
  className: "bg-background text-foreground border-border focus-visible:ring-ring rounded-lg border p-2 focus-visible:ring-2",
2448
- children: /* @__PURE__ */ a.jsx(
2449
- Je,
2534
+ children: /* @__PURE__ */ n.jsx(
2535
+ et,
2450
2536
  {
2451
- value: n.mysite_url,
2537
+ value: s.mysite_url,
2452
2538
  size: 80,
2453
2539
  bgColor: "var(--background)",
2454
2540
  fgColor: "var(--foreground)"
@@ -2457,17 +2543,17 @@ function on() {
2457
2543
  }
2458
2544
  )
2459
2545
  ] }),
2460
- n.bio && /* @__PURE__ */ a.jsx("p", { className: "text-muted-foreground mt-5 text-sm leading-relaxed", children: n.bio })
2546
+ s.bio && /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground mt-5 text-sm leading-relaxed", children: s.bio })
2461
2547
  ]
2462
2548
  }
2463
2549
  ),
2464
- /* @__PURE__ */ a.jsxs(
2550
+ /* @__PURE__ */ n.jsxs(
2465
2551
  "section",
2466
2552
  {
2467
2553
  "aria-labelledby": "profile-preferences",
2468
2554
  className: "space-y-3",
2469
2555
  children: [
2470
- /* @__PURE__ */ a.jsx(
2556
+ /* @__PURE__ */ n.jsx(
2471
2557
  "h2",
2472
2558
  {
2473
2559
  id: "profile-preferences",
@@ -2475,25 +2561,25 @@ function on() {
2475
2561
  children: e("account_preferences")
2476
2562
  }
2477
2563
  ),
2478
- /* @__PURE__ */ a.jsx("div", { className: "border-border divide-border divide-y overflow-hidden rounded-xl border", children: A.map((y) => /* @__PURE__ */ a.jsxs(
2564
+ /* @__PURE__ */ n.jsx("div", { className: "border-border divide-border divide-y overflow-hidden rounded-xl border", children: z.map((y) => /* @__PURE__ */ n.jsxs(
2479
2565
  "button",
2480
2566
  {
2481
2567
  type: "button",
2482
- ref: (Q) => {
2483
- r.current[y.slug] = Q;
2568
+ ref: (D) => {
2569
+ r.current[y.slug] = D;
2484
2570
  },
2485
2571
  "aria-haspopup": y.dialog ? "dialog" : void 0,
2486
2572
  "aria-expanded": y.dialog ? l === y.slug : void 0,
2487
2573
  onClick: () => {
2488
- s.current = y.slug, d(y.slug);
2574
+ a.current = y.slug, d(y.slug);
2489
2575
  },
2490
2576
  className: "bg-card text-card-foreground hover:bg-muted focus-visible:ring-ring flex min-h-16 w-full items-center gap-4 px-5 py-4 text-left focus-visible:ring-2",
2491
2577
  children: [
2492
- /* @__PURE__ */ a.jsx(y.icon, { "aria-hidden": "true", className: "size-5" }),
2493
- /* @__PURE__ */ a.jsx("span", { className: "flex-1 font-medium", children: y.label }),
2494
- y.value && /* @__PURE__ */ a.jsx("span", { className: "text-muted-foreground text-sm tabular-nums", children: y.value }),
2495
- /* @__PURE__ */ a.jsx(
2496
- Ae,
2578
+ /* @__PURE__ */ n.jsx(y.icon, { "aria-hidden": "true", className: "size-5" }),
2579
+ /* @__PURE__ */ n.jsx("span", { className: "flex-1 font-medium", children: y.label }),
2580
+ y.value && /* @__PURE__ */ n.jsx("span", { className: "text-muted-foreground text-sm tabular-nums", children: y.value }),
2581
+ /* @__PURE__ */ n.jsx(
2582
+ Me,
2497
2583
  {
2498
2584
  "aria-hidden": "true",
2499
2585
  className: "text-muted-foreground size-4"
@@ -2506,44 +2592,44 @@ function on() {
2506
2592
  ]
2507
2593
  }
2508
2594
  ),
2509
- /* @__PURE__ */ a.jsx(
2510
- sn,
2595
+ /* @__PURE__ */ n.jsx(
2596
+ an,
2511
2597
  {
2512
2598
  paymentTriggerRef: (y) => {
2513
2599
  r.current["profile/default-payment"] = y;
2514
2600
  },
2515
2601
  onOpenPayment: () => {
2516
- s.current = "profile/default-payment", d("profile/payment-methods");
2602
+ a.current = "profile/default-payment", d("profile/payment-methods");
2517
2603
  },
2518
2604
  orderTriggerRef: (y) => {
2519
2605
  r.current["profile/latest-order"] = y;
2520
2606
  },
2521
2607
  onOpenOrder: (y) => {
2522
- s.current = "profile/latest-order", d(y ? `orders/${y}` : "orders");
2608
+ a.current = "profile/latest-order", d(y ? `orders/${y}` : "orders");
2523
2609
  },
2524
2610
  subscriptionTriggerRef: (y) => {
2525
2611
  r.current["profile/next-subscription"] = y;
2526
2612
  },
2527
2613
  onOpenSubscription: (y) => {
2528
- s.current = "profile/next-subscription", d(y ? `subscriptions/${y}` : "subscriptions");
2614
+ a.current = "profile/next-subscription", d(y ? `subscriptions/${y}` : "subscriptions");
2529
2615
  }
2530
2616
  }
2531
2617
  ),
2532
- h.error && /* @__PURE__ */ a.jsxs(
2618
+ p.error && /* @__PURE__ */ n.jsxs(
2533
2619
  "div",
2534
2620
  {
2535
2621
  role: "alert",
2536
2622
  className: "border-border space-y-3 rounded-xl border p-4",
2537
2623
  children: [
2538
- /* @__PURE__ */ a.jsx("p", { className: "text-sm", children: e("profile_points_load_failed") }),
2539
- /* @__PURE__ */ a.jsx(
2540
- P,
2624
+ /* @__PURE__ */ n.jsx("p", { className: "text-sm", children: e("profile_points_load_failed") }),
2625
+ /* @__PURE__ */ n.jsx(
2626
+ E,
2541
2627
  {
2542
2628
  variant: "outline",
2543
2629
  size: "sm",
2544
- disabled: h.isFetching,
2630
+ disabled: p.isFetching,
2545
2631
  onClick: () => {
2546
- h.refetch().then((y) => {
2632
+ p.refetch().then((y) => {
2547
2633
  y.isSuccess && requestAnimationFrame(
2548
2634
  () => (r.current["profile/points"] ?? r.current["profile/information"])?.focus()
2549
2635
  );
@@ -2555,7 +2641,7 @@ function on() {
2555
2641
  ]
2556
2642
  }
2557
2643
  ),
2558
- /* @__PURE__ */ a.jsxs(
2644
+ /* @__PURE__ */ n.jsxs(
2559
2645
  "a",
2560
2646
  {
2561
2647
  href: u ? void 0 : new URL("/auth/sign_out", window.location.origin).href,
@@ -2563,19 +2649,19 @@ function on() {
2563
2649
  tabIndex: u ? -1 : void 0,
2564
2650
  className: "text-muted-foreground hover:text-foreground focus-visible:ring-ring flex min-h-11 items-center gap-3 rounded-md px-1 text-sm focus-visible:ring-2",
2565
2651
  children: [
2566
- /* @__PURE__ */ a.jsx(Jt, { "aria-hidden": "true", className: "size-4" }),
2652
+ /* @__PURE__ */ n.jsx(er, { "aria-hidden": "true", className: "size-4" }),
2567
2653
  e("sign_out")
2568
2654
  ]
2569
2655
  }
2570
2656
  )
2571
2657
  ] }),
2572
- l === "profile/information" && /* @__PURE__ */ a.jsx(zr, { account: n, onClose: L })
2658
+ l === "profile/information" && /* @__PURE__ */ n.jsx(Tr, { account: s, onClose: F })
2573
2659
  ] })
2574
2660
  ] });
2575
2661
  }
2576
- function wn() {
2577
- return /* @__PURE__ */ a.jsx(Pt, { children: /* @__PURE__ */ a.jsx(on, {}) });
2662
+ function Cn() {
2663
+ return /* @__PURE__ */ n.jsx(At, { children: /* @__PURE__ */ n.jsx(ln, {}) });
2578
2664
  }
2579
2665
  export {
2580
- wn as default
2666
+ Cn as default
2581
2667
  };