@vehiclehistory/property-lib 0.0.97 → 0.0.941

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/main.es.js CHANGED
@@ -524,7 +524,7 @@ const W = {
524
524
  }
525
525
  }
526
526
  );
527
- }, x = A(Q), J = ({
527
+ }, y = A(Q), J = ({
528
528
  children: d,
529
529
  className: e,
530
530
  clickHandler: t,
@@ -559,7 +559,7 @@ const W = {
559
559
  children: [
560
560
  /* @__PURE__ */ c("div", { className: "accordion-title font-medium text-slate-700 sm-max:!text-base text-lg flex items-center", children: n }),
561
561
  /* @__PURE__ */ c("span", { className: "accordion-icon ml-6 h-7 flex items-center", children: /* @__PURE__ */ c(
562
- x,
562
+ y,
563
563
  {
564
564
  name: "chevronDown",
565
565
  size: "small",
@@ -624,24 +624,24 @@ const W = {
624
624
  iconColor: "text-yellow-500",
625
625
  styles: "bg-yellow-50 border-yellow-300 text-yellow-700"
626
626
  }
627
- }, { icon: o, iconColor: p, styles: u } = l[i];
627
+ }, { icon: o, iconColor: u, styles: p } = l[i];
628
628
  return /* @__PURE__ */ c(
629
629
  "div",
630
630
  {
631
631
  id: i,
632
632
  className: m(
633
633
  "rounded w-full py-2 px-4 mb-4 border",
634
- u,
634
+ p,
635
635
  e
636
636
  ),
637
637
  ...r,
638
638
  children: /* @__PURE__ */ M("div", { className: "flex", children: [
639
639
  /* @__PURE__ */ c("div", { className: "flex-shrink-0", children: /* @__PURE__ */ c(
640
- x,
640
+ y,
641
641
  {
642
642
  name: o,
643
643
  viewBox: "0 0 24 24",
644
- className: p,
644
+ className: u,
645
645
  size: "xSmall"
646
646
  }
647
647
  ) }),
@@ -674,13 +674,13 @@ const W = {
674
674
  leftIcon: i = "homeSearch",
675
675
  mobileBackdrop: l = !1,
676
676
  name: o = "",
677
- options: p = [],
678
- parentProps: u = {},
677
+ options: u = [],
678
+ parentProps: p = {},
679
679
  placeholder: V = "",
680
680
  props: C = {},
681
681
  rightIcon: f = "",
682
682
  required: g = !1,
683
- showSearchIcon: y = !0,
683
+ showSearchIcon: x = !0,
684
684
  showRightIcon: h = !1,
685
685
  size: v = "medium",
686
686
  styles: w = null,
@@ -699,9 +699,9 @@ const W = {
699
699
  "data-use-google": j,
700
700
  className: m("Autocomplete", e),
701
701
  style: w ? { ...w } : null,
702
- ...u,
702
+ ...p,
703
703
  children: [
704
- y && /* @__PURE__ */ M(
704
+ x && /* @__PURE__ */ M(
705
705
  "span",
706
706
  {
707
707
  className: m(
@@ -712,7 +712,7 @@ const W = {
712
712
  ),
713
713
  children: [
714
714
  /* @__PURE__ */ c(
715
- x,
715
+ y,
716
716
  {
717
717
  className: "home-search select-none text-gray-500",
718
718
  name: i,
@@ -721,7 +721,7 @@ const W = {
721
721
  }
722
722
  ),
723
723
  /* @__PURE__ */ c(
724
- x,
724
+ y,
725
725
  {
726
726
  className: "arrow-left select-none text-gray-500 hidden",
727
727
  name: "arrowLeft",
@@ -740,7 +740,7 @@ const W = {
740
740
  className: m(
741
741
  "w-full bg-white placeholder:bg-white rounded border border-gray-300 py-2 pr-8 shadow-sm focus:outline-none sm-max:text-sm placeholder:text-gray-500 sm-max:placeholder:text-sm placeholder-shown:text-ellipsis truncate",
742
742
  {
743
- "pl-8": y === !0,
743
+ "pl-8": x === !0,
744
744
  "px-3 h-10": v === "medium",
745
745
  "px-4 h-12": v === "large",
746
746
  "px-5 h-[60px] sm:!text-base": v === "xLarge",
@@ -764,7 +764,7 @@ const W = {
764
764
  className: m(
765
765
  "floating-label absolute text-sm !normal-case text-gray-500 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-focus:text-[#222] peer-focus:px-2 peer-focus:bg-white peer-placeholder-shown:bg-white peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 start-1 pointer-events-none",
766
766
  {
767
- "!left-7": y === !0,
767
+ "!left-7": x === !0,
768
768
  "left-2": v === "medium",
769
769
  "left-3": v === "large",
770
770
  "left-4": v === "xLarge"
@@ -779,7 +779,7 @@ const W = {
779
779
  "data-id": "search-clear",
780
780
  className: "clear-btn absolute inset-y-0 right-0 flex items-center px-2 hidden",
781
781
  children: /* @__PURE__ */ c(
782
- x,
782
+ y,
783
783
  {
784
784
  className: "cursor-pointer text-gray-500",
785
785
  name: "xCircle",
@@ -795,7 +795,7 @@ const W = {
795
795
  "data-id": "search-loading",
796
796
  className: "absolute inset-y-0 right-0 flex items-center px-2 pointer-events-none hidden",
797
797
  children: /* @__PURE__ */ c(
798
- x,
798
+ y,
799
799
  {
800
800
  className: "animate-spin text-[#222]] pointer-events-none",
801
801
  name: "spinnerDark",
@@ -810,7 +810,7 @@ const W = {
810
810
  {
811
811
  "data-id": "right-icon",
812
812
  className: `${h ? "" : "hidden"} absolute inset-y-0 right-0 flex items-center px-2 pointer-events-none`,
813
- children: /* @__PURE__ */ c(x, { name: f, size: "small", viewBox: "0 0 24 24" })
813
+ children: /* @__PURE__ */ c(y, { name: f, size: "small", viewBox: "0 0 24 24" })
814
814
  }
815
815
  ),
816
816
  /* @__PURE__ */ M(
@@ -828,7 +828,7 @@ const W = {
828
828
  "data-title": b,
829
829
  "aria-labelledby": "Label",
830
830
  "aria-activedescendant": "search-item-0",
831
- children: p.length > 0 ? p.map((k, z) => /* @__PURE__ */ c(
831
+ children: u.length > 0 ? u.map((k, z) => /* @__PURE__ */ c(
832
832
  "li",
833
833
  {
834
834
  id: `search-item-${z}`,
@@ -878,8 +878,8 @@ const W = {
878
878
  props: i = {},
879
879
  rightIcon: l,
880
880
  rightIconProps: o = {},
881
- rounded: p = !1,
882
- size: u = "md",
881
+ rounded: u = !1,
882
+ size: p = "md",
883
883
  type: V = "button",
884
884
  uppercase: C = !1,
885
885
  variation: f = "primary"
@@ -893,8 +893,8 @@ const W = {
893
893
  "button",
894
894
  {
895
895
  [`button--${f}`]: f,
896
- [`button--${u}`]: u,
897
- "button--rounded": p,
896
+ [`button--${p}`]: p,
897
+ "button--rounded": u,
898
898
  "button--disabled": s,
899
899
  "button--custom-link": r,
900
900
  "button--uppercase": C,
@@ -907,20 +907,20 @@ const W = {
907
907
  ...i,
908
908
  children: [
909
909
  e && /* @__PURE__ */ c(
910
- x,
910
+ y,
911
911
  {
912
912
  name: e,
913
- size: u === "md" ? "small" : "xSmall",
913
+ size: p === "md" ? "small" : "xSmall",
914
914
  viewBox: "0 0 24 24",
915
915
  ...t
916
916
  }
917
917
  ),
918
918
  a,
919
919
  l && /* @__PURE__ */ c(
920
- x,
920
+ y,
921
921
  {
922
922
  name: l,
923
- size: u === "md" ? "small" : "xSmall",
923
+ size: p === "md" ? "small" : "xSmall",
924
924
  viewBox: "0 0 24 24",
925
925
  ...o
926
926
  }
@@ -939,11 +939,11 @@ const W = {
939
939
  name: i = "",
940
940
  props: l = {},
941
941
  variation: o = "primary",
942
- value: p = ""
942
+ value: u = ""
943
943
  }) => {
944
- const u = r ? "div" : "label", V = u === "label" ? { htmlFor: s } : {};
944
+ const p = r ? "div" : "label", V = p === "label" ? { htmlFor: s } : {};
945
945
  return /* @__PURE__ */ M(
946
- u,
946
+ p,
947
947
  {
948
948
  className: m("checkbox flex items-center", o, t),
949
949
  ...V,
@@ -962,7 +962,7 @@ const W = {
962
962
  id: s,
963
963
  name: i,
964
964
  type: "checkbox",
965
- value: p,
965
+ value: u,
966
966
  ...l
967
967
  }
968
968
  ),
@@ -981,13 +981,13 @@ const W = {
981
981
  disableClose: i = !1,
982
982
  footer: l,
983
983
  fullMobile: o = !0,
984
- headerClass: p,
985
- hideClose: u = !1,
984
+ headerClass: u,
985
+ hideClose: p = !1,
986
986
  iconSize: V = "medium",
987
987
  preventPageScroll: C = !0,
988
988
  stickyHeader: f = !1,
989
989
  title: g = "",
990
- titleClass: y,
990
+ titleClass: x,
991
991
  useFormMethod: h = !0
992
992
  }) => {
993
993
  const v = h ? "form" : "div";
@@ -1024,11 +1024,11 @@ const W = {
1024
1024
  "!pb-0 border-0 justify-end": !g,
1025
1025
  "justify-between border-b": g
1026
1026
  },
1027
- p
1027
+ u
1028
1028
  ),
1029
1029
  children: [
1030
- g && /* @__PURE__ */ c("h3", { id: `${e}-dialog-title`, className: y, children: g }),
1031
- !u && /* @__PURE__ */ c(
1030
+ g && /* @__PURE__ */ c("h3", { id: `${e}-dialog-title`, className: x, children: g }),
1031
+ !p && /* @__PURE__ */ c(
1032
1032
  "button",
1033
1033
  {
1034
1034
  type: "button",
@@ -1037,7 +1037,7 @@ const W = {
1037
1037
  "data-dialog-close": "",
1038
1038
  value: "close",
1039
1039
  children: /* @__PURE__ */ c(
1040
- x,
1040
+ y,
1041
1041
  {
1042
1042
  name: "close",
1043
1043
  size: V,
@@ -1090,15 +1090,15 @@ const W = {
1090
1090
  function r({ cb: i }) {
1091
1091
  const l = document.querySelector(".loading-bar__inner");
1092
1092
  if (!l) return;
1093
- let o, p, u = !1;
1093
+ let o, u, p = !1;
1094
1094
  function V(C) {
1095
1095
  o === void 0 && (o = C);
1096
1096
  const f = C - o;
1097
- if (p !== C) {
1097
+ if (u !== C) {
1098
1098
  const g = f / n * 101;
1099
- l.style.width = `${g}%`, e && e({ elapsed: f, percentage: g }), g >= 101 && (i && i(), u = !0, window.cancelAnimationFrame(C));
1099
+ l.style.width = `${g}%`, e && e({ elapsed: f, percentage: g }), g >= 101 && (i && i(), p = !0, window.cancelAnimationFrame(C));
1100
1100
  }
1101
- f < n && (p = C, u || window.requestAnimationFrame(V));
1101
+ f < n && (u = C, p || window.requestAnimationFrame(V));
1102
1102
  }
1103
1103
  window.requestAnimationFrame(V);
1104
1104
  }
@@ -1185,7 +1185,7 @@ const W = {
1185
1185
  rounded: l = !0,
1186
1186
  showLabel: o = !1
1187
1187
  }) => {
1188
- const u = ((V, C) => {
1188
+ const p = ((V, C) => {
1189
1189
  if (V) {
1190
1190
  const f = Number(C) / V;
1191
1191
  return f > 1 ? 100 : f * 100;
@@ -1212,7 +1212,7 @@ const W = {
1212
1212
  "h-full text-right flex items-center justify-end rounded-full",
1213
1213
  t
1214
1214
  ),
1215
- style: { width: `${u}%` },
1215
+ style: { width: `${p}%` },
1216
1216
  children: o && /* @__PURE__ */ c(
1217
1217
  "span",
1218
1218
  {
@@ -1220,7 +1220,7 @@ const W = {
1220
1220
  "font-bold text-white text-xs mr-2",
1221
1221
  r
1222
1222
  ),
1223
- children: s || Math.round(u)
1223
+ children: s || Math.round(p)
1224
1224
  }
1225
1225
  )
1226
1226
  }
@@ -1239,12 +1239,12 @@ const W = {
1239
1239
  variation: l = "primary",
1240
1240
  value: o = ""
1241
1241
  }) => {
1242
- const p = s ? "div" : "label", u = p === "label" ? { htmlFor: a } : {};
1242
+ const u = s ? "div" : "label", p = u === "label" ? { htmlFor: a } : {};
1243
1243
  return /* @__PURE__ */ M(
1244
- p,
1244
+ u,
1245
1245
  {
1246
1246
  className: m("radio flex items-center", t),
1247
- ...u,
1247
+ ...p,
1248
1248
  children: [
1249
1249
  /* @__PURE__ */ c(
1250
1250
  "input",
@@ -1279,16 +1279,16 @@ const W = {
1279
1279
  placeholder: i = "",
1280
1280
  props: l = {},
1281
1281
  selectClass: o = "",
1282
- styles: p = null,
1283
- variation: u = "primary",
1282
+ styles: u = null,
1283
+ variation: p = "primary",
1284
1284
  value: V
1285
1285
  }) => {
1286
1286
  const C = i ? { defaultValue: "" } : {};
1287
1287
  return /* @__PURE__ */ M(
1288
1288
  "label",
1289
1289
  {
1290
- className: m("relative select", d, u),
1291
- style: p ? { ...p } : null,
1290
+ className: m("relative select", d, p),
1291
+ style: u ? { ...u } : null,
1292
1292
  children: [
1293
1293
  n,
1294
1294
  /* @__PURE__ */ M(
@@ -1331,7 +1331,7 @@ const W = {
1331
1331
  d
1332
1332
  ),
1333
1333
  children: [
1334
- /* @__PURE__ */ c(x, { size: "xLarge", name: "map", className: "mx-auto" }),
1334
+ /* @__PURE__ */ c(y, { size: "xLarge", name: "map", className: "mx-auto" }),
1335
1335
  /* @__PURE__ */ c("span", { className: "sr-only", children: "Loading..." })
1336
1336
  ]
1337
1337
  }
@@ -1349,7 +1349,7 @@ const W = {
1349
1349
  id: `btn-left-${a}`,
1350
1350
  type: "button",
1351
1351
  className: "slider-button__prev ",
1352
- children: /* @__PURE__ */ c(x, { name: "chevronLeft" })
1352
+ children: /* @__PURE__ */ c(y, { name: "chevronLeft" })
1353
1353
  }
1354
1354
  ),
1355
1355
  /* @__PURE__ */ c("div", { id: `slider-container-${a}`, className: "slider-container", children: Array.from({ length: 4 }, (s, r) => /* @__PURE__ */ c(
@@ -1367,11 +1367,11 @@ const W = {
1367
1367
  id: `btn-right-${a}`,
1368
1368
  type: "button",
1369
1369
  className: "slider-button__next",
1370
- children: /* @__PURE__ */ c(x, { name: "chevronRight" })
1370
+ children: /* @__PURE__ */ c(y, { name: "chevronRight" })
1371
1371
  }
1372
1372
  )
1373
1373
  ] }), Q1 = A(r1), i1 = ({ className: d, iconClass: e, iconProps: t = {} }) => /* @__PURE__ */ c("div", { className: m("rounded-r-md px-2 focus:outline-none", d), children: /* @__PURE__ */ c(
1374
- x,
1374
+ y,
1375
1375
  {
1376
1376
  className: m("animate-spin text-black-900", e),
1377
1377
  size: "xSmall",
@@ -1407,8 +1407,8 @@ const W = {
1407
1407
  placeholder: i = "",
1408
1408
  props: l = {},
1409
1409
  rows: o = 4,
1410
- variation: p = "primary"
1411
- }) => /* @__PURE__ */ M("div", { className: m("relative textarea", p, d), children: [
1410
+ variation: u = "primary"
1411
+ }) => /* @__PURE__ */ M("div", { className: m("relative textarea", u, d), children: [
1412
1412
  /* @__PURE__ */ c(
1413
1413
  "textarea",
1414
1414
  {
@@ -1433,7 +1433,7 @@ const W = {
1433
1433
  id: `${n}-clear`,
1434
1434
  className: "textarea-clear absolute right-0 top-2 bottom-auto flex items-center rounded-r-md pr-2 focus:outline-none hidden",
1435
1435
  children: /* @__PURE__ */ c(
1436
- x,
1436
+ y,
1437
1437
  {
1438
1438
  size: "xSmall",
1439
1439
  name: "xCircle",
@@ -1454,18 +1454,18 @@ const W = {
1454
1454
  name: i = "",
1455
1455
  placeholder: l = "",
1456
1456
  props: o = {},
1457
- styles: p = null,
1458
- type: u = "text",
1457
+ styles: u = null,
1458
+ type: p = "text",
1459
1459
  value: V,
1460
1460
  variation: C = "primary"
1461
1461
  }) => /* @__PURE__ */ M(
1462
1462
  "div",
1463
1463
  {
1464
1464
  className: m("relative textbox", C, d),
1465
- style: p ? { ...p } : null,
1465
+ style: u ? { ...u } : null,
1466
1466
  children: [
1467
1467
  n && /* @__PURE__ */ c("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center px-2", children: /* @__PURE__ */ c(
1468
- x,
1468
+ y,
1469
1469
  {
1470
1470
  size: "xSmall",
1471
1471
  name: n,
@@ -1479,7 +1479,7 @@ const W = {
1479
1479
  placeholder: l,
1480
1480
  id: s,
1481
1481
  name: i,
1482
- type: u,
1482
+ type: p,
1483
1483
  value: V,
1484
1484
  autoComplete: "off",
1485
1485
  className: m(
@@ -1501,7 +1501,7 @@ const W = {
1501
1501
  id: `${s}-clear`,
1502
1502
  className: "textbox-clear absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none hidden",
1503
1503
  children: /* @__PURE__ */ c(
1504
- x,
1504
+ y,
1505
1505
  {
1506
1506
  size: "xSmall",
1507
1507
  name: "xCircle",
@@ -1644,23 +1644,23 @@ const W = {
1644
1644
  headerClass: i,
1645
1645
  list: l = !1,
1646
1646
  props: o = {},
1647
- variation: p = "primary"
1647
+ variation: u = "primary"
1648
1648
  }) => {
1649
- const u = l ? "ul" : "div";
1649
+ const p = l ? "ul" : "div";
1650
1650
  return /* @__PURE__ */ M(
1651
1651
  "div",
1652
1652
  {
1653
1653
  className: m(
1654
1654
  "content-card",
1655
1655
  { "content-card--block": d },
1656
- `content-card--${p}`,
1656
+ `content-card--${u}`,
1657
1657
  t
1658
1658
  ),
1659
1659
  ...o,
1660
1660
  children: [
1661
1661
  r && /* @__PURE__ */ c("div", { className: m("content-card__header", i), children: typeof r == "string" ? /* @__PURE__ */ c("h3", { children: r }) : r }),
1662
1662
  /* @__PURE__ */ c(
1663
- u,
1663
+ p,
1664
1664
  {
1665
1665
  className: m("content-card__content", a),
1666
1666
  role: l ? "list" : null,
@@ -1682,7 +1682,7 @@ const W = {
1682
1682
  rowGap: i = 1,
1683
1683
  value: l,
1684
1684
  valueClass: o,
1685
- wrap: p = !1
1685
+ wrap: u = !1
1686
1686
  }) => /* @__PURE__ */ M(
1687
1687
  "div",
1688
1688
  {
@@ -1691,7 +1691,7 @@ const W = {
1691
1691
  {
1692
1692
  "flex-col items-start": a === "col",
1693
1693
  "flex-row items-center": a === "row",
1694
- "flex-wrap": p
1694
+ "flex-wrap": u
1695
1695
  },
1696
1696
  e
1697
1697
  ),
@@ -1888,7 +1888,7 @@ const W = {
1888
1888
  }, A1 = {
1889
1889
  0: "0ms",
1890
1890
  50: "50ms"
1891
- }, x1 = {
1891
+ }, y1 = {
1892
1892
  "center-top": "center 30%"
1893
1893
  }, O = {
1894
1894
  animation: V1,
@@ -1900,7 +1900,7 @@ const W = {
1900
1900
  maxWidth: v1,
1901
1901
  screens: b1,
1902
1902
  transitionDuration: A1,
1903
- transformOrigin: x1
1903
+ transformOrigin: y1
1904
1904
  }, I = {
1905
1905
  black: {
1906
1906
  50: "#FCFCFC",
@@ -2011,7 +2011,7 @@ const W = {
2011
2011
  }, s2 = {
2012
2012
  ...I,
2013
2013
  ...B
2014
- }, y1 = ({ matchUtilities: d, theme: e }) => d(
2014
+ }, x1 = ({ matchUtilities: d, theme: e }) => d(
2015
2015
  {
2016
2016
  aspect: (t) => ({
2017
2017
  "@supports (aspect-ratio: 1 / 1)": {
@@ -2060,18 +2060,18 @@ const W = {
2060
2060
  weightProps: i = null
2061
2061
  }) => {
2062
2062
  const l = {};
2063
- Object.entries(s).forEach(([o, p]) => {
2064
- const u = {
2065
- "font-size": p,
2063
+ Object.entries(s).forEach(([o, u]) => {
2064
+ const p = {
2065
+ "font-size": u,
2066
2066
  ...a
2067
- }, V = `.${e(`${t}-${o}`)}`, C = n ? n({ sizeKey: o, sizeValue: p }) : {};
2067
+ }, V = `.${e(`${t}-${o}`)}`, C = n ? n({ sizeKey: o, sizeValue: u }) : {};
2068
2068
  l[V] = {
2069
- ...u,
2069
+ ...p,
2070
2070
  ...C
2071
2071
  }, Object.entries(r).forEach(([f, g]) => {
2072
- const y = `.${e(`${t}-${o}-${f}`)}`, h = i ? i({ sizeKey: o, sizeValue: p, weightKey: f, weightValue: g }) : {};
2073
- l[y] = {
2074
- ...u,
2072
+ const x = `.${e(`${t}-${o}-${f}`)}`, h = i ? i({ sizeKey: o, sizeValue: u, weightKey: f, weightValue: g }) : {};
2073
+ l[x] = {
2074
+ ...p,
2075
2075
  "font-weight": g,
2076
2076
  ...h
2077
2077
  };
@@ -2181,7 +2181,7 @@ const W = {
2181
2181
  classPrefix: "text-body",
2182
2182
  sizes: i,
2183
2183
  weights: s
2184
- }), y1({ matchUtilities: e, theme: t }), w1({ matchUtilities: e, theme: t }), S1({ matchUtilities: e }), k1({ matchUtilities: e });
2184
+ }), x1({ matchUtilities: e, theme: t }), w1({ matchUtilities: e, theme: t }), S1({ matchUtilities: e }), k1({ matchUtilities: e });
2185
2185
  }
2186
2186
  ], l2 = {
2187
2187
  theme: {
@@ -2218,11 +2218,11 @@ function o2(d, e = []) {
2218
2218
  function c2({ cb: d, form: e, formData: t, validations: a, reactive: n = !1 }) {
2219
2219
  let s = !0;
2220
2220
  for (const [r, i] of t.entries()) {
2221
- const l = e.querySelector(`[name="${r}"]`), o = a[r], p = [];
2222
- o.forEach((u) => {
2223
- u.isValid(i) || p.push(u.message);
2224
- }), p.length ? (s = !1, l.classList.add("field-error"), d && d({ isValid: s, field: l, validations: a })) : (l.classList.remove("field-error"), d && d({ isValid: !0, field: l, validations: a })), n && (l == null || l.addEventListener("input", (u) => {
2225
- u.preventDefault(), l.classList.contains("field-error") && l.classList.remove("field-error");
2221
+ const l = e.querySelector(`[name="${r}"]`), o = a[r], u = [];
2222
+ o.forEach((p) => {
2223
+ p.isValid(i) || u.push(p.message);
2224
+ }), u.length ? (s = !1, l.classList.add("field-error"), d && d({ isValid: s, field: l, validations: a })) : (l.classList.remove("field-error"), d && d({ isValid: !0, field: l, validations: a })), n && (l == null || l.addEventListener("input", (p) => {
2225
+ p.preventDefault(), l.classList.contains("field-error") && l.classList.remove("field-error");
2226
2226
  }));
2227
2227
  }
2228
2228
  return s;
@@ -2356,33 +2356,25 @@ class H {
2356
2356
  static async createData(e, t = null, a = !0, n = {}) {
2357
2357
  if (!t)
2358
2358
  return null;
2359
- const s = await this.createDataGetExtra({ useExtra: a }), r = typeof t == "string" ? t : JSON.stringify(t), i = (t == null ? void 0 : t.website) ?? H.getWebsiteHeaderName();
2359
+ const { tolken: s = null, ip: r = null } = await H.getHeaders(), i = a === !1 ? "" : "&tolken=" + s + "&ip=" + r, l = e + i, o = typeof t == "string" ? t : JSON.stringify(t), u = (t == null ? void 0 : t.website) ?? H.getWebsiteHeaderName();
2360
2360
  try {
2361
- const l = await fetch(e + s, {
2361
+ const p = await fetch(l, {
2362
2362
  method: "POST",
2363
- body: r === "null" ? null : r,
2363
+ body: o === "null" ? null : o,
2364
2364
  headers: {
2365
- website: i
2365
+ website: u
2366
2366
  },
2367
2367
  ...n
2368
- });
2369
- return await this.createDataReturn(l);
2370
- } catch (l) {
2371
- console.error("createData", l);
2368
+ }), V = p.headers.get("content-type");
2369
+ if (V && V.indexOf("application/json") !== -1)
2370
+ return p.json();
2371
+ const C = await p.text();
2372
+ return C ? C.replace("__next", "") : null;
2373
+ } catch (p) {
2374
+ console.error("createData", p);
2372
2375
  }
2373
2376
  return null;
2374
2377
  }
2375
- static async createDataGetExtra({ useExtra: e }) {
2376
- const { tolken: t = null, ip: a = null } = await H.getHeaders();
2377
- return e === !1 ? "" : "&tolken=" + t + "&ip=" + a;
2378
- }
2379
- static async createDataReturn(e) {
2380
- const t = e.headers.get("content-type");
2381
- if (t && t.indexOf("application/json") !== -1)
2382
- return e.json();
2383
- const a = await e.text();
2384
- return a ? a.replace("__next", "") : null;
2385
- }
2386
2378
  static dataLayer({ type: e = null, data: t = null }) {
2387
2379
  typeof dataLayer.push > "u" || typeof dataLayer.push > "u" || (e === "custom" && t && this.dlvCustom(t), e === "login" && t && this.dlvUserLogin(t), e === "userData" && t && this.dlvUserData(t));
2388
2380
  }
@@ -2441,8 +2433,8 @@ class H {
2441
2433
  try {
2442
2434
  const l = await fetch(i, { method: "GET" });
2443
2435
  if (t === !0) {
2444
- const p = await l.text();
2445
- return p ? p.replace("__next", "") : null;
2436
+ const u = await l.text();
2437
+ return u ? u.replace("__next", "") : null;
2446
2438
  }
2447
2439
  const o = l.headers.get("content-type");
2448
2440
  return o && o.indexOf("application/json") !== -1 ? l.json() : null;
@@ -2507,48 +2499,29 @@ class H {
2507
2499
  if (t === "license" || t === "license-plate")
2508
2500
  return "/report/license-plate";
2509
2501
  }
2510
- static async getHeaders({ ttl: e = 600, bypassSession: t = !1 } = {}) {
2511
- var p;
2502
+ static async getHeaders(e = 300) {
2503
+ var i, l;
2512
2504
  const {
2513
- userAgent: a = null,
2514
- userAgentData: n = null,
2515
- platform: s = null
2516
- } = navigator || {}, r = (n == null ? void 0 : n.platform) ?? s, i = {
2505
+ userAgent: t = null,
2506
+ userAgentData: a = null,
2507
+ platform: n = null
2508
+ } = navigator || {}, s = (a == null ? void 0 : a.platform) ?? n, r = {
2517
2509
  tolken: null,
2518
2510
  ip: null,
2519
- userAgent: a,
2520
- platform: r
2511
+ userAgent: t,
2512
+ platform: s
2521
2513
  };
2522
- if (typeof window.localStorage > "u")
2523
- return i;
2524
- const l = "headerSessionIdData", o = localStorage.getItem(l);
2525
- if (o && !t) {
2526
- const u = JSON.parse(o), V = (/* @__PURE__ */ new Date()).getTime();
2527
- if (console.log(`localStorage - ${u.expire - V}`), u.expire - V <= 0)
2528
- console.log(`expire localStorage & continue to call headers - ${l}`), localStorage.removeItem(l);
2529
- else
2530
- return {
2531
- tolken: u.tolken,
2532
- ip: null,
2533
- userAgent: a,
2534
- platform: r
2535
- };
2536
- }
2537
- if ((p = window == null ? void 0 : window.options) != null && p.isPdf)
2538
- return i;
2514
+ if (console.log((i = window == null ? void 0 : window.options) == null ? void 0 : i.isPdf), (l = window == null ? void 0 : window.options) != null && l.isPdf)
2515
+ return r;
2539
2516
  try {
2540
- const V = await (await fetch("/api/client-headers")).json(), C = (V == null ? void 0 : V.sessionId) ?? "noSessionId", f = null, g = e * 1e3;
2541
- return localStorage.setItem(
2542
- l,
2543
- JSON.stringify({
2544
- tolken: C,
2545
- expire: (/* @__PURE__ */ new Date()).getTime() + g
2546
- })
2547
- ), { tolken: C, ip: f, userAgent: a, platform: r };
2548
- } catch (u) {
2549
- console.error("getHeaders", u);
2517
+ const u = await (await fetch("/api/headers")).json();
2518
+ console.log("getHeaders", u);
2519
+ const p = (u == null ? void 0 : u.sessionId) ?? null, V = (u == null ? void 0 : u.ip) ?? null;
2520
+ return { tolken: p, ip: V, userAgent: t, platform: s };
2521
+ } catch (o) {
2522
+ console.error("getHeaders", o);
2550
2523
  }
2551
- return i;
2524
+ return r;
2552
2525
  }
2553
2526
  static getLayerTitle(e) {
2554
2527
  return {
@@ -2561,11 +2534,11 @@ class H {
2561
2534
  return await H.fetchData("/api/client?query=" + r);
2562
2535
  }
2563
2536
  static getReportUrl(e, t = null) {
2564
- var l, o, p;
2565
- const a = ((l = e == null ? void 0 : e.state) == null ? void 0 : l.slug) ?? null, n = ((o = e == null ? void 0 : e.city) == null ? void 0 : o.slug) ?? null, s = ((p = e == null ? void 0 : e.name) == null ? void 0 : p.slug) ?? null, r = (e == null ? void 0 : e.zip) ?? null;
2537
+ var l, o, u;
2538
+ const a = ((l = e == null ? void 0 : e.state) == null ? void 0 : l.slug) ?? null, n = ((o = e == null ? void 0 : e.city) == null ? void 0 : o.slug) ?? null, s = ((u = e == null ? void 0 : e.name) == null ? void 0 : u.slug) ?? null, r = (e == null ? void 0 : e.zip) ?? null;
2566
2539
  t = t || ((e == null ? void 0 : e.id) ?? null);
2567
- const i = [r, "-piq", t].filter((u) => u).join("");
2568
- return "/" + [a, n, s].filter((u) => u).map((u) => H.toSlug(u)).join("/") + "/" + i;
2540
+ const i = [r, "-piq", t].filter((p) => p).join("");
2541
+ return "/" + [a, n, s].filter((p) => p).map((p) => H.toSlug(p)).join("/") + "/" + i;
2569
2542
  }
2570
2543
  static async getSearchValue(e = "recsSearchValue") {
2571
2544
  try {
@@ -2713,7 +2686,7 @@ class H {
2713
2686
  uuid: t
2714
2687
  }
2715
2688
  });
2716
- return await H.fetchData(
2689
+ return await H.makeSearchFetchCall(
2717
2690
  `/api/client?query=user-get-history&filter=${a}`
2718
2691
  );
2719
2692
  }
@@ -2775,7 +2748,7 @@ class H {
2775
2748
  selfClose: r = !1,
2776
2749
  target: i = null
2777
2750
  }) {
2778
- const l = i ? document.querySelectorAll(i) : [], o = document.getElementById(`${t}-dialog`), p = r ? o == null ? void 0 : o.querySelectorAll("[data-dialog-close]") : document.querySelectorAll("[data-dialog-close]"), u = [
2751
+ const l = i ? document.querySelectorAll(i) : [], o = document.getElementById(`${t}-dialog`), u = r ? o == null ? void 0 : o.querySelectorAll("[data-dialog-close]") : document.querySelectorAll("[data-dialog-close]"), p = [
2779
2752
  "closing",
2780
2753
  "closed",
2781
2754
  "opening",
@@ -2793,13 +2766,13 @@ class H {
2793
2766
  if (w.attributeName === "open") {
2794
2767
  const b = w.target;
2795
2768
  if (!(b == null ? void 0 : b.hasAttribute("open"))) return;
2796
- b == null || b.removeAttribute("inert"), b == null || b.dispatchEvent(u.opening), b && await y(b), b == null || b.dispatchEvent(u.opened);
2769
+ b == null || b.removeAttribute("inert"), b == null || b.dispatchEvent(p.opening), b && await x(b), b == null || b.dispatchEvent(p.opened);
2797
2770
  }
2798
2771
  });
2799
2772
  }), C = new MutationObserver((h, v) => {
2800
2773
  h.forEach((w) => {
2801
2774
  w.removedNodes.forEach((b) => {
2802
- b.nodeName === "DIALOG" && (b.removeEventListener("click", g), b.removeEventListener("close", f), b.dispatchEvent(u.removed), C == null || C.disconnect(), V == null || V.disconnect());
2775
+ b.nodeName === "DIALOG" && (b.removeEventListener("click", g), b.removeEventListener("close", f), b.dispatchEvent(p.removed), C == null || C.disconnect(), V == null || V.disconnect());
2803
2776
  });
2804
2777
  });
2805
2778
  });
@@ -2811,10 +2784,10 @@ class H {
2811
2784
  childList: !0
2812
2785
  }));
2813
2786
  const f = async ({ target: h }) => {
2814
- h == null || h.classList.add("closing"), h == null || h.setAttribute("inert", ""), h == null || h.dispatchEvent(u.closing), h && await y(h), h == null || h.classList.remove("closing"), h == null || h.dispatchEvent(u.closed);
2787
+ h == null || h.classList.add("closing"), h == null || h.setAttribute("inert", ""), h == null || h.dispatchEvent(p.closing), h && await x(h), h == null || h.classList.remove("closing"), h == null || h.dispatchEvent(p.closed);
2815
2788
  }, g = async ({ target: h }) => {
2816
- (h == null ? void 0 : h.nodeName) === "DIALOG" && (h == null || h.dispatchEvent(u.outside), o == null || o.close("outside"));
2817
- }, y = (h) => Promise.allSettled(
2789
+ (h == null ? void 0 : h.nodeName) === "DIALOG" && (h == null || h.dispatchEvent(p.outside), o == null || o.close("outside"));
2790
+ }, x = (h) => Promise.allSettled(
2818
2791
  h == null ? void 0 : h.getAnimations().map((v) => v == null ? void 0 : v.finished)
2819
2792
  );
2820
2793
  return !e && (o == null || o.addEventListener("click", g)), o == null || o.addEventListener("close", async (h) => {
@@ -2829,7 +2802,7 @@ class H {
2829
2802
  h.addEventListener("click", (v) => {
2830
2803
  o == null || o.showModal(), s && s(v, o);
2831
2804
  });
2832
- }), p == null || p.forEach((h) => {
2805
+ }), u == null || u.forEach((h) => {
2833
2806
  h.addEventListener("click", async (v) => {
2834
2807
  o == null || o.close("close");
2835
2808
  });
@@ -2953,6 +2926,17 @@ class H {
2953
2926
  const e = "/slider/swiper-bundle.min.js";
2954
2927
  await H.injectLink({ href: "/slider/swiper-bundle.min.css", id: "swiperCss" }), await H.injectScript({ src: e, id: "swiperJs", async: !1 });
2955
2928
  }
2929
+ static async makeSearchFetchCall(e) {
2930
+ try {
2931
+ return (await fetch(e, {
2932
+ method: "GET",
2933
+ headers: { "Content-Type": "application/json" }
2934
+ })).json();
2935
+ } catch (t) {
2936
+ console.error("performSearch", t, { url: e });
2937
+ }
2938
+ return [];
2939
+ }
2956
2940
  static money(e, t = "", a = 0) {
2957
2941
  return e === null ? t : Intl ? new Intl.NumberFormat("en-US", {
2958
2942
  style: "currency",
@@ -2977,13 +2961,13 @@ class H {
2977
2961
  max: i = null,
2978
2962
  city: l = null,
2979
2963
  state: o = null,
2980
- vin: p = null,
2981
- license: u = null,
2964
+ vin: u = null,
2965
+ license: p = null,
2982
2966
  token: V = null,
2983
2967
  phone: C = null
2984
- } = e || {}, f = t && t !== "", g = r && r !== "" && r !== "18", y = i && i !== "" && r !== "99";
2968
+ } = e || {}, f = t && t !== "", g = r && r !== "" && r !== "18", x = i && i !== "" && r !== "99";
2985
2969
  let h = [];
2986
- return t && t !== "" && h.push("name=" + t), f || (a && a !== "" && h.push("first=" + a), n && n !== "" && h.push("middle=" + n), s && s !== "" && h.push("last=" + s)), g && y ? parseInt(r) > parseInt(i) ? (h.push("min=" + i), h.push("max=" + r)) : (h.push("min=" + r), h.push("max=" + i)) : (g && h.push("min=" + r), y && h.push("max=" + i)), C && C !== "" && h.push("phone=" + C), l && l !== "" && h.push("city=" + l), u && u !== "" && h.push("license=" + u), p && p !== "" && h.push("vin=" + p), o && o !== "" && h.push("state=" + o), V && V !== "" && h.push("token=" + V), h.join("&");
2970
+ return t && t !== "" && h.push("name=" + t), f || (a && a !== "" && h.push("first=" + a), n && n !== "" && h.push("middle=" + n), s && s !== "" && h.push("last=" + s)), g && x ? parseInt(r) > parseInt(i) ? (h.push("min=" + i), h.push("max=" + r)) : (h.push("min=" + r), h.push("max=" + i)) : (g && h.push("min=" + r), x && h.push("max=" + i)), C && C !== "" && h.push("phone=" + C), l && l !== "" && h.push("city=" + l), p && p !== "" && h.push("license=" + p), u && u !== "" && h.push("vin=" + u), o && o !== "" && h.push("state=" + o), V && V !== "" && h.push("token=" + V), h.join("&");
2987
2971
  }
2988
2972
  static padTo2Digits(e) {
2989
2973
  return e.toString().padStart(2, "0");
@@ -3001,8 +2985,8 @@ class H {
3001
2985
  useLocation: i = !0,
3002
2986
  state: l = "",
3003
2987
  useGoogle: o = !1,
3004
- useGoogleOverride: p = !1,
3005
- useAmazonOverride: u = !1,
2988
+ useGoogleOverride: u = !1,
2989
+ useAmazonOverride: p = !1,
3006
2990
  isSandboxAccount: V = !1,
3007
2991
  isOptOutSearch: C = !1
3008
2992
  } = t ?? {}, { tolken: f = null, ip: g = null } = await H.getHeaders(), h = [
@@ -3013,14 +2997,14 @@ class H {
3013
2997
  "useCityStateSearch=" + s,
3014
2998
  "useLocation=" + i,
3015
2999
  "useGoogle=" + o,
3016
- "useGoogleOverride=" + p,
3017
- "useAmazonOverride=" + u,
3000
+ "useGoogleOverride=" + u,
3001
+ "useAmazonOverride=" + p,
3018
3002
  "isSandboxAccount=" + V,
3019
3003
  "isOptOutSearch=" + C
3020
3004
  ];
3021
3005
  l && l !== "" && !s && h.push("state=" + l), f && f !== "" && h.push("tolken=" + f), g && g !== "" && h.push("ip=" + g);
3022
3006
  const v = h.join("&"), b = (n || s ? "/api/autocomplete-city" : "/api/autocomplete") + "?" + v;
3023
- return await H.fetchData(b);
3007
+ return await H.makeSearchFetchCall(b);
3024
3008
  }
3025
3009
  static removeElements(e) {
3026
3010
  document.querySelectorAll(e).forEach((t) => t == null ? void 0 : t.remove());
@@ -3081,9 +3065,9 @@ class H {
3081
3065
  static async setRandomFileNameVersion(e, t = "scripts") {
3082
3066
  const a = Date.now(), n = typeof window < "u" ? window.location.origin : "", s = t ? `/${t}/` : "/";
3083
3067
  try {
3084
- const r = e.map(({ fileName: o, initFunctionName: p }) => import(`${n}${s}${o}?v=${a}`)), i = await Promise.all(r), l = [];
3085
- i.forEach((o, p) => {
3086
- o && typeof o[e[p].initFunctionName] == "function" ? l.push(o[e[p].initFunctionName]()) : console.error(`error loading ${e[p].initFunctionName}()`);
3068
+ const r = e.map(({ fileName: o, initFunctionName: u }) => import(`${n}${s}${o}?v=${a}`)), i = await Promise.all(r), l = [];
3069
+ i.forEach((o, u) => {
3070
+ o && typeof o[e[u].initFunctionName] == "function" ? l.push(o[e[u].initFunctionName]()) : console.error(`error loading ${e[u].initFunctionName}()`);
3087
3071
  }), l.length > 0 && await Promise.all(l);
3088
3072
  } catch (r) {
3089
3073
  console.error("Failed to load one or more search modules:", r);
@@ -3188,7 +3172,7 @@ export {
3188
3172
  $1 as Dots,
3189
3173
  e2 as FlexItem,
3190
3174
  n2 as FunnelHeader,
3191
- x as Icon,
3175
+ y as Icon,
3192
3176
  q1 as LoadingBar,
3193
3177
  P1 as Popover,
3194
3178
  j1 as ProcessingSpinner,