@yenio-pld/blocks 1.2.0-rc.13 → 1.2.0-rc.15

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.
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var React3 = require('react');
4
+ var React6 = require('react');
5
5
  var skeleton_js = require('./ui/skeleton.js');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var lucideReact = require('lucide-react');
@@ -24,6 +24,7 @@ var combobox_js = require('./ui/combobox.js');
24
24
  var dialog_js = require('./ui/dialog.js');
25
25
  var drawer_js = require('./ui/drawer.js');
26
26
  var input_js = require('./ui/input.js');
27
+ var libphonenumberJs = require('libphonenumber-js');
27
28
  var slider_js = require('./ui/slider.js');
28
29
  var toggle_js = require('./ui/toggle.js');
29
30
  var framerMotion = require('framer-motion');
@@ -47,11 +48,11 @@ function _interopNamespace(e) {
47
48
  return Object.freeze(n);
48
49
  }
49
50
 
50
- var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
51
+ var React6__namespace = /*#__PURE__*/_interopNamespace(React6);
51
52
 
52
- var LanguageContext = React3.createContext(null);
53
+ var LanguageContext = React6.createContext(null);
53
54
  function useLanguageContext() {
54
- return React3.useContext(LanguageContext);
55
+ return React6.useContext(LanguageContext);
55
56
  }
56
57
  function PageTitle({
57
58
  title,
@@ -295,8 +296,8 @@ function renderShellLink({
295
296
  }
296
297
  function DismissMobileSidebar({ pathname }) {
297
298
  const { setOpenMobile } = sidebar_js.useSidebar();
298
- const previous = React3.useRef(pathname);
299
- React3.useEffect(() => {
299
+ const previous = React6.useRef(pathname);
300
+ React6.useEffect(() => {
300
301
  if (previous.current === pathname) return;
301
302
  previous.current = pathname;
302
303
  setOpenMobile(false);
@@ -485,7 +486,7 @@ function NavTabs({
485
486
  "aria-current": active ? "page" : void 0,
486
487
  children: label2
487
488
  });
488
- return React3.cloneElement(link, { key: tab.href });
489
+ return React6.cloneElement(link, { key: tab.href });
489
490
  })
490
491
  }
491
492
  );
@@ -685,14 +686,14 @@ function LoadMoreControls({
685
686
  pending,
686
687
  onLoadMore
687
688
  }) {
688
- const sentinelRef = React3.useRef(null);
689
- const pendingRef = React3.useRef(pending);
690
- const onLoadMoreRef = React3.useRef(onLoadMore);
691
- const armedRef = React3.useRef(true);
692
- const wasPendingRef = React3.useRef(false);
689
+ const sentinelRef = React6.useRef(null);
690
+ const pendingRef = React6.useRef(pending);
691
+ const onLoadMoreRef = React6.useRef(onLoadMore);
692
+ const armedRef = React6.useRef(true);
693
+ const wasPendingRef = React6.useRef(false);
693
694
  pendingRef.current = pending;
694
695
  onLoadMoreRef.current = onLoadMore;
695
- React3.useEffect(() => {
696
+ React6.useEffect(() => {
696
697
  const node = sentinelRef.current;
697
698
  if (!node || typeof IntersectionObserver === "undefined") return;
698
699
  function maybeLoad() {
@@ -710,7 +711,7 @@ function LoadMoreControls({
710
711
  observer.observe(node);
711
712
  return () => observer.disconnect();
712
713
  }, []);
713
- React3.useEffect(() => {
714
+ React6.useEffect(() => {
714
715
  if (pending) {
715
716
  wasPendingRef.current = true;
716
717
  return;
@@ -850,15 +851,15 @@ function NavigationProgress({
850
851
  ariaLabel = "Loading",
851
852
  forceVisible = false
852
853
  }) {
853
- const [visible, setVisible] = React3.useState(forceVisible);
854
- const [runId, setRunId] = React3.useState(0);
855
- const startedAt = React3.useRef(0);
856
- const startedRoute = React3.useRef(null);
857
- const committedRoute = React3.useRef(null);
858
- React3.useEffect(() => {
854
+ const [visible, setVisible] = React6.useState(forceVisible);
855
+ const [runId, setRunId] = React6.useState(0);
856
+ const startedAt = React6.useRef(0);
857
+ const startedRoute = React6.useRef(null);
858
+ const committedRoute = React6.useRef(null);
859
+ React6.useEffect(() => {
859
860
  committedRoute.current = routeKey(pathname, search);
860
861
  }, [pathname, search]);
861
- React3.useEffect(() => {
862
+ React6.useEffect(() => {
862
863
  if (forceVisible) return;
863
864
  function begin(route) {
864
865
  if (navigationSuppressed) return;
@@ -895,12 +896,12 @@ function NavigationProgress({
895
896
  window.removeEventListener("popstate", onPopState);
896
897
  };
897
898
  }, [forceVisible, pathname, search]);
898
- React3.useEffect(() => {
899
+ React6.useEffect(() => {
899
900
  if (forceVisible || !visible) return;
900
901
  const safety = window.setTimeout(() => setVisible(false), SAFETY_MS);
901
902
  return () => window.clearTimeout(safety);
902
903
  }, [forceVisible, runId, visible]);
903
- React3.useEffect(() => {
904
+ React6.useEffect(() => {
904
905
  if (forceVisible || !visible) return;
905
906
  const started = startedRoute.current;
906
907
  if (!started) return;
@@ -1383,20 +1384,20 @@ function useEditableSection({
1383
1384
  ...DEFAULT_EDITABLE_SECTION_LABELS,
1384
1385
  ...labels
1385
1386
  };
1386
- const [mode, setMode] = React3.useState("reading");
1387
- const [status, setStatus] = React3.useState(null);
1388
- const [confirmOpen, setConfirmOpen] = React3.useState(false);
1389
- const [minHeightPx, setMinHeightPx] = React3.useState(void 0);
1390
- const contentRef = React3.useRef(null);
1391
- const editButtonRef = React3.useRef(null);
1392
- const measuredHeightRef = React3.useRef(0);
1393
- const shouldFocusEditRef = React3.useRef(false);
1394
- const shouldFocusFirstFieldRef = React3.useRef(false);
1395
- const editButtonId = React3.useId();
1396
- const contentFormId = React3.useId();
1387
+ const [mode, setMode] = React6.useState("reading");
1388
+ const [status, setStatus] = React6.useState(null);
1389
+ const [confirmOpen, setConfirmOpen] = React6.useState(false);
1390
+ const [minHeightPx, setMinHeightPx] = React6.useState(void 0);
1391
+ const contentRef = React6.useRef(null);
1392
+ const editButtonRef = React6.useRef(null);
1393
+ const measuredHeightRef = React6.useRef(0);
1394
+ const shouldFocusEditRef = React6.useRef(false);
1395
+ const shouldFocusFirstFieldRef = React6.useRef(false);
1396
+ const editButtonId = React6.useId();
1397
+ const contentFormId = React6.useId();
1397
1398
  const isEditing = mode === "editing" || mode === "saving";
1398
1399
  const isSaving = mode === "saving";
1399
- React3.useEffect(() => {
1400
+ React6.useEffect(() => {
1400
1401
  if (mode === "reading" && shouldFocusEditRef.current) {
1401
1402
  shouldFocusEditRef.current = false;
1402
1403
  editButtonRef.current?.focus();
@@ -1414,18 +1415,18 @@ function useEditableSection({
1414
1415
  focusFirstField(contentRef.current);
1415
1416
  }
1416
1417
  }, [mode]);
1417
- const exitToReading = React3.useCallback(() => {
1418
+ const exitToReading = React6.useCallback(() => {
1418
1419
  setConfirmOpen(false);
1419
1420
  shouldFocusEditRef.current = true;
1420
1421
  setMode("reading");
1421
1422
  onDiscard?.();
1422
1423
  }, [onDiscard]);
1423
- const startEdit = React3.useCallback(() => {
1424
+ const startEdit = React6.useCallback(() => {
1424
1425
  setStatus(null);
1425
1426
  shouldFocusFirstFieldRef.current = true;
1426
1427
  setMode("editing");
1427
1428
  }, []);
1428
- const requestCancel = React3.useCallback(() => {
1429
+ const requestCancel = React6.useCallback(() => {
1429
1430
  if (isSaving) return;
1430
1431
  if (isDirty) {
1431
1432
  setConfirmOpen(true);
@@ -1433,7 +1434,7 @@ function useEditableSection({
1433
1434
  }
1434
1435
  exitToReading();
1435
1436
  }, [exitToReading, isDirty, isSaving]);
1436
- const handleSubmit = React3.useCallback(
1437
+ const handleSubmit = React6.useCallback(
1437
1438
  (event) => {
1438
1439
  event.preventDefault();
1439
1440
  if (isSaving) return;
@@ -1453,7 +1454,7 @@ function useEditableSection({
1453
1454
  },
1454
1455
  [isSaving, onSave, resolvedLabels.saved]
1455
1456
  );
1456
- const handleFormKeyDown = React3.useCallback(
1457
+ const handleFormKeyDown = React6.useCallback(
1457
1458
  (event) => {
1458
1459
  if (event.key !== "Escape") return;
1459
1460
  event.preventDefault();
@@ -1461,7 +1462,7 @@ function useEditableSection({
1461
1462
  },
1462
1463
  [requestCancel]
1463
1464
  );
1464
- React3.useEffect(() => {
1465
+ React6.useEffect(() => {
1465
1466
  if (!stableHeight || !isEditing) return;
1466
1467
  const el = contentRef.current;
1467
1468
  if (!el) return;
@@ -1707,16 +1708,16 @@ function SafeImage({
1707
1708
  className,
1708
1709
  ...imgProps
1709
1710
  }) {
1710
- const [failed, setFailed] = React3.useState(false);
1711
- const [loaded, setLoaded] = React3.useState(false);
1712
- const imgRef = React3.useRef(null);
1711
+ const [failed, setFailed] = React6.useState(false);
1712
+ const [loaded, setLoaded] = React6.useState(false);
1713
+ const imgRef = React6.useRef(null);
1713
1714
  const resolvedSrc = typeof src === "string" && src.length > 0 ? src : null;
1714
1715
  const resolvedBlur = resolveBlurDataUrl(blurDataUrl);
1715
- React3.useLayoutEffect(() => {
1716
+ React6.useLayoutEffect(() => {
1716
1717
  setFailed(false);
1717
1718
  setLoaded(false);
1718
1719
  }, [resolvedSrc]);
1719
- React3.useLayoutEffect(() => {
1720
+ React6.useLayoutEffect(() => {
1720
1721
  const img = imgRef.current;
1721
1722
  if (!img) return;
1722
1723
  if (isBrokenImage(img)) {
@@ -1826,17 +1827,17 @@ function ThemeSwitcher({
1826
1827
  labels: userLabels
1827
1828
  }) {
1828
1829
  const { theme, setTheme } = nextThemes.useTheme();
1829
- const [mounted, setMounted] = React3.useState(false);
1830
+ const [mounted, setMounted] = React6.useState(false);
1830
1831
  const sizes = sizeClasses[size];
1831
1832
  const shapeClass = shapeClasses[shape];
1832
1833
  const labels = { ...defaultLabels, ...userLabels };
1833
- const handleThemeClick = React3.useCallback(
1834
+ const handleThemeClick = React6.useCallback(
1834
1835
  (themeKey) => {
1835
1836
  setTheme(themeKey);
1836
1837
  },
1837
1838
  [setTheme]
1838
1839
  );
1839
- React3.useEffect(() => {
1840
+ React6.useEffect(() => {
1840
1841
  setMounted(true);
1841
1842
  }, []);
1842
1843
  if (!mounted) {
@@ -3085,8 +3086,8 @@ function CountryPicker({
3085
3086
  "aria-invalid": ariaInvalid
3086
3087
  }) {
3087
3088
  const labels = { ...defaultLabels2(purpose, locale), ...labelsProp };
3088
- const items = React3__namespace.useMemo(() => countryPickerItems(locale), [locale]);
3089
- const selected = React3__namespace.useMemo(() => findItem(items, value), [items, value]);
3089
+ const items = React6__namespace.useMemo(() => countryPickerItems(locale), [locale]);
3090
+ const selected = React6__namespace.useMemo(() => findItem(items, value), [items, value]);
3090
3091
  const dialogPortalContainer = dialog_js.useDialogPortalContainer();
3091
3092
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3092
3093
  name ? /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: value.trim().toUpperCase() }) : null,
@@ -3186,9 +3187,296 @@ function CountryPicker({
3186
3187
  )
3187
3188
  ] });
3188
3189
  }
3190
+
3191
+ // src/data/sat-tax-regimes.json
3192
+ var sat_tax_regimes_default = {
3193
+ items: [
3194
+ {
3195
+ code: "601",
3196
+ labelEs: "General de Ley Personas Morales",
3197
+ labelEn: "General regime \u2014 legal entities"
3198
+ },
3199
+ {
3200
+ code: "603",
3201
+ labelEs: "Personas Morales con Fines no Lucrativos",
3202
+ labelEn: "Non-profit legal entities"
3203
+ },
3204
+ {
3205
+ code: "605",
3206
+ labelEs: "Sueldos y Salarios e Ingresos Asimilados a Salarios",
3207
+ labelEn: "Wages and salary-assimilated income"
3208
+ },
3209
+ {
3210
+ code: "606",
3211
+ labelEs: "Arrendamiento",
3212
+ labelEn: "Leasing"
3213
+ },
3214
+ {
3215
+ code: "607",
3216
+ labelEs: "R\xE9gimen de Enajenaci\xF3n o Adquisici\xF3n de Bienes",
3217
+ labelEn: "Transfer or acquisition of goods"
3218
+ },
3219
+ {
3220
+ code: "608",
3221
+ labelEs: "Dem\xE1s ingresos",
3222
+ labelEn: "Other income"
3223
+ },
3224
+ {
3225
+ code: "610",
3226
+ labelEs: "Residentes en el Extranjero sin Establecimiento Permanente en M\xE9xico",
3227
+ labelEn: "Foreign residents without permanent establishment in Mexico"
3228
+ },
3229
+ {
3230
+ code: "611",
3231
+ labelEs: "Ingresos por Dividendos (socios y accionistas)",
3232
+ labelEn: "Dividend income (partners and shareholders)"
3233
+ },
3234
+ {
3235
+ code: "612",
3236
+ labelEs: "Personas F\xEDsicas con Actividades Empresariales y Profesionales",
3237
+ labelEn: "Individuals with business and professional activities"
3238
+ },
3239
+ {
3240
+ code: "614",
3241
+ labelEs: "Ingresos por intereses",
3242
+ labelEn: "Interest income"
3243
+ },
3244
+ {
3245
+ code: "615",
3246
+ labelEs: "R\xE9gimen de los ingresos por obtenci\xF3n de premios",
3247
+ labelEn: "Prize income"
3248
+ },
3249
+ {
3250
+ code: "616",
3251
+ labelEs: "Sin obligaciones fiscales",
3252
+ labelEn: "No tax obligations"
3253
+ },
3254
+ {
3255
+ code: "620",
3256
+ labelEs: "Sociedades Cooperativas de Producci\xF3n que optan por diferir sus ingresos",
3257
+ labelEn: "Production cooperatives deferring income"
3258
+ },
3259
+ {
3260
+ code: "621",
3261
+ labelEs: "Incorporaci\xF3n Fiscal",
3262
+ labelEn: "Tax incorporation"
3263
+ },
3264
+ {
3265
+ code: "622",
3266
+ labelEs: "Actividades Agr\xEDcolas, Ganaderas, Silv\xEDcolas y Pesqueras",
3267
+ labelEn: "Agriculture, livestock, forestry, and fishing"
3268
+ },
3269
+ {
3270
+ code: "623",
3271
+ labelEs: "Opcional para Grupos de Sociedades",
3272
+ labelEn: "Optional regime for corporate groups"
3273
+ },
3274
+ {
3275
+ code: "624",
3276
+ labelEs: "Coordinados",
3277
+ labelEn: "Coordinated entities"
3278
+ },
3279
+ {
3280
+ code: "625",
3281
+ labelEs: "R\xE9gimen de las Actividades Empresariales con ingresos a trav\xE9s de Plataformas Tecnol\xF3gicas",
3282
+ labelEn: "Business income through digital platforms"
3283
+ },
3284
+ {
3285
+ code: "626",
3286
+ labelEs: "R\xE9gimen Simplificado de Confianza",
3287
+ labelEn: "Simplified trust regime (RESICO)"
3288
+ }
3289
+ ]
3290
+ };
3291
+
3292
+ // src/lib/tax-regimes.ts
3293
+ var ITEMS2 = sat_tax_regimes_default.items;
3294
+ var SAT_TAX_REGIME_CODES = Object.freeze(
3295
+ ITEMS2.map((item) => item.code)
3296
+ );
3297
+ var TAX_REGIME_OPTIONS = Object.freeze(
3298
+ [...ITEMS2].sort(
3299
+ (left, right) => left.labelEs.localeCompare(right.labelEs, "es")
3300
+ )
3301
+ );
3302
+ var CODE_SET2 = new Set(ITEMS2.map((item) => item.code));
3303
+ var BY_CODE2 = new Map(ITEMS2.map((item) => [item.code, item]));
3304
+ function titleCaseEs2(labelEs) {
3305
+ return labelEs.toLocaleLowerCase("es-MX").split(/\s+/).filter(Boolean).map((word) => word.charAt(0).toLocaleUpperCase("es-MX") + word.slice(1)).join(" ");
3306
+ }
3307
+ function normalizeCode(code) {
3308
+ return code.trim();
3309
+ }
3310
+ function isKnownTaxRegimeCode(code) {
3311
+ return CODE_SET2.has(normalizeCode(code));
3312
+ }
3313
+ function taxRegimeLabel(code, locale) {
3314
+ const normalized = normalizeCode(code);
3315
+ const record = BY_CODE2.get(normalized);
3316
+ if (!record) return normalized;
3317
+ if (locale === "es-MX") {
3318
+ return titleCaseEs2(record.labelEs);
3319
+ }
3320
+ return record.labelEn;
3321
+ }
3322
+ function formatTaxRegimeOptionLabel(code, locale) {
3323
+ const normalized = normalizeCode(code);
3324
+ return `${normalized} \u2014 ${taxRegimeLabel(normalized, locale)}`;
3325
+ }
3326
+ function taxRegimePickerItems(locale) {
3327
+ return TAX_REGIME_OPTIONS.map((item) => ({
3328
+ value: item.code,
3329
+ label: formatTaxRegimeOptionLabel(item.code, locale)
3330
+ }));
3331
+ }
3332
+ function foldForSearch2(text) {
3333
+ return text.normalize("NFD").replace(/\p{M}/gu, "").toLowerCase();
3334
+ }
3335
+ function filterTaxRegimes(query, locale) {
3336
+ const items = taxRegimePickerItems(locale);
3337
+ const trimmed = query.trim();
3338
+ if (!trimmed) return items;
3339
+ const needle = foldForSearch2(trimmed);
3340
+ return items.filter((item) => {
3341
+ const code = foldForSearch2(item.value);
3342
+ const label = foldForSearch2(item.label);
3343
+ return code.includes(needle) || label.includes(needle);
3344
+ });
3345
+ }
3346
+ var INPUT_CLASS2 = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
3347
+ function defaultLabels3(locale) {
3348
+ const es = locale === "es-MX";
3349
+ return {
3350
+ placeholder: es ? "Buscar r\xE9gimen fiscal\u2026" : "Search tax regime\u2026",
3351
+ search: es ? "Buscar r\xE9gimen fiscal" : "Search tax regime",
3352
+ noResults: es ? "Sin resultados" : "No results",
3353
+ clear: es ? "Limpiar" : "Clear",
3354
+ open: es ? "Abrir lista" : "Open list"
3355
+ };
3356
+ }
3357
+ function findItem2(items, code) {
3358
+ const normalized = code.trim();
3359
+ if (!normalized) return null;
3360
+ return items.find((item) => item.value === normalized) ?? null;
3361
+ }
3362
+ function TaxRegimePicker({
3363
+ value,
3364
+ onValueChange,
3365
+ locale = "es-MX",
3366
+ id,
3367
+ name,
3368
+ disabled,
3369
+ required,
3370
+ allowEmpty = true,
3371
+ className,
3372
+ labels: labelsProp,
3373
+ "aria-invalid": ariaInvalid
3374
+ }) {
3375
+ const labels = { ...defaultLabels3(locale), ...labelsProp };
3376
+ const items = React6__namespace.useMemo(() => taxRegimePickerItems(locale), [locale]);
3377
+ const selected = React6__namespace.useMemo(() => findItem2(items, value), [items, value]);
3378
+ const dialogPortalContainer = dialog_js.useDialogPortalContainer();
3379
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3380
+ name ? /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: value.trim() }) : null,
3381
+ /* @__PURE__ */ jsxRuntime.jsxs(
3382
+ combobox_js.Combobox.Root,
3383
+ {
3384
+ items,
3385
+ value: selected,
3386
+ onValueChange: (item) => {
3387
+ onValueChange(item?.value ?? "");
3388
+ },
3389
+ disabled,
3390
+ itemToStringLabel: (item) => item.label,
3391
+ itemToStringValue: (item) => item.value,
3392
+ isItemEqualToValue: (item, current) => item.value === current.value,
3393
+ children: [
3394
+ /* @__PURE__ */ jsxRuntime.jsxs(
3395
+ combobox_js.Combobox.InputGroup,
3396
+ {
3397
+ className: cn("relative flex w-full items-center", className),
3398
+ children: [
3399
+ /* @__PURE__ */ jsxRuntime.jsx(
3400
+ combobox_js.Combobox.Input,
3401
+ {
3402
+ id,
3403
+ required,
3404
+ "aria-invalid": ariaInvalid,
3405
+ ...labels.ariaLabel ? { "aria-label": labels.ariaLabel } : {},
3406
+ placeholder: labels.placeholder,
3407
+ className: cn(INPUT_CLASS2, "pr-16")
3408
+ }
3409
+ ),
3410
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-y-0 right-0 flex items-center gap-0.5 pr-1.5", children: [
3411
+ allowEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
3412
+ combobox_js.Combobox.Clear,
3413
+ {
3414
+ className: "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
3415
+ "aria-label": labels.clear,
3416
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4", "aria-hidden": true })
3417
+ }
3418
+ ) : null,
3419
+ /* @__PURE__ */ jsxRuntime.jsx(
3420
+ combobox_js.Combobox.Trigger,
3421
+ {
3422
+ className: "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
3423
+ "aria-label": labels.open,
3424
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-4", "aria-hidden": true })
3425
+ }
3426
+ )
3427
+ ] })
3428
+ ]
3429
+ }
3430
+ ),
3431
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Portal, { container: dialogPortalContainer ?? void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
3432
+ combobox_js.Combobox.Positioner,
3433
+ {
3434
+ className: "pointer-events-auto isolate z-[60] outline-none",
3435
+ sideOffset: 4,
3436
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
3437
+ combobox_js.Combobox.Popup,
3438
+ {
3439
+ className: cn(
3440
+ "pointer-events-auto z-[60] max-h-60 w-(--anchor-width) min-w-[16rem] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10",
3441
+ "data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95"
3442
+ ),
3443
+ children: [
3444
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Empty, { className: "px-3 py-2 text-sm text-muted-foreground", children: labels.noResults }),
3445
+ /* @__PURE__ */ jsxRuntime.jsx(
3446
+ combobox_js.Combobox.List,
3447
+ {
3448
+ className: "max-h-60 overflow-y-auto p-1 outline-none",
3449
+ onWheel: (event) => event.stopPropagation(),
3450
+ children: (item) => /* @__PURE__ */ jsxRuntime.jsxs(
3451
+ combobox_js.Combobox.Item,
3452
+ {
3453
+ value: item,
3454
+ className: cn(
3455
+ "relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-none select-none",
3456
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground"
3457
+ ),
3458
+ children: [
3459
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.ItemIndicator, { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4", "aria-hidden": true }) }),
3460
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
3461
+ ]
3462
+ },
3463
+ item.value
3464
+ )
3465
+ }
3466
+ )
3467
+ ]
3468
+ }
3469
+ )
3470
+ }
3471
+ ) })
3472
+ ]
3473
+ }
3474
+ )
3475
+ ] });
3476
+ }
3189
3477
  function useMediaQuery(query) {
3190
- const [matches, setMatches] = React3.useState(false);
3191
- React3.useEffect(() => {
3478
+ const [matches, setMatches] = React6.useState(false);
3479
+ React6.useEffect(() => {
3192
3480
  if (typeof window === "undefined" || !window.matchMedia) return;
3193
3481
  const mql = window.matchMedia(query);
3194
3482
  const onChange = () => setMatches(mql.matches);
@@ -3242,21 +3530,21 @@ function SearchablePicker({
3242
3530
  }) {
3243
3531
  const isMdUp = useMediaQuery(MD_UP);
3244
3532
  const dialogPortalContainer = dialog_js.useDialogPortalContainer();
3245
- const [open, setOpen] = React3__namespace.useState(false);
3246
- const searchRef = React3__namespace.useRef(null);
3533
+ const [open, setOpen] = React6__namespace.useState(false);
3534
+ const searchRef = React6__namespace.useRef(null);
3247
3535
  function setOpenState(next) {
3248
3536
  setOpen(next);
3249
3537
  onOpenChange?.(next);
3250
3538
  if (!next) onQueryChange("");
3251
3539
  }
3252
- const selected = React3__namespace.useMemo(() => {
3540
+ const selected = React6__namespace.useMemo(() => {
3253
3541
  if (!value) return null;
3254
3542
  return options.find((option) => option.id === value) ?? {
3255
3543
  id: value,
3256
3544
  label: selectedLabel || value
3257
3545
  };
3258
3546
  }, [options, selectedLabel, value]);
3259
- React3__namespace.useEffect(() => {
3547
+ React6__namespace.useEffect(() => {
3260
3548
  if (!open || isMdUp) return;
3261
3549
  const handle = window.setTimeout(() => searchRef.current?.focus(), 0);
3262
3550
  return () => window.clearTimeout(handle);
@@ -3539,7 +3827,7 @@ function SearchablePicker({
3539
3827
  ] }) })
3540
3828
  ] });
3541
3829
  }
3542
- var INPUT_CLASS2 = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
3830
+ var INPUT_CLASS3 = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
3543
3831
  var DEFAULT_LABELS = {
3544
3832
  placeholder: "Search\u2026",
3545
3833
  noResults: "No results",
@@ -3577,18 +3865,18 @@ function PaginatedCombobox({
3577
3865
  }) {
3578
3866
  const labels = { ...DEFAULT_LABELS, ...labelsProp };
3579
3867
  const dialogPortalContainer = dialog_js.useDialogPortalContainer();
3580
- const selected = React3__namespace.useMemo(
3868
+ const selected = React6__namespace.useMemo(
3581
3869
  () => resolveSelected(value, items, selectedItem),
3582
3870
  [value, items, selectedItem]
3583
3871
  );
3584
- const listItems = React3__namespace.useMemo(() => {
3872
+ const listItems = React6__namespace.useMemo(() => {
3585
3873
  if (!selected) return items;
3586
3874
  if (items.some((item) => item.value === selected.value)) return items;
3587
3875
  return [selected, ...items];
3588
3876
  }, [items, selected]);
3589
- const queryRef = React3__namespace.useRef("");
3590
- const debounceRef = React3__namespace.useRef(null);
3591
- React3__namespace.useEffect(() => {
3877
+ const queryRef = React6__namespace.useRef("");
3878
+ const debounceRef = React6__namespace.useRef(null);
3879
+ React6__namespace.useEffect(() => {
3592
3880
  return () => {
3593
3881
  if (debounceRef.current) clearTimeout(debounceRef.current);
3594
3882
  };
@@ -3645,7 +3933,7 @@ function PaginatedCombobox({
3645
3933
  "aria-invalid": ariaInvalid,
3646
3934
  ...labels.ariaLabel ? { "aria-label": labels.ariaLabel } : {},
3647
3935
  placeholder: labels.placeholder,
3648
- className: cn(INPUT_CLASS2, "pr-16")
3936
+ className: cn(INPUT_CLASS3, "pr-16")
3649
3937
  }
3650
3938
  ),
3651
3939
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-y-0 right-0 flex items-center gap-0.5 pr-1.5", children: [
@@ -3861,7 +4149,7 @@ function PasswordInput({
3861
4149
  hideLabel = "Hide password",
3862
4150
  ...props
3863
4151
  }) {
3864
- const [visible, setVisible] = React3__namespace.useState(false);
4152
+ const [visible, setVisible] = React6__namespace.useState(false);
3865
4153
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
3866
4154
  /* @__PURE__ */ jsxRuntime.jsx(
3867
4155
  input_js.Input,
@@ -3888,6 +4176,345 @@ function PasswordInput({
3888
4176
  )
3889
4177
  ] });
3890
4178
  }
4179
+ var MD_UP2 = "(min-width: 768px)";
4180
+ var ROW_CLASS = "flex h-8 w-full min-w-0 items-stretch overflow-hidden rounded-lg border border-input bg-transparent transition-colors outline-none focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
4181
+ var SEARCH_CLASS2 = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 md:text-sm dark:bg-input/30";
4182
+ function isCountryCode(value) {
4183
+ return libphonenumberJs.getCountries().includes(value);
4184
+ }
4185
+ function resolveCountry(code, fallback) {
4186
+ const normalized = (code ?? "").trim().toUpperCase();
4187
+ return isCountryCode(normalized) ? normalized : fallback;
4188
+ }
4189
+ function flagEmoji(iso) {
4190
+ const code = iso.trim().toUpperCase();
4191
+ if (!/^[A-Z]{2}$/.test(code)) return "\u{1F3F3}\uFE0F";
4192
+ return String.fromCodePoint(
4193
+ ...code.split("").map((char) => 127397 + char.charCodeAt(0))
4194
+ );
4195
+ }
4196
+ var regionNames;
4197
+ function countryName(code) {
4198
+ try {
4199
+ regionNames ??= new Intl.DisplayNames(["en"], { type: "region" });
4200
+ return regionNames.of(code) ?? code;
4201
+ } catch {
4202
+ return code;
4203
+ }
4204
+ }
4205
+ function buildCountryOptions() {
4206
+ return libphonenumberJs.getCountries().map((id) => {
4207
+ const dialCode = `+${libphonenumberJs.getCountryCallingCode(id)}`;
4208
+ const name = countryName(id);
4209
+ return {
4210
+ id,
4211
+ dialCode,
4212
+ flag: flagEmoji(id),
4213
+ label: `${name} (${dialCode})`
4214
+ };
4215
+ }).sort((left, right) => left.label.localeCompare(right.label, "en"));
4216
+ }
4217
+ var COUNTRY_OPTIONS2 = buildCountryOptions();
4218
+ function nationalDigits(value) {
4219
+ return value.replace(/\D/g, "");
4220
+ }
4221
+ function formatNational(country, raw) {
4222
+ const digits = nationalDigits(raw);
4223
+ if (!digits) return "";
4224
+ return new libphonenumberJs.AsYouType(country).input(digits);
4225
+ }
4226
+ function toE164(country, national) {
4227
+ const digits = nationalDigits(national);
4228
+ if (!digits) return "";
4229
+ const parsed = libphonenumberJs.parsePhoneNumberFromString(digits, country);
4230
+ if (parsed?.number) return parsed.number;
4231
+ return `+${libphonenumberJs.getCountryCallingCode(country)}${digits}`;
4232
+ }
4233
+ function parseIncoming(value, defaultCountry) {
4234
+ const trimmed = value.trim();
4235
+ if (!trimmed) {
4236
+ return { country: defaultCountry, national: "" };
4237
+ }
4238
+ const parsed = libphonenumberJs.parsePhoneNumberFromString(trimmed, defaultCountry);
4239
+ if (parsed) {
4240
+ const country = parsed.country ?? defaultCountry;
4241
+ const national = parsed.formatNational();
4242
+ return { country, national };
4243
+ }
4244
+ return {
4245
+ country: defaultCountry,
4246
+ national: formatNational(defaultCountry, trimmed)
4247
+ };
4248
+ }
4249
+ function filterCountries2(options, query) {
4250
+ const needle = query.trim().toLowerCase();
4251
+ if (!needle) return options;
4252
+ return options.filter((option) => {
4253
+ const haystack = `${option.label} ${option.id} ${option.dialCode}`.toLowerCase();
4254
+ return haystack.includes(needle);
4255
+ });
4256
+ }
4257
+ function PhoneInput({
4258
+ value,
4259
+ onValueChange,
4260
+ defaultCountry = "MX",
4261
+ searchPlaceholder = "Search country or code\u2026",
4262
+ countryListLabel = "Country",
4263
+ countryTriggerLabel = "Select country",
4264
+ emptyLabel = "No matches",
4265
+ className,
4266
+ disabled,
4267
+ id,
4268
+ name,
4269
+ "aria-invalid": ariaInvalid,
4270
+ "aria-label": ariaLabel,
4271
+ placeholder,
4272
+ ...props
4273
+ }) {
4274
+ const resolvedDefault = resolveCountry(defaultCountry, "MX");
4275
+ const [country, setCountry] = React6__namespace.useState(
4276
+ () => parseIncoming(value, resolvedDefault).country
4277
+ );
4278
+ const [national, setNational] = React6__namespace.useState(
4279
+ () => parseIncoming(value, resolvedDefault).national
4280
+ );
4281
+ const [open, setOpen] = React6__namespace.useState(false);
4282
+ const [query, setQuery] = React6__namespace.useState("");
4283
+ const lastEmittedRef = React6__namespace.useRef(value);
4284
+ const isMdUp = useMediaQuery(MD_UP2);
4285
+ const dialogPortalContainer = dialog_js.useDialogPortalContainer();
4286
+ const searchRef = React6__namespace.useRef(null);
4287
+ React6__namespace.useEffect(() => {
4288
+ if (value === lastEmittedRef.current) return;
4289
+ lastEmittedRef.current = value;
4290
+ const next = parseIncoming(value, resolvedDefault);
4291
+ setCountry(next.country);
4292
+ setNational(next.national);
4293
+ }, [value, resolvedDefault]);
4294
+ React6__namespace.useEffect(() => {
4295
+ if (!open || isMdUp) return;
4296
+ const handle = window.setTimeout(() => searchRef.current?.focus(), 0);
4297
+ return () => window.clearTimeout(handle);
4298
+ }, [isMdUp, open]);
4299
+ const selected = COUNTRY_OPTIONS2.find((option) => option.id === country) ?? COUNTRY_OPTIONS2.find((option) => option.id === resolvedDefault);
4300
+ const filtered = React6__namespace.useMemo(
4301
+ () => filterCountries2(COUNTRY_OPTIONS2, query),
4302
+ [query]
4303
+ );
4304
+ function emit(nextCountry, nextNational) {
4305
+ const nextValue = toE164(nextCountry, nextNational);
4306
+ lastEmittedRef.current = nextValue;
4307
+ setCountry(nextCountry);
4308
+ setNational(nextNational);
4309
+ onValueChange(nextValue);
4310
+ }
4311
+ function setOpenState(next) {
4312
+ setOpen(next);
4313
+ if (!next) setQuery("");
4314
+ }
4315
+ function selectCountry(next) {
4316
+ const formatted = formatNational(next, national);
4317
+ emit(next, formatted);
4318
+ setOpenState(false);
4319
+ }
4320
+ function onNationalChange(nextRaw) {
4321
+ const formatted = formatNational(country, nextRaw);
4322
+ emit(country, formatted);
4323
+ }
4324
+ const dialDisplay = selected.dialCode;
4325
+ const countryTriggerClass = "inline-flex h-full shrink-0 items-center gap-1 border-r border-input px-2 text-sm outline-none disabled:pointer-events-none";
4326
+ const desktopPicker = /* @__PURE__ */ jsxRuntime.jsxs(
4327
+ combobox_js.Combobox.Root,
4328
+ {
4329
+ items: filtered,
4330
+ value: selected,
4331
+ open,
4332
+ onOpenChange: setOpenState,
4333
+ inputValue: query,
4334
+ onInputValueChange: setQuery,
4335
+ onValueChange: (item) => {
4336
+ if (item) selectCountry(item.id);
4337
+ },
4338
+ disabled,
4339
+ filter: null,
4340
+ autoComplete: "none",
4341
+ itemToStringLabel: (item) => item.label,
4342
+ itemToStringValue: (item) => item.id,
4343
+ isItemEqualToValue: (item, current) => item.id === current.id,
4344
+ children: [
4345
+ /* @__PURE__ */ jsxRuntime.jsxs(
4346
+ combobox_js.Combobox.Trigger,
4347
+ {
4348
+ "aria-invalid": ariaInvalid,
4349
+ "aria-label": countryTriggerLabel,
4350
+ className: countryTriggerClass,
4351
+ disabled,
4352
+ children: [
4353
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "text-base leading-none", children: selected.flag }),
4354
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tabular-nums text-muted-foreground", children: dialDisplay }),
4355
+ /* @__PURE__ */ jsxRuntime.jsx(
4356
+ lucideReact.ChevronDownIcon,
4357
+ {
4358
+ "aria-hidden": true,
4359
+ className: "size-3.5 shrink-0 text-muted-foreground"
4360
+ }
4361
+ )
4362
+ ]
4363
+ }
4364
+ ),
4365
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Portal, { container: dialogPortalContainer ?? void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
4366
+ combobox_js.Combobox.Positioner,
4367
+ {
4368
+ className: "pointer-events-auto isolate z-[60] outline-none",
4369
+ sideOffset: 4,
4370
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
4371
+ combobox_js.Combobox.Popup,
4372
+ {
4373
+ className: cn(
4374
+ "pointer-events-auto z-[60] flex w-[min(20rem,var(--anchor-width))] min-w-[16rem] flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10",
4375
+ "motion-safe:data-open:animate-in motion-safe:data-open:fade-in-0 motion-safe:data-open:zoom-in-95"
4376
+ ),
4377
+ children: [
4378
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-0 z-10 border-b border-border bg-popover p-2", children: /* @__PURE__ */ jsxRuntime.jsx(
4379
+ combobox_js.Combobox.Input,
4380
+ {
4381
+ "aria-label": searchPlaceholder,
4382
+ className: SEARCH_CLASS2,
4383
+ placeholder: searchPlaceholder
4384
+ }
4385
+ ) }),
4386
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Empty, { className: "px-3 py-3 text-sm text-muted-foreground", children: emptyLabel }),
4387
+ /* @__PURE__ */ jsxRuntime.jsx(
4388
+ combobox_js.Combobox.List,
4389
+ {
4390
+ "aria-label": countryListLabel,
4391
+ className: "max-h-60 overflow-y-auto p-1 outline-none",
4392
+ onWheel: (event) => event.stopPropagation(),
4393
+ children: (item) => /* @__PURE__ */ jsxRuntime.jsxs(
4394
+ combobox_js.Combobox.Item,
4395
+ {
4396
+ value: item,
4397
+ className: cn(
4398
+ "relative flex cursor-default items-center gap-2 rounded-md py-2 pr-2 pl-8 text-sm outline-none select-none",
4399
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground"
4400
+ ),
4401
+ children: [
4402
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.ItemIndicator, { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4", "aria-hidden": true }) }),
4403
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "text-base leading-none", children: item.flag }),
4404
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: item.label })
4405
+ ]
4406
+ },
4407
+ item.id
4408
+ )
4409
+ }
4410
+ )
4411
+ ]
4412
+ }
4413
+ )
4414
+ }
4415
+ ) })
4416
+ ]
4417
+ }
4418
+ );
4419
+ const mobileTrigger = /* @__PURE__ */ jsxRuntime.jsxs(
4420
+ "button",
4421
+ {
4422
+ "aria-expanded": open,
4423
+ "aria-haspopup": "dialog",
4424
+ "aria-invalid": ariaInvalid,
4425
+ "aria-label": countryTriggerLabel,
4426
+ className: countryTriggerClass,
4427
+ disabled,
4428
+ type: "button",
4429
+ onClick: () => setOpenState(true),
4430
+ children: [
4431
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "text-base leading-none", children: selected.flag }),
4432
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tabular-nums text-muted-foreground", children: dialDisplay }),
4433
+ /* @__PURE__ */ jsxRuntime.jsx(
4434
+ lucideReact.ChevronDownIcon,
4435
+ {
4436
+ "aria-hidden": true,
4437
+ className: "size-3.5 shrink-0 text-muted-foreground"
4438
+ }
4439
+ )
4440
+ ]
4441
+ }
4442
+ );
4443
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4444
+ "div",
4445
+ {
4446
+ "aria-invalid": ariaInvalid,
4447
+ className: cn(
4448
+ ROW_CLASS,
4449
+ disabled ? "pointer-events-none cursor-not-allowed bg-input/50 opacity-50 dark:bg-input/80" : null,
4450
+ className
4451
+ ),
4452
+ children: [
4453
+ name ? /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value }) : null,
4454
+ isMdUp ? desktopPicker : mobileTrigger,
4455
+ /* @__PURE__ */ jsxRuntime.jsx(
4456
+ "input",
4457
+ {
4458
+ ...props,
4459
+ "aria-invalid": ariaInvalid,
4460
+ "aria-label": ariaLabel,
4461
+ autoComplete: props.autoComplete ?? "tel-national",
4462
+ className: "h-full min-w-0 flex-1 border-0 bg-transparent px-2.5 py-1 text-base outline-none placeholder:text-muted-foreground md:text-sm",
4463
+ disabled,
4464
+ id,
4465
+ inputMode: "tel",
4466
+ placeholder,
4467
+ type: "tel",
4468
+ value: national,
4469
+ onChange: (event) => onNationalChange(event.target.value)
4470
+ }
4471
+ ),
4472
+ !isMdUp ? /* @__PURE__ */ jsxRuntime.jsx(drawer_js.Drawer, { open, onOpenChange: setOpenState, children: /* @__PURE__ */ jsxRuntime.jsxs(drawer_js.DrawerContent, { className: "max-h-[85vh]", children: [
4473
+ /* @__PURE__ */ jsxRuntime.jsx(drawer_js.DrawerHeader, { className: "text-left", children: /* @__PURE__ */ jsxRuntime.jsx(drawer_js.DrawerTitle, { children: countryListLabel }) }),
4474
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-0 z-10 border-b border-border bg-background px-4 pb-3", children: /* @__PURE__ */ jsxRuntime.jsx(
4475
+ input_js.Input,
4476
+ {
4477
+ ref: searchRef,
4478
+ "aria-label": searchPlaceholder,
4479
+ disabled,
4480
+ placeholder: searchPlaceholder,
4481
+ value: query,
4482
+ onChange: (event) => setQuery(event.target.value)
4483
+ }
4484
+ ) }),
4485
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto px-2 pb-4", children: filtered.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 py-3 text-sm text-muted-foreground", children: emptyLabel }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1 p-1", role: "listbox", children: filtered.map((option) => {
4486
+ const isSelected = option.id === country;
4487
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
4488
+ "button",
4489
+ {
4490
+ "aria-selected": isSelected,
4491
+ className: cn(
4492
+ "flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm outline-none transition-colors",
4493
+ "hover:bg-muted/60 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
4494
+ isSelected ? "bg-accent" : null
4495
+ ),
4496
+ role: "option",
4497
+ type: "button",
4498
+ onClick: () => selectCountry(option.id),
4499
+ children: [
4500
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "text-base leading-none", children: option.flag }),
4501
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: option.label }),
4502
+ isSelected ? /* @__PURE__ */ jsxRuntime.jsx(
4503
+ lucideReact.CheckIcon,
4504
+ {
4505
+ "aria-hidden": true,
4506
+ className: "size-4 shrink-0"
4507
+ }
4508
+ ) : null
4509
+ ]
4510
+ }
4511
+ ) }, option.id);
4512
+ }) }) })
4513
+ ] }) }) : null
4514
+ ]
4515
+ }
4516
+ );
4517
+ }
3891
4518
  var DEFAULT_LABELS2 = {
3892
4519
  uploadAria: "Upload image",
3893
4520
  uploadHint: "Click to upload",
@@ -3916,18 +4543,18 @@ function AvatarEditor({
3916
4543
  labels
3917
4544
  }) {
3918
4545
  const t = { ...DEFAULT_LABELS2, ...labels };
3919
- const canvasRef = React3.useRef(null);
3920
- const fileInputRef = React3.useRef(null);
3921
- const containerRef = React3.useRef(null);
3922
- const [image, setImage] = React3.useState(null);
3923
- const [imageLoaded, setImageLoaded] = React3.useState(false);
3924
- const [zoom, setZoom] = React3.useState(1);
3925
- const [rotation, setRotation] = React3.useState(0);
3926
- const [position, setPosition] = React3.useState({ x: 0, y: 0 });
3927
- const [isDragging, setIsDragging] = React3.useState(false);
3928
- const [dragStart, setDragStart] = React3.useState({ x: 0, y: 0 });
3929
- const [showGrid, setShowGrid] = React3.useState(initialShowGrid);
3930
- const generateOutput = React3.useCallback(() => {
4546
+ const canvasRef = React6.useRef(null);
4547
+ const fileInputRef = React6.useRef(null);
4548
+ const containerRef = React6.useRef(null);
4549
+ const [image, setImage] = React6.useState(null);
4550
+ const [imageLoaded, setImageLoaded] = React6.useState(false);
4551
+ const [zoom, setZoom] = React6.useState(1);
4552
+ const [rotation, setRotation] = React6.useState(0);
4553
+ const [position, setPosition] = React6.useState({ x: 0, y: 0 });
4554
+ const [isDragging, setIsDragging] = React6.useState(false);
4555
+ const [dragStart, setDragStart] = React6.useState({ x: 0, y: 0 });
4556
+ const [showGrid, setShowGrid] = React6.useState(initialShowGrid);
4557
+ const generateOutput = React6.useCallback(() => {
3931
4558
  if (!canvasRef.current || !image) return null;
3932
4559
  const outputCanvas = document.createElement("canvas");
3933
4560
  outputCanvas.width = outputSize;
@@ -3938,7 +4565,7 @@ function AvatarEditor({
3938
4565
  const mimeType = `image/${outputFormat}`;
3939
4566
  return outputCanvas.toDataURL(mimeType, outputQuality);
3940
4567
  }, [image, outputSize, outputFormat, outputQuality]);
3941
- React3.useEffect(() => {
4568
+ React6.useEffect(() => {
3942
4569
  if (!canvasRef.current || !image || !imageLoaded) return;
3943
4570
  const canvas = canvasRef.current;
3944
4571
  const ctx = canvas.getContext("2d");
@@ -3982,12 +4609,12 @@ function AvatarEditor({
3982
4609
  generateOutput,
3983
4610
  onChange
3984
4611
  ]);
3985
- const resetTransforms = React3.useCallback(() => {
4612
+ const resetTransforms = React6.useCallback(() => {
3986
4613
  setZoom(1);
3987
4614
  setRotation(0);
3988
4615
  setPosition({ x: 0, y: 0 });
3989
4616
  }, []);
3990
- const handleFileSelect = React3.useCallback(
4617
+ const handleFileSelect = React6.useCallback(
3991
4618
  (e) => {
3992
4619
  const file = e.target.files?.[0];
3993
4620
  if (!file) return;
@@ -4006,7 +4633,7 @@ function AvatarEditor({
4006
4633
  },
4007
4634
  [resetTransforms]
4008
4635
  );
4009
- const handleMouseDown = React3.useCallback(
4636
+ const handleMouseDown = React6.useCallback(
4010
4637
  (e) => {
4011
4638
  if (!imageLoaded) return;
4012
4639
  setIsDragging(true);
@@ -4014,7 +4641,7 @@ function AvatarEditor({
4014
4641
  },
4015
4642
  [imageLoaded, position]
4016
4643
  );
4017
- const handleMouseMove = React3.useCallback(
4644
+ const handleMouseMove = React6.useCallback(
4018
4645
  (e) => {
4019
4646
  if (!isDragging) return;
4020
4647
  setPosition({
@@ -4024,10 +4651,10 @@ function AvatarEditor({
4024
4651
  },
4025
4652
  [isDragging, dragStart]
4026
4653
  );
4027
- const handleMouseUp = React3.useCallback(() => {
4654
+ const handleMouseUp = React6.useCallback(() => {
4028
4655
  setIsDragging(false);
4029
4656
  }, []);
4030
- const handleTouchStart = React3.useCallback(
4657
+ const handleTouchStart = React6.useCallback(
4031
4658
  (e) => {
4032
4659
  if (!imageLoaded) return;
4033
4660
  const touch = e.touches[0];
@@ -4039,7 +4666,7 @@ function AvatarEditor({
4039
4666
  },
4040
4667
  [imageLoaded, position]
4041
4668
  );
4042
- const handleTouchMove = React3.useCallback(
4669
+ const handleTouchMove = React6.useCallback(
4043
4670
  (e) => {
4044
4671
  if (!isDragging) return;
4045
4672
  const touch = e.touches[0];
@@ -4050,7 +4677,7 @@ function AvatarEditor({
4050
4677
  },
4051
4678
  [isDragging, dragStart]
4052
4679
  );
4053
- const handleDiscard = React3.useCallback(() => {
4680
+ const handleDiscard = React6.useCallback(() => {
4054
4681
  setImage(null);
4055
4682
  setImageLoaded(false);
4056
4683
  resetTransforms();
@@ -4421,8 +5048,8 @@ function AvatarEditor({
4421
5048
  );
4422
5049
  }
4423
5050
  function useMediaQuery2(query) {
4424
- const [matches, setMatches] = React3.useState(false);
4425
- React3.useEffect(() => {
5051
+ const [matches, setMatches] = React6.useState(false);
5052
+ React6.useEffect(() => {
4426
5053
  const media = window.matchMedia(query);
4427
5054
  if (media.matches !== matches) {
4428
5055
  setMatches(media.matches);
@@ -4452,17 +5079,17 @@ function AvatarEditorDialog({
4452
5079
  className,
4453
5080
  editorLabels
4454
5081
  }) {
4455
- const [isOpen, setIsOpen] = React3.useState(false);
4456
- const [editedValue, setEditedValue] = React3.useState(value ?? null);
4457
- const [displaySrc, setDisplaySrc] = React3.useState(value ?? null);
4458
- const [isSaving, setIsSaving] = React3.useState(false);
4459
- const [feedback, setFeedback] = React3.useState(null);
4460
- React3.useEffect(() => {
5082
+ const [isOpen, setIsOpen] = React6.useState(false);
5083
+ const [editedValue, setEditedValue] = React6.useState(value ?? null);
5084
+ const [displaySrc, setDisplaySrc] = React6.useState(value ?? null);
5085
+ const [isSaving, setIsSaving] = React6.useState(false);
5086
+ const [feedback, setFeedback] = React6.useState(null);
5087
+ React6.useEffect(() => {
4461
5088
  setDisplaySrc(value ?? null);
4462
5089
  }, [value]);
4463
5090
  const isMobile = useMediaQuery2("(max-width: 640px)");
4464
5091
  const caption = (placeholder ?? "").trim();
4465
- const handleOpenChange = React3.useCallback(
5092
+ const handleOpenChange = React6.useCallback(
4466
5093
  (open) => {
4467
5094
  if (open) {
4468
5095
  setEditedValue(value ?? null);
@@ -4472,7 +5099,7 @@ function AvatarEditorDialog({
4472
5099
  },
4473
5100
  [value]
4474
5101
  );
4475
- const handleAccept = React3.useCallback(async () => {
5102
+ const handleAccept = React6.useCallback(async () => {
4476
5103
  if (!editedValue) return;
4477
5104
  setIsSaving(true);
4478
5105
  setFeedback(null);
@@ -4739,10 +5366,10 @@ function FileDropzone({
4739
5366
  className
4740
5367
  }) {
4741
5368
  const labels = { ...DEFAULT_FILE_DROPZONE_LABELS, ...labelOverrides };
4742
- const inputId = React3.useId();
4743
- const inputRef = React3.useRef(null);
4744
- const [dragging, setDragging] = React3.useState(false);
4745
- const [message, setMessage] = React3.useState(null);
5369
+ const inputId = React6.useId();
5370
+ const inputRef = React6.useRef(null);
5371
+ const [dragging, setDragging] = React6.useState(false);
5372
+ const [message, setMessage] = React6.useState(null);
4746
5373
  function takeFile(file) {
4747
5374
  if (!file || disabled) return;
4748
5375
  if (!fileMatchesAccept(file, accept)) {
@@ -4996,7 +5623,7 @@ function FileUploadMenu({
4996
5623
  }) {
4997
5624
  const labels = { ...DEFAULT_FILE_UPLOAD_TRAY_LABELS, ...labelOverrides };
4998
5625
  const visible = jobs.filter((job) => job.status !== "cancelled");
4999
- const [uncontrolledOpen, setUncontrolledOpen] = React3.useState(false);
5626
+ const [uncontrolledOpen, setUncontrolledOpen] = React6.useState(false);
5000
5627
  const isControlled = open !== void 0;
5001
5628
  const resolvedOpen = isControlled ? open : uncontrolledOpen;
5002
5629
  function setResolvedOpen(next) {
@@ -5607,10 +6234,10 @@ function CookieConsentBanner({
5607
6234
  className
5608
6235
  }) {
5609
6236
  const copy = { ...DEFAULT_COOKIE_CONSENT_BANNER_LABELS, ...labels };
5610
- const [consent, setConsent] = React3.useState(
6237
+ const [consent, setConsent] = React6.useState(
5611
6238
  "pending"
5612
6239
  );
5613
- React3.useEffect(() => {
6240
+ React6.useEffect(() => {
5614
6241
  if (variant === "embed" || isEmbeddedWindow()) {
5615
6242
  setConsent("necessary");
5616
6243
  return;
@@ -6087,7 +6714,7 @@ function FormSection({
6087
6714
  );
6088
6715
  }
6089
6716
  function useDirtyGuard(dirty) {
6090
- React3.useEffect(() => {
6717
+ React6.useEffect(() => {
6091
6718
  if (!dirty) return;
6092
6719
  function onBeforeUnload(event) {
6093
6720
  event.preventDefault();
@@ -6239,7 +6866,7 @@ function useQueueKeys({
6239
6866
  selectedId,
6240
6867
  onSelect
6241
6868
  }) {
6242
- const move = React3.useCallback(
6869
+ const move = React6.useCallback(
6243
6870
  (delta) => {
6244
6871
  if (ids.length === 0) return;
6245
6872
  const currentIndex = selectedId ? ids.indexOf(selectedId) : -1;
@@ -6254,7 +6881,7 @@ function useQueueKeys({
6254
6881
  },
6255
6882
  [ids, onSelect, selectedId]
6256
6883
  );
6257
- React3.useEffect(() => {
6884
+ React6.useEffect(() => {
6258
6885
  if (!enabled) return;
6259
6886
  function onKeyDown(event) {
6260
6887
  if (isTypingTarget(event.target)) return;
@@ -6358,8 +6985,8 @@ function prefersReducedMotion() {
6358
6985
  return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
6359
6986
  }
6360
6987
  function useSectionNav(sections) {
6361
- const [active, setActive] = React3.useState(sections[0]?.id ?? "");
6362
- React3.useEffect(() => {
6988
+ const [active, setActive] = React6.useState(sections[0]?.id ?? "");
6989
+ React6.useEffect(() => {
6363
6990
  const elements = sections.map((section) => document.getElementById(section.id)).filter((node) => node !== null);
6364
6991
  if (elements.length === 0) return;
6365
6992
  const observer = new IntersectionObserver(
@@ -6838,8 +7465,8 @@ function MatchReview({
6838
7465
  className
6839
7466
  }) {
6840
7467
  const copy = { ...DEFAULT_MATCH_REVIEW_LABELS, ...labels };
6841
- const reasonId = React3.useId();
6842
- const [reason, setReason] = React3.useState("");
7468
+ const reasonId = React6.useId();
7469
+ const [reason, setReason] = React6.useState("");
6843
7470
  const trimmed = reason.trim();
6844
7471
  if (!hit) {
6845
7472
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -7017,10 +7644,12 @@ exports.PageTitle = PageTitle;
7017
7644
  exports.PageTitleSkeleton = PageTitleSkeleton;
7018
7645
  exports.PaginatedCombobox = PaginatedCombobox;
7019
7646
  exports.PasswordInput = PasswordInput;
7647
+ exports.PhoneInput = PhoneInput;
7020
7648
  exports.QueueLayout = QueueLayout;
7021
7649
  exports.RfcInput = RfcInput;
7022
7650
  exports.RiskBadge = RiskBadge;
7023
7651
  exports.RouteLoading = RouteLoading;
7652
+ exports.SAT_TAX_REGIME_CODES = SAT_TAX_REGIME_CODES;
7024
7653
  exports.SafeImage = SafeImage;
7025
7654
  exports.SearchablePicker = SearchablePicker;
7026
7655
  exports.SectionCard = SectionCard;
@@ -7033,11 +7662,13 @@ exports.StatHighlightCard = StatHighlightCard;
7033
7662
  exports.StatusBadge = StatusBadge;
7034
7663
  exports.StepProgress = StepProgress;
7035
7664
  exports.StickyActionBar = StickyActionBar;
7665
+ exports.TAX_REGIME_OPTIONS = TAX_REGIME_OPTIONS;
7036
7666
  exports.THEME_INIT_SCRIPT = THEME_INIT_SCRIPT;
7037
7667
  exports.THEME_INIT_SCRIPT_ID = THEME_INIT_SCRIPT_ID;
7038
7668
  exports.THEME_STORAGE_KEY = THEME_STORAGE_KEY;
7039
7669
  exports.TIME_RANGE_OPTIONS = TIME_RANGE_OPTIONS;
7040
7670
  exports.TableSkeleton = TableSkeleton;
7671
+ exports.TaxRegimePicker = TaxRegimePicker;
7041
7672
  exports.ThemeSwitcher = ThemeSwitcher;
7042
7673
  exports.TimeRangePicker = TimeRangePicker;
7043
7674
  exports.WizardLayout = WizardLayout;
@@ -7053,12 +7684,15 @@ exports.dataTableBodyMinClass = dataTableBodyMinClass;
7053
7684
  exports.defaultLanguages = defaultLanguages;
7054
7685
  exports.fileMatchesAccept = fileMatchesAccept;
7055
7686
  exports.filterCountries = filterCountries;
7687
+ exports.filterTaxRegimes = filterTaxRegimes;
7056
7688
  exports.formatCountryOptionLabel = formatCountryOptionLabel;
7689
+ exports.formatTaxRegimeOptionLabel = formatTaxRegimeOptionLabel;
7057
7690
  exports.getAvatarColors = getAvatarColors;
7058
7691
  exports.getInitials = getInitials;
7059
7692
  exports.isCookieConsentValue = isCookieConsentValue;
7060
7693
  exports.isEmbeddedWindow = isEmbeddedWindow;
7061
7694
  exports.isKnownCountryCode = isKnownCountryCode;
7695
+ exports.isKnownTaxRegimeCode = isKnownTaxRegimeCode;
7062
7696
  exports.matchClaimIsUnverified = matchClaimIsUnverified;
7063
7697
  exports.normalizeCurpInput = normalizeCurpInput;
7064
7698
  exports.normalizeRfc = normalizeRfc;
@@ -7073,6 +7707,8 @@ exports.serializeCookieConsent = serializeCookieConsent;
7073
7707
  exports.signalNavigationStart = signalNavigationStart;
7074
7708
  exports.sourceUrlIsHttps = sourceUrlIsHttps;
7075
7709
  exports.suppressNavigationProgress = suppressNavigationProgress;
7710
+ exports.taxRegimeLabel = taxRegimeLabel;
7711
+ exports.taxRegimePickerItems = taxRegimePickerItems;
7076
7712
  exports.useDirtyGuard = useDirtyGuard;
7077
7713
  exports.useEditableSection = useEditableSection;
7078
7714
  exports.useLanguageContext = useLanguageContext;