@burdenoff/microfe-billing 2026.914.1 → 2026.915.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  import { useCreateShippingAddress as e, useEstimateOrderShipping as t, useMyShippingAddresses as n, useShippingMethods as r } from "../hooks/useStoreShipping.js";
2
2
  import { useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
3
- import { Check as c, Loader2 as l, MapPin as u, Plus as d, Truck as f, X as p } from "lucide-react";
4
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
3
+ import { AlertTriangle as c, Check as l, Loader2 as u, MapPin as d, Plus as f, Truck as p, X as m } from "lucide-react";
4
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
5
5
  //#region src/billing/modules/checkout/components/StoreShippingSection.tsx
6
- var _ = [
6
+ var ee = [
7
7
  {
8
8
  value: "IN",
9
9
  label: "India"
@@ -67,131 +67,131 @@ function b(e, t) {
67
67
  return n == null ? null : `${n} days`;
68
68
  }
69
69
  var x = ({ storeOrderId: x, currency: S, onChange: C }) => {
70
- let { addresses: w, loading: T, refetch: E } = n(), { createShippingAddress: D, loading: O } = e(), { methods: k, loading: ee } = r(), [A, { data: j, loading: M }] = t(), [N, P] = s(null), [F, I] = s(null), [L, R] = s(!1), [z, B] = s(v), [V, H] = s({}), [U, W] = s(null), G = o(C);
70
+ let { addresses: w, loading: T, refetch: E } = n(), { createShippingAddress: D, loading: O } = e(), { methods: k, loading: A } = r(), [j, { data: M, loading: N, error: P }] = t(), [F, I] = s(null), [L, R] = s(null), [z, B] = s(!1), [V, H] = s(v), [U, W] = s({}), [G, K] = s(null), q = o(C);
71
71
  i(() => {
72
- G.current = C;
72
+ q.current = C;
73
73
  });
74
- let K = a(() => w.find((e) => e.id === N), [w, N]), q = a(() => {
75
- if (!K) return [];
76
- let e = K.country;
74
+ let J = a(() => w.find((e) => e.id === F), [w, F]), Y = a(() => {
75
+ if (!J) return [];
76
+ let e = J.country;
77
77
  return k.filter((t) => t.isActive && (t.availableCountries.length === 0 || t.availableCountries.includes(e)) && !t.excludedCountries.includes(e)).sort((e, t) => e.displayOrder - t.displayOrder);
78
- }, [k, K]);
78
+ }, [k, J]);
79
79
  i(() => {
80
- !N && w.length > 0 && P((w.find((e) => e.isDefault) ?? w[0]).id);
81
- }, [w, N]), i(() => {
82
- F && !q.some((e) => e.id === F) && I(null);
83
- }, [q, F]), i(() => {
84
- !F && q.length === 1 && I(q[0].id);
85
- }, [q, F]), i(() => {
86
- K && F && A({ variables: { input: {
80
+ !F && w.length > 0 && I((w.find((e) => e.isDefault) ?? w[0]).id);
81
+ }, [w, F]), i(() => {
82
+ L && !Y.some((e) => e.id === L) && R(null);
83
+ }, [Y, L]), i(() => {
84
+ !L && Y.length === 1 && R(Y[0].id);
85
+ }, [Y, L]), i(() => {
86
+ J && L && j({ variables: { input: {
87
87
  orderId: x,
88
- shippingMethodId: F,
89
- destinationCountry: K.country,
90
- destinationPostalCode: K.postalCode
88
+ shippingMethodId: L,
89
+ destinationCountry: J.country,
90
+ destinationPostalCode: J.postalCode
91
91
  } } });
92
92
  }, [
93
- K?.id,
94
- K?.country,
95
- K?.postalCode,
96
- F,
93
+ J?.id,
94
+ J?.country,
95
+ J?.postalCode,
96
+ L,
97
97
  x,
98
- A,
99
- K
98
+ j,
99
+ J
100
100
  ]);
101
- let J = j?.estimateOrderShipping, Y = !!(N && F && !M && J && J.shippingMethodId === F);
101
+ let X = M?.estimateOrderShipping, Z = !!(F && L && !N && X && X.shippingMethodId === L);
102
102
  i(() => {
103
- G.current({
104
- shippingAddressId: N,
105
- shippingMethodId: Y ? F : null,
106
- shippingCost: Y && J ? J.cost : 0,
107
- destinationCountry: K?.country ?? null
103
+ q.current({
104
+ shippingAddressId: F,
105
+ shippingMethodId: Z ? L : null,
106
+ shippingCost: Z && X ? X.cost : 0,
107
+ destinationCountry: J?.country ?? null
108
108
  });
109
109
  }, [
110
- N,
111
110
  F,
112
- Y,
113
- J?.cost,
114
- K?.country
111
+ L,
112
+ Z,
113
+ X?.cost,
114
+ J?.country
115
115
  ]);
116
- let X = (e, t) => B((n) => ({
116
+ let Q = (e, t) => H((n) => ({
117
117
  ...n,
118
118
  [e]: t
119
- })), Z = () => {
119
+ })), te = () => {
120
120
  let e = {};
121
- return z.fullName.trim() || (e.fullName = "Recipient name is required"), z.addressLine1.trim() || (e.addressLine1 = "Street address is required"), z.city.trim() || (e.city = "City is required"), z.postalCode.trim() || (e.postalCode = "Postal code is required"), z.country.trim() || (e.country = "Country is required"), H(e), Object.keys(e).length === 0;
122
- }, Q = async () => {
123
- if (Z()) {
124
- W(null);
121
+ return V.fullName.trim() || (e.fullName = "Recipient name is required"), V.addressLine1.trim() || (e.addressLine1 = "Street address is required"), V.city.trim() || (e.city = "City is required"), V.postalCode.trim() || (e.postalCode = "Postal code is required"), V.country.trim() || (e.country = "Country is required"), W(e), Object.keys(e).length === 0;
122
+ }, ne = async () => {
123
+ if (te()) {
124
+ K(null);
125
125
  try {
126
126
  let e = await D({
127
- fullName: z.fullName.trim(),
128
- ...z.phone.trim() ? { phone: z.phone.trim() } : {},
129
- addressLine1: z.addressLine1.trim(),
130
- ...z.addressLine2.trim() ? { addressLine2: z.addressLine2.trim() } : {},
131
- city: z.city.trim(),
132
- ...z.state.trim() ? { state: z.state.trim() } : {},
133
- postalCode: z.postalCode.trim(),
134
- country: z.country,
127
+ fullName: V.fullName.trim(),
128
+ ...V.phone.trim() ? { phone: V.phone.trim() } : {},
129
+ addressLine1: V.addressLine1.trim(),
130
+ ...V.addressLine2.trim() ? { addressLine2: V.addressLine2.trim() } : {},
131
+ city: V.city.trim(),
132
+ ...V.state.trim() ? { state: V.state.trim() } : {},
133
+ postalCode: V.postalCode.trim(),
134
+ country: V.country,
135
135
  isDefault: w.length === 0
136
136
  });
137
137
  if (!e) {
138
- W("Failed to save address. Please try again.");
138
+ K("Failed to save address. Please try again.");
139
139
  return;
140
140
  }
141
- await E(), P(e.id), I(null), B(v), H({}), R(!1);
141
+ await E(), I(e.id), R(null), H(v), W({}), B(!1);
142
142
  } catch {
143
- W("Failed to save address. Please try again.");
143
+ K("Failed to save address. Please try again.");
144
144
  }
145
145
  }
146
146
  }, $ = (e) => `w-full px-3 py-2 text-sm border rounded-input bg-bg-surface text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${e ? "border-status-error-border" : "border-border-subtle"}`;
147
- return /* @__PURE__ */ g("div", {
147
+ return /* @__PURE__ */ _("div", {
148
148
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 sm:p-6 space-y-5",
149
149
  children: [
150
- /* @__PURE__ */ g("div", {
150
+ /* @__PURE__ */ _("div", {
151
151
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
152
- children: [/* @__PURE__ */ h(f, { className: "size-4 text-text-secondary" }), "Shipping"]
152
+ children: [/* @__PURE__ */ g(p, { className: "size-4 text-text-secondary" }), "Shipping"]
153
153
  }),
154
- /* @__PURE__ */ g("section", {
154
+ /* @__PURE__ */ _("section", {
155
155
  className: "space-y-3",
156
156
  children: [
157
- /* @__PURE__ */ g("div", {
157
+ /* @__PURE__ */ _("div", {
158
158
  className: "flex items-center justify-between",
159
- children: [/* @__PURE__ */ g("div", {
159
+ children: [/* @__PURE__ */ _("div", {
160
160
  className: "flex items-center gap-2 text-sm font-medium text-text-primary",
161
- children: [/* @__PURE__ */ h(u, { className: "size-4 text-text-secondary" }), "Delivery address"]
162
- }), !L && /* @__PURE__ */ g("button", {
161
+ children: [/* @__PURE__ */ g(d, { className: "size-4 text-text-secondary" }), "Delivery address"]
162
+ }), !z && /* @__PURE__ */ _("button", {
163
163
  type: "button",
164
164
  onClick: () => {
165
- R(!0), W(null);
165
+ B(!0), K(null);
166
166
  },
167
167
  className: "inline-flex items-center gap-1 text-xs font-medium text-text-link hover:underline",
168
- children: [/* @__PURE__ */ h(d, { className: "size-3.5" }), "Add address"]
168
+ children: [/* @__PURE__ */ g(f, { className: "size-3.5" }), "Add address"]
169
169
  })]
170
170
  }),
171
- T && w.length === 0 ? /* @__PURE__ */ g("div", {
171
+ T && w.length === 0 ? /* @__PURE__ */ _("div", {
172
172
  className: "flex items-center gap-2 text-sm text-text-secondary",
173
- children: [/* @__PURE__ */ h(l, { className: "size-4 animate-spin" }), "Loading addresses…"]
174
- }) : /* @__PURE__ */ g(m, { children: [w.length === 0 && !L && /* @__PURE__ */ h("p", {
173
+ children: [/* @__PURE__ */ g(u, { className: "size-4 animate-spin" }), "Loading addresses…"]
174
+ }) : /* @__PURE__ */ _(h, { children: [w.length === 0 && !z && /* @__PURE__ */ g("p", {
175
175
  className: "text-sm text-text-secondary",
176
176
  children: "No saved delivery addresses yet. Add one to continue."
177
- }), w.length > 0 && /* @__PURE__ */ h("div", {
177
+ }), w.length > 0 && /* @__PURE__ */ g("div", {
178
178
  className: "space-y-2",
179
179
  children: w.map((e) => {
180
- let t = e.id === N;
181
- return /* @__PURE__ */ h("button", {
180
+ let t = e.id === F;
181
+ return /* @__PURE__ */ g("button", {
182
182
  type: "button",
183
183
  onClick: () => {
184
- P(e.id), I(null);
184
+ I(e.id), R(null);
185
185
  },
186
186
  className: `w-full text-left p-3 rounded-input border transition-colors ${t ? "border-action-primary-bg bg-bg-sunken" : "border-border-subtle hover:bg-bg-sunken"}`,
187
- children: /* @__PURE__ */ g("div", {
187
+ children: /* @__PURE__ */ _("div", {
188
188
  className: "flex items-start justify-between gap-2",
189
- children: [/* @__PURE__ */ g("div", {
189
+ children: [/* @__PURE__ */ _("div", {
190
190
  className: "text-sm",
191
191
  children: [
192
- /* @__PURE__ */ g("p", {
192
+ /* @__PURE__ */ _("p", {
193
193
  className: "font-medium text-text-primary",
194
- children: [e.fullName, e.label ? /* @__PURE__ */ g("span", {
194
+ children: [e.fullName, e.label ? /* @__PURE__ */ _("span", {
195
195
  className: "ml-2 text-xs text-text-muted",
196
196
  children: [
197
197
  "(",
@@ -200,7 +200,7 @@ var x = ({ storeOrderId: x, currency: S, onChange: C }) => {
200
200
  ]
201
201
  }) : null]
202
202
  }),
203
- /* @__PURE__ */ h("p", {
203
+ /* @__PURE__ */ g("p", {
204
204
  className: "text-text-secondary text-xs mt-0.5",
205
205
  children: [
206
206
  e.addressLine1,
@@ -211,253 +211,267 @@ var x = ({ storeOrderId: x, currency: S, onChange: C }) => {
211
211
  e.country
212
212
  ].filter(Boolean).join(", ")
213
213
  }),
214
- e.phone && /* @__PURE__ */ h("p", {
214
+ e.phone && /* @__PURE__ */ g("p", {
215
215
  className: "text-text-muted text-xs mt-0.5",
216
216
  children: e.phone
217
217
  })
218
218
  ]
219
- }), t && /* @__PURE__ */ h(c, { className: "size-4 text-action-primary-bg shrink-0 mt-0.5" })]
219
+ }), t && /* @__PURE__ */ g(l, { className: "size-4 text-action-primary-bg shrink-0 mt-0.5" })]
220
220
  })
221
221
  }, e.id);
222
222
  })
223
223
  })] }),
224
- L && /* @__PURE__ */ g("div", {
224
+ z && /* @__PURE__ */ _("div", {
225
225
  className: "rounded-input border border-border-subtle p-3 space-y-3 bg-bg-sunken",
226
226
  children: [
227
- /* @__PURE__ */ g("div", {
227
+ /* @__PURE__ */ _("div", {
228
228
  className: "flex items-center justify-between",
229
- children: [/* @__PURE__ */ h("span", {
229
+ children: [/* @__PURE__ */ g("span", {
230
230
  className: "text-sm font-medium text-text-primary",
231
231
  children: "New delivery address"
232
- }), /* @__PURE__ */ h("button", {
232
+ }), /* @__PURE__ */ g("button", {
233
233
  type: "button",
234
234
  onClick: () => {
235
- R(!1), H({}), W(null);
235
+ B(!1), W({}), K(null);
236
236
  },
237
237
  className: "p-1 text-text-secondary hover:text-text-primary rounded-button",
238
- children: /* @__PURE__ */ h(p, { className: "size-4" })
238
+ children: /* @__PURE__ */ g(m, { className: "size-4" })
239
239
  })]
240
240
  }),
241
- U && /* @__PURE__ */ h("div", {
241
+ G && /* @__PURE__ */ g("div", {
242
242
  className: "p-2 rounded-lg bg-status-error-bg-subtle border border-status-error-border text-xs text-status-error-text",
243
- children: U
243
+ children: G
244
244
  }),
245
- /* @__PURE__ */ g("div", { children: [
246
- /* @__PURE__ */ h("label", {
245
+ /* @__PURE__ */ _("div", { children: [
246
+ /* @__PURE__ */ g("label", {
247
247
  className: "block text-xs text-text-secondary mb-1",
248
248
  children: "Recipient name"
249
249
  }),
250
- /* @__PURE__ */ h("input", {
250
+ /* @__PURE__ */ g("input", {
251
251
  type: "text",
252
- value: z.fullName,
253
- onChange: (e) => X("fullName", e.target.value),
252
+ value: V.fullName,
253
+ onChange: (e) => Q("fullName", e.target.value),
254
254
  placeholder: "Jane Doe",
255
- className: $(!!V.fullName)
255
+ className: $(!!U.fullName)
256
256
  }),
257
- V.fullName && /* @__PURE__ */ h("p", {
257
+ U.fullName && /* @__PURE__ */ g("p", {
258
258
  className: "mt-1 text-xs text-status-error-text",
259
- children: V.fullName
259
+ children: U.fullName
260
260
  })
261
261
  ] }),
262
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
262
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
263
263
  className: "block text-xs text-text-secondary mb-1",
264
- children: ["Phone ", /* @__PURE__ */ h("span", {
264
+ children: ["Phone ", /* @__PURE__ */ g("span", {
265
265
  className: "text-text-muted",
266
266
  children: "(optional)"
267
267
  })]
268
- }), /* @__PURE__ */ h("input", {
268
+ }), /* @__PURE__ */ g("input", {
269
269
  type: "tel",
270
- value: z.phone,
271
- onChange: (e) => X("phone", e.target.value),
270
+ value: V.phone,
271
+ onChange: (e) => Q("phone", e.target.value),
272
272
  placeholder: "+91 98765 43210",
273
273
  className: $(!1)
274
274
  })] }),
275
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
275
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
276
276
  className: "block text-xs text-text-secondary mb-1",
277
277
  children: "Country"
278
- }), /* @__PURE__ */ h("select", {
279
- value: z.country,
280
- onChange: (e) => X("country", e.target.value),
281
- className: $(!!V.country),
282
- children: _.map((e) => /* @__PURE__ */ h("option", {
278
+ }), /* @__PURE__ */ g("select", {
279
+ value: V.country,
280
+ onChange: (e) => Q("country", e.target.value),
281
+ className: $(!!U.country),
282
+ children: ee.map((e) => /* @__PURE__ */ g("option", {
283
283
  value: e.value,
284
284
  children: e.label
285
285
  }, e.value))
286
286
  })] }),
287
- /* @__PURE__ */ g("div", { children: [
288
- /* @__PURE__ */ h("label", {
287
+ /* @__PURE__ */ _("div", { children: [
288
+ /* @__PURE__ */ g("label", {
289
289
  className: "block text-xs text-text-secondary mb-1",
290
290
  children: "Street address"
291
291
  }),
292
- /* @__PURE__ */ h("input", {
292
+ /* @__PURE__ */ g("input", {
293
293
  type: "text",
294
- value: z.addressLine1,
295
- onChange: (e) => X("addressLine1", e.target.value),
294
+ value: V.addressLine1,
295
+ onChange: (e) => Q("addressLine1", e.target.value),
296
296
  placeholder: "123 Main St",
297
- className: $(!!V.addressLine1)
297
+ className: $(!!U.addressLine1)
298
298
  }),
299
- V.addressLine1 && /* @__PURE__ */ h("p", {
299
+ U.addressLine1 && /* @__PURE__ */ g("p", {
300
300
  className: "mt-1 text-xs text-status-error-text",
301
- children: V.addressLine1
301
+ children: U.addressLine1
302
302
  })
303
303
  ] }),
304
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
304
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
305
305
  className: "block text-xs text-text-secondary mb-1",
306
- children: ["Apartment, suite, etc. ", /* @__PURE__ */ h("span", {
306
+ children: ["Apartment, suite, etc. ", /* @__PURE__ */ g("span", {
307
307
  className: "text-text-muted",
308
308
  children: "(optional)"
309
309
  })]
310
- }), /* @__PURE__ */ h("input", {
310
+ }), /* @__PURE__ */ g("input", {
311
311
  type: "text",
312
- value: z.addressLine2,
313
- onChange: (e) => X("addressLine2", e.target.value),
312
+ value: V.addressLine2,
313
+ onChange: (e) => Q("addressLine2", e.target.value),
314
314
  placeholder: "Apt 4B",
315
315
  className: $(!1)
316
316
  })] }),
317
- /* @__PURE__ */ g("div", {
317
+ /* @__PURE__ */ _("div", {
318
318
  className: "grid grid-cols-2 gap-3",
319
- children: [/* @__PURE__ */ g("div", { children: [
320
- /* @__PURE__ */ h("label", {
319
+ children: [/* @__PURE__ */ _("div", { children: [
320
+ /* @__PURE__ */ g("label", {
321
321
  className: "block text-xs text-text-secondary mb-1",
322
322
  children: "City"
323
323
  }),
324
- /* @__PURE__ */ h("input", {
324
+ /* @__PURE__ */ g("input", {
325
325
  type: "text",
326
- value: z.city,
327
- onChange: (e) => X("city", e.target.value),
326
+ value: V.city,
327
+ onChange: (e) => Q("city", e.target.value),
328
328
  placeholder: "Mumbai",
329
- className: $(!!V.city)
329
+ className: $(!!U.city)
330
330
  }),
331
- V.city && /* @__PURE__ */ h("p", {
331
+ U.city && /* @__PURE__ */ g("p", {
332
332
  className: "mt-1 text-xs text-status-error-text",
333
- children: V.city
333
+ children: U.city
334
334
  })
335
- ] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
335
+ ] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
336
336
  className: "block text-xs text-text-secondary mb-1",
337
- children: ["State ", /* @__PURE__ */ h("span", {
337
+ children: ["State ", /* @__PURE__ */ g("span", {
338
338
  className: "text-text-muted",
339
339
  children: "(optional)"
340
340
  })]
341
- }), /* @__PURE__ */ h("input", {
341
+ }), /* @__PURE__ */ g("input", {
342
342
  type: "text",
343
- value: z.state,
344
- onChange: (e) => X("state", e.target.value),
343
+ value: V.state,
344
+ onChange: (e) => Q("state", e.target.value),
345
345
  placeholder: "Maharashtra",
346
346
  className: $(!1)
347
347
  })] })]
348
348
  }),
349
- /* @__PURE__ */ g("div", { children: [
350
- /* @__PURE__ */ h("label", {
349
+ /* @__PURE__ */ _("div", { children: [
350
+ /* @__PURE__ */ g("label", {
351
351
  className: "block text-xs text-text-secondary mb-1",
352
352
  children: "Postal code"
353
353
  }),
354
- /* @__PURE__ */ h("input", {
354
+ /* @__PURE__ */ g("input", {
355
355
  type: "text",
356
- value: z.postalCode,
357
- onChange: (e) => X("postalCode", e.target.value),
356
+ value: V.postalCode,
357
+ onChange: (e) => Q("postalCode", e.target.value),
358
358
  placeholder: "400001",
359
- className: $(!!V.postalCode)
359
+ className: $(!!U.postalCode)
360
360
  }),
361
- V.postalCode && /* @__PURE__ */ h("p", {
361
+ U.postalCode && /* @__PURE__ */ g("p", {
362
362
  className: "mt-1 text-xs text-status-error-text",
363
- children: V.postalCode
363
+ children: U.postalCode
364
364
  })
365
365
  ] }),
366
- /* @__PURE__ */ h("div", {
366
+ /* @__PURE__ */ g("div", {
367
367
  className: "flex justify-end",
368
- children: /* @__PURE__ */ g("button", {
368
+ children: /* @__PURE__ */ _("button", {
369
369
  type: "button",
370
- onClick: Q,
370
+ onClick: ne,
371
371
  disabled: O,
372
372
  className: "inline-flex items-center gap-2 px-3 py-2 text-sm font-medium text-action-primary-text bg-action-primary-bg hover:bg-action-primary-bgHover rounded-lg transition-colors disabled:opacity-50",
373
- children: [O && /* @__PURE__ */ h(l, { className: "size-4 animate-spin" }), "Save address"]
373
+ children: [O && /* @__PURE__ */ g(u, { className: "size-4 animate-spin" }), "Save address"]
374
374
  })
375
375
  })
376
376
  ]
377
377
  })
378
378
  ]
379
379
  }),
380
- /* @__PURE__ */ g("section", {
380
+ /* @__PURE__ */ _("section", {
381
381
  className: "space-y-3",
382
382
  children: [
383
- /* @__PURE__ */ g("div", {
383
+ /* @__PURE__ */ _("div", {
384
384
  className: "flex items-center gap-2 text-sm font-medium text-text-primary",
385
- children: [/* @__PURE__ */ h(f, { className: "size-4 text-text-secondary" }), "Shipping method"]
385
+ children: [/* @__PURE__ */ g(p, { className: "size-4 text-text-secondary" }), "Shipping method"]
386
386
  }),
387
- K ? ee && k.length === 0 ? /* @__PURE__ */ g("div", {
387
+ J ? A && k.length === 0 ? /* @__PURE__ */ _("div", {
388
388
  className: "flex items-center gap-2 text-sm text-text-secondary",
389
- children: [/* @__PURE__ */ h(l, { className: "size-4 animate-spin" }), "Loading options…"]
390
- }) : q.length === 0 ? /* @__PURE__ */ g("p", {
389
+ children: [/* @__PURE__ */ g(u, { className: "size-4 animate-spin" }), "Loading options…"]
390
+ }) : Y.length === 0 ? /* @__PURE__ */ _("p", {
391
391
  className: "text-sm text-text-secondary",
392
392
  children: [
393
393
  "No shipping methods available for ",
394
- K.country,
394
+ J.country,
395
395
  ". Try a different address."
396
396
  ]
397
- }) : q.length === 1 ? (() => {
398
- let e = q[0], t = b(e.estimatedMinDays, e.estimatedMaxDays), n = Y && J;
399
- return /* @__PURE__ */ h("div", {
400
- className: "w-full p-3 rounded-input border border-action-primary-bg bg-bg-sunken",
401
- children: /* @__PURE__ */ g("div", {
397
+ }) : Y.length === 1 ? (() => {
398
+ let e = Y[0], t = b(e.estimatedMinDays, e.estimatedMaxDays), n = Z && X, r = !!P && !N;
399
+ return /* @__PURE__ */ g("div", {
400
+ className: `w-full p-3 rounded-input border bg-bg-sunken ${r ? "border-status-error-border" : "border-action-primary-bg"}`,
401
+ children: /* @__PURE__ */ _("div", {
402
402
  className: "flex items-start justify-between gap-3",
403
- children: [/* @__PURE__ */ g("div", {
403
+ children: [/* @__PURE__ */ _("div", {
404
404
  className: "text-sm",
405
- children: [/* @__PURE__ */ h("p", {
405
+ children: [/* @__PURE__ */ g("p", {
406
406
  className: "font-medium text-text-primary",
407
407
  children: e.name
408
- }), /* @__PURE__ */ g("p", {
408
+ }), /* @__PURE__ */ _("p", {
409
409
  className: "text-text-secondary text-xs mt-0.5",
410
410
  children: [e.carrier ? `${e.carrier} · ` : "", t ?? "Delivery time varies"]
411
411
  })]
412
412
  }), /* @__PURE__ */ g("div", {
413
413
  className: "flex items-center gap-2 shrink-0",
414
- children: [M ? /* @__PURE__ */ h(l, { className: "size-4 animate-spin text-text-secondary" }) : /* @__PURE__ */ h("span", {
414
+ children: N ? /* @__PURE__ */ g(u, { className: "size-4 animate-spin text-text-secondary" }) : r ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
415
+ className: "text-sm font-semibold text-status-error-text",
416
+ children: "Not available"
417
+ }), /* @__PURE__ */ g(c, { className: "size-4 text-status-error-text" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
415
418
  className: "text-sm font-semibold text-text-primary",
416
- children: n ? y(J.cost, J.currency || S) : y(e.baseCost, e.currency || S)
417
- }), /* @__PURE__ */ h(c, { className: "size-4 text-action-primary-bg" })]
419
+ children: n ? y(X.cost, X.currency || S) : y(e.baseCost, e.currency || S)
420
+ }), /* @__PURE__ */ g(l, { className: "size-4 text-action-primary-bg" })] })
418
421
  })]
419
422
  })
420
423
  });
421
- })() : /* @__PURE__ */ h("div", {
424
+ })() : /* @__PURE__ */ g("div", {
422
425
  className: "space-y-2",
423
- children: q.map((e) => {
424
- let t = e.id === F, n = b(e.estimatedMinDays, e.estimatedMaxDays), r = t && Y && J;
425
- return /* @__PURE__ */ h("button", {
426
+ children: Y.map((e) => {
427
+ let t = e.id === L, n = b(e.estimatedMinDays, e.estimatedMaxDays), r = t && Z && X, i = t && !!P && !N;
428
+ return /* @__PURE__ */ g("button", {
426
429
  type: "button",
427
- onClick: () => I(e.id),
428
- className: `w-full text-left p-3 rounded-input border transition-colors ${t ? "border-action-primary-bg bg-bg-sunken" : "border-border-subtle hover:bg-bg-sunken"}`,
429
- children: /* @__PURE__ */ g("div", {
430
+ onClick: () => R(e.id),
431
+ className: `w-full text-left p-3 rounded-input border transition-colors ${i ? "border-status-error-border bg-bg-sunken" : t ? "border-action-primary-bg bg-bg-sunken" : "border-border-subtle hover:bg-bg-sunken"}`,
432
+ children: /* @__PURE__ */ _("div", {
430
433
  className: "flex items-start justify-between gap-3",
431
- children: [/* @__PURE__ */ g("div", {
434
+ children: [/* @__PURE__ */ _("div", {
432
435
  className: "text-sm",
433
- children: [/* @__PURE__ */ h("p", {
436
+ children: [/* @__PURE__ */ g("p", {
434
437
  className: "font-medium text-text-primary",
435
438
  children: e.name
436
- }), /* @__PURE__ */ g("p", {
439
+ }), /* @__PURE__ */ _("p", {
437
440
  className: "text-text-secondary text-xs mt-0.5",
438
441
  children: [e.carrier ? `${e.carrier} · ` : "", n ?? "Delivery time varies"]
439
442
  })]
440
- }), /* @__PURE__ */ h("div", {
443
+ }), /* @__PURE__ */ g("div", {
441
444
  className: "text-right shrink-0",
442
- children: t && M ? /* @__PURE__ */ h(l, { className: "size-4 animate-spin text-text-secondary" }) : /* @__PURE__ */ h("span", {
445
+ children: t && N ? /* @__PURE__ */ g(u, { className: "size-4 animate-spin text-text-secondary" }) : i ? /* @__PURE__ */ _("span", {
446
+ className: "inline-flex items-center gap-1 text-sm font-semibold text-status-error-text",
447
+ children: [/* @__PURE__ */ g(c, { className: "size-4" }), "Not available"]
448
+ }) : /* @__PURE__ */ g("span", {
443
449
  className: "text-sm font-semibold text-text-primary",
444
- children: r ? y(J.cost, J.currency || S) : y(e.baseCost, e.currency || S)
450
+ children: r ? y(X.cost, X.currency || S) : y(e.baseCost, e.currency || S)
445
451
  })
446
452
  })]
447
453
  })
448
454
  }, e.id);
449
455
  })
450
- }) : /* @__PURE__ */ h("p", {
456
+ }) : /* @__PURE__ */ g("p", {
451
457
  className: "text-sm text-text-secondary",
452
458
  children: "Select a delivery address to see options."
453
459
  }),
454
- Y && J && /* @__PURE__ */ g("p", {
460
+ Z && X && /* @__PURE__ */ _("p", {
455
461
  className: "text-xs text-text-secondary",
456
462
  children: [
457
463
  "Estimated shipping: ",
458
- y(J.cost, J.currency || S),
459
- J.estimatedDeliveryDate ? ` · arrives around ${new Date(J.estimatedDeliveryDate).toLocaleDateString()}` : ""
464
+ y(X.cost, X.currency || S),
465
+ X.estimatedDeliveryDate ? ` · arrives around ${new Date(X.estimatedDeliveryDate).toLocaleDateString()}` : ""
460
466
  ]
467
+ }),
468
+ P && !N && /* @__PURE__ */ _("div", {
469
+ role: "alert",
470
+ className: "flex items-start gap-2 rounded-lg border border-status-error-border bg-status-error-bg-subtle p-3 text-sm text-status-error-text",
471
+ children: [/* @__PURE__ */ g(c, {
472
+ className: "size-4 shrink-0 mt-0.5",
473
+ "aria-hidden": "true"
474
+ }), /* @__PURE__ */ g("span", { children: P.message || "This delivery address cannot be shipped right now. Please try a different address or contact support." })]
461
475
  })
462
476
  ]
463
477
  })