@hotelinking/ui 14.47.11 → 14.47.13

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/ui.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as M, createBlock as k, createElementBlock as n, openBlock as l, resolveDynamicComponent as Re, normalizeClass as y, computed as Y, createCommentVNode as b, renderSlot as E, createElementVNode as e, ref as I, watch as H, unref as c, withCtx as f, createVNode as m, toDisplayString as g, createTextVNode as z, Transition as re, Fragment as $, renderList as S, withDirectives as B, vModelDynamic as ct, vShow as D, withModifiers as ye, vModelText as se, createStaticVNode as te, resolveComponent as Fe, vModelCheckbox as Ee, reactive as ae, isRef as xe, TransitionGroup as gt, onMounted as mt, shallowRef as pt, mergeProps as ve } from "vue";
1
+ import { defineComponent as M, createBlock as k, createElementBlock as n, openBlock as l, resolveDynamicComponent as Re, normalizeClass as y, computed as Y, createCommentVNode as b, renderSlot as E, createElementVNode as e, ref as N, watch as H, unref as c, withCtx as f, createVNode as m, toDisplayString as g, createTextVNode as z, Transition as re, Fragment as $, renderList as S, withDirectives as B, vModelDynamic as ct, vShow as D, withModifiers as ye, vModelText as se, createStaticVNode as te, resolveComponent as Fe, vModelCheckbox as Ee, reactive as ae, isRef as xe, TransitionGroup as gt, onMounted as mt, shallowRef as pt, mergeProps as ve } from "vue";
2
2
  import { Menu as _e, MenuButton as $e, MenuItems as Ce, MenuItem as Se, Combobox as Ue, ComboboxLabel as He, ComboboxInput as Ze, ComboboxButton as Je, ComboboxOptions as We, ComboboxOption as Ge, SwitchGroup as ft, Switch as ht, SwitchLabel as yt, TransitionRoot as Be, Dialog as Me, TransitionChild as X, DialogPanel as je, DialogTitle as Qe, Disclosure as De, DisclosureButton as Q, DisclosurePanel as Te, Listbox as vt, ListboxLabel as bt, ListboxButton as wt, ListboxOptions as kt, ListboxOption as xt, Popover as _t, PopoverButton as $t, PopoverPanel as Ct } from "@headlessui/vue";
3
3
  import V from "dayjs";
4
4
  import ze from "vue3-apexcharts";
@@ -113,7 +113,7 @@ const O = /* @__PURE__ */ M({
113
113
  },
114
114
  emits: ["checkboxChanged"],
115
115
  setup(p, { emit: u }) {
116
- const r = u, i = p, s = I(i.check), o = () => {
116
+ const r = u, i = p, s = N(i.check), o = () => {
117
117
  i.disabled || (s.value = !s.value, r("checkboxChanged", { checked: s.value, value: i.value }));
118
118
  };
119
119
  return H(() => i.check, (t) => {
@@ -741,7 +741,7 @@ const Jt = {
741
741
  },
742
742
  emits: ["inputChanged", "rightAddOnClicked", "addOnClicked"],
743
743
  setup(p, { emit: u }) {
744
- const r = u, i = p, s = I(i.value);
744
+ const r = u, i = p, s = N(i.value);
745
745
  H(() => i.value, (t) => {
746
746
  s.value = t, s.value && r("inputChanged", { name: i.name, value: s.value });
747
747
  });
@@ -866,7 +866,7 @@ const Jt = {
866
866
  },
867
867
  emits: ["filesUploaded"],
868
868
  setup(p, { emit: u }) {
869
- let r = I("");
869
+ let r = N("");
870
870
  const i = u, s = p, o = (d) => {
871
871
  a(d.dataTransfer.files), i("filesUploaded", { id: s.id, files: d.dataTransfer.files });
872
872
  }, t = (d) => {
@@ -970,7 +970,7 @@ const Jt = {
970
970
  },
971
971
  emits: ["selectChanged"],
972
972
  setup(p, { expose: u, emit: r }) {
973
- const i = I(""), s = r, o = p, t = Y(() => i.value === "" ? o.items : o.items.filter((v) => v.name.toLowerCase().includes(i.value.toLowerCase()))), a = (v) => v?.name ?? "", d = (v) => {
973
+ const i = N(""), s = r, o = p, t = Y(() => i.value === "" ? o.items : o.items.filter((v) => v.name.toLowerCase().includes(i.value.toLowerCase()))), a = (v) => v?.name ?? "", d = (v) => {
974
974
  s("selectChanged", v);
975
975
  }, h = Y({
976
976
  get: () => o.select,
@@ -1045,7 +1045,7 @@ const Jt = {
1045
1045
  value: w,
1046
1046
  as: "template"
1047
1047
  }, {
1048
- default: f(({ active: T, selected: x }) => [
1048
+ default: f(({ active: T, selected: _ }) => [
1049
1049
  e("li", {
1050
1050
  class: y([
1051
1051
  "relative cursor-default select-none py-2 pl-3 pr-9",
@@ -1053,9 +1053,9 @@ const Jt = {
1053
1053
  ])
1054
1054
  }, [
1055
1055
  e("span", {
1056
- class: y(["block truncate", x && "font-semibold"])
1056
+ class: y(["block truncate", _ && "font-semibold"])
1057
1057
  }, g(w.name), 3),
1058
- x ? (l(), n("span", {
1058
+ _ ? (l(), n("span", {
1059
1059
  key: 0,
1060
1060
  class: y([
1061
1061
  "absolute inset-y-0 right-0 flex items-center pr-4",
@@ -1140,7 +1140,7 @@ const Bl = { class: "flex justify-between" }, Ml = {
1140
1140
  },
1141
1141
  emits: ["selectChanged"],
1142
1142
  setup(p, { emit: u }) {
1143
- const r = p, i = u, s = I(""), o = I(r.select), t = Y(
1143
+ const r = p, i = u, s = N(""), o = N(r.select), t = Y(
1144
1144
  () => s.value === "" ? r.items : r.items.filter((d) => d.name.toLowerCase().includes(s.value.toLowerCase()))
1145
1145
  ), a = (d) => {
1146
1146
  s.value = "", i("selectChanged", d);
@@ -1185,7 +1185,7 @@ const Bl = { class: "flex justify-between" }, Ml = {
1185
1185
  }, "w-full rounded-md border py-2 pl-3 pr-10 shadow-sm focus:border-lime-400 focus:outline-none focus:ring-1 focus:ring-lime-400 sm:text-sm"]),
1186
1186
  onChange: h[0] || (h[0] = (v) => s.value = v.target.value),
1187
1187
  onBlur: h[1] || (h[1] = (v) => s.value = ""),
1188
- "display-value": (v) => v.name
1188
+ "display-value": (v) => v.label || v.name
1189
1189
  }, null, 8, ["class", "display-value"]),
1190
1190
  m(c(Je), { class: "h-full absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none" }, {
1191
1191
  default: f(() => [
@@ -1212,7 +1212,7 @@ const Bl = { class: "flex justify-between" }, Ml = {
1212
1212
  }, [
1213
1213
  e("span", {
1214
1214
  class: y(["block truncate", w && "font-semibold"])
1215
- }, g(v.name), 3),
1215
+ }, g(v.label || v.name), 3),
1216
1216
  w ? (l(), n("span", {
1217
1217
  key: 0,
1218
1218
  class: y(["absolute inset-y-0 right-0 flex items-center pr-4", j ? "text-black" : "text-lime-400"])
@@ -1314,7 +1314,7 @@ const Bl = { class: "flex justify-between" }, Ml = {
1314
1314
  setup(p, { emit: u }) {
1315
1315
  const r = u, i = p, s = (t) => {
1316
1316
  r("inputChanged", t.target.value);
1317
- }, o = I(i.value);
1317
+ }, o = N(i.value);
1318
1318
  return H(() => i.value, (t) => {
1319
1319
  o.value = t, r("inputChanged", { name: i.name, value: o.value });
1320
1320
  }), (t, a) => t.loading ? (l(), n("div", Ol, a[1] || (a[1] = [
@@ -1386,7 +1386,7 @@ const Bl = { class: "flex justify-between" }, Ml = {
1386
1386
  },
1387
1387
  emits: ["toggleChanged", "actionClicked"],
1388
1388
  setup(p, { emit: u }) {
1389
- const r = p, i = I(r.checked);
1389
+ const r = p, i = N(r.checked);
1390
1390
  return H(() => r.checked, (s) => i.value = s), (s, o) => s.loading ? (l(), n("div", Pl, o[3] || (o[3] = [
1391
1391
  e("div", { class: "relative bg-gray-200 rounded-full w-12 h-6 p-1 flex items-center" }, [
1392
1392
  e("div", { class: "rounded-full bg-gray-300 dark:bg-gray-400 h-4 w-4" })
@@ -1651,7 +1651,7 @@ const Bl = { class: "flex justify-between" }, Ml = {
1651
1651
  o.value.forEach((a) => {
1652
1652
  a.active = a.value === t.value;
1653
1653
  }), r("filterSelected", t);
1654
- }, o = I(i.items);
1654
+ }, o = N(i.items);
1655
1655
  return (t, a) => (l(), k(he, {
1656
1656
  class: "text-nowrap",
1657
1657
  loading: t.loading,
@@ -2353,7 +2353,7 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2353
2353
  },
2354
2354
  emits: ["dateChanged", "changeCategoryBulkPrices", "changeCategorySelectionPrice", "changeCategoryUpgradePrice", "changeRoomPrice", "tableAction"],
2355
2355
  setup(p, { emit: u }) {
2356
- const r = p, i = u, s = I(/* @__PURE__ */ new Date()), o = I(r.today), t = I([]);
2356
+ const r = p, i = u, s = N(/* @__PURE__ */ new Date()), o = N(r.today), t = N([]);
2357
2357
  H(() => r.today, (C) => {
2358
2358
  o.value = C;
2359
2359
  });
@@ -2365,11 +2365,11 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2365
2365
  }), d = Y(() => t.value.length > 0 && t.value.length < r.rooms.length), h = (C) => {
2366
2366
  V(C).isBefore(s.value) || (o.value = C, i("dateChanged", o.value));
2367
2367
  }, v = (C) => {
2368
- let q = r.category.selectionPrices.find((N) => V(N.date).isSame(C.date));
2368
+ let q = r.category.selectionPrices.find((P) => V(P.date).isSame(C.date));
2369
2369
  return q ? q.price : C.price;
2370
2370
  }, j = (C) => {
2371
2371
  t.value = C.target.checked ? r.rooms.map((q) => q.id) : [];
2372
- }, w = () => i("changeCategoryBulkPrices"), T = (C) => i("changeCategorySelectionPrice", C), x = (C) => i("changeCategoryUpgradePrice", C), A = (C) => i("tableAction", C), F = (C, q, N) => i("changeRoomPrice", { price: C, roomId: q, roomName: N });
2372
+ }, w = () => i("changeCategoryBulkPrices"), T = (C) => i("changeCategorySelectionPrice", C), _ = (C) => i("changeCategoryUpgradePrice", C), A = (C) => i("tableAction", C), F = (C, q, P) => i("changeRoomPrice", { price: C, roomId: q, roomName: P });
2373
2373
  return (C, q) => C.loading ? (l(), k(nt, { key: 1 })) : (l(), n("div", Co, [
2374
2374
  e("div", So, [
2375
2375
  e("div", Bo, [
@@ -2380,17 +2380,17 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2380
2380
  e("th", To, [
2381
2381
  m(to, {
2382
2382
  selectedDate: o.value,
2383
- onDateSelected: q[0] || (q[0] = (N) => h(N))
2383
+ onDateSelected: q[0] || (q[0] = (P) => h(P))
2384
2384
  }, null, 8, ["selectedDate"])
2385
2385
  ]),
2386
- (l(!0), n($, null, S(a.value, (N, _) => (l(), n("th", {
2386
+ (l(!0), n($, null, S(a.value, (P, x) => (l(), n("th", {
2387
2387
  scope: "col",
2388
- key: _,
2388
+ key: x,
2389
2389
  class: "text-sm font-semibold p-0"
2390
2390
  }, [
2391
2391
  m(ko, {
2392
2392
  class: "border-l border-gray-200 px-6 py-3",
2393
- day: N
2393
+ day: P
2394
2394
  }, null, 8, ["day"])
2395
2395
  ]))), 128))
2396
2396
  ]),
@@ -2412,14 +2412,14 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2412
2412
  ]),
2413
2413
  C.type === "discounts" ? (l(), n("tr", Lo, [
2414
2414
  e("td", Fo, g(C.literals.pricesDiscount), 1),
2415
- (l(!0), n($, null, S(C.category.selectionPrices, (N, _) => (l(), n("td", {
2416
- key: _,
2415
+ (l(!0), n($, null, S(C.category.selectionPrices, (P, x) => (l(), n("td", {
2416
+ key: x,
2417
2417
  class: "p-0"
2418
2418
  }, [
2419
2419
  m(ie, {
2420
- onClick: (P) => T(N),
2420
+ onClick: (I) => T(P),
2421
2421
  class: "border-l border-gray-200 px-6 py-3 text-black hover:text-lime-400 font-bold cursor-pointer",
2422
- price: N,
2422
+ price: P,
2423
2423
  currency: C.currency.symbol,
2424
2424
  isBasePrice: !0
2425
2425
  }, null, 8, ["onClick", "price", "currency"])
@@ -2427,14 +2427,14 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2427
2427
  ])) : b("", !0),
2428
2428
  C.type === "prices" ? (l(), n("tr", Oo, [
2429
2429
  e("td", Ao, g(C.literals.pricesSelection), 1),
2430
- (l(!0), n($, null, S(C.category.selectionPrices, (N, _) => (l(), n("td", {
2431
- key: _,
2430
+ (l(!0), n($, null, S(C.category.selectionPrices, (P, x) => (l(), n("td", {
2431
+ key: x,
2432
2432
  class: "p-0"
2433
2433
  }, [
2434
2434
  m(ie, {
2435
- onClick: (P) => T(N),
2435
+ onClick: (I) => T(P),
2436
2436
  class: "border-l border-gray-200 px-6 py-3 text-black hover:text-lime-400 font-bold cursor-pointer",
2437
- price: N,
2437
+ price: P,
2438
2438
  currency: C.currency.symbol,
2439
2439
  isBasePrice: !0
2440
2440
  }, null, 8, ["onClick", "price", "currency"])
@@ -2442,14 +2442,14 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2442
2442
  ])) : b("", !0),
2443
2443
  C.type === "prices" ? (l(), n("tr", Io, [
2444
2444
  e("td", No, g(C.literals.pricesUpgrade), 1),
2445
- (l(!0), n($, null, S(C.category.upgradePrices, (N, _) => (l(), n("td", {
2446
- key: _,
2445
+ (l(!0), n($, null, S(C.category.upgradePrices, (P, x) => (l(), n("td", {
2446
+ key: x,
2447
2447
  class: "p-0"
2448
2448
  }, [
2449
2449
  m(ie, {
2450
- onClick: (P) => x(N),
2450
+ onClick: (I) => _(P),
2451
2451
  class: "border-l border-gray-200 px-6 py-3 text-black hover:text-lime-400 font-bold cursor-pointer bg-gray-100",
2452
- price: N,
2452
+ price: P,
2453
2453
  currency: C.currency.symbol,
2454
2454
  isBasePrice: !0
2455
2455
  }, null, 8, ["onClick", "price", "currency"])
@@ -2458,12 +2458,12 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2458
2458
  e("tr", null, [
2459
2459
  e("th", Po, [
2460
2460
  t.value?.length > 0 && C.actions?.length > 0 ? (l(), n("div", Vo, [
2461
- (l(!0), n($, null, S(C.actions, (N, _) => (l(), n("button", {
2462
- onClick: (P) => A({ action: N.id, items: t.value }),
2463
- key: _,
2461
+ (l(!0), n($, null, S(C.actions, (P, x) => (l(), n("button", {
2462
+ onClick: (I) => A({ action: P.id, items: t.value }),
2463
+ key: x,
2464
2464
  type: "button",
2465
2465
  class: "inline-flex items-center rounded bg-lime-400 hover:bg-black hover:text-white px-2.5 py-1.5 text-xs font-medium shadow-sm disabled:cursor-not-allowed disabled:opacity-30"
2466
- }, g(N.name), 9, Yo))), 128))
2466
+ }, g(P.name), 9, Yo))), 128))
2467
2467
  ])) : b("", !0),
2468
2468
  e("span", null, g(C.literals.pricesSelection), 1)
2469
2469
  ])
@@ -2487,8 +2487,8 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2487
2487
  class: "bg-gray-100 py-2 pl-4 pr-3 text-left font-semibold"
2488
2488
  }, null, -1))
2489
2489
  ]),
2490
- (l(!0), n($, null, S(C.rooms, (N) => (l(), n("tr", {
2491
- key: N.name,
2490
+ (l(!0), n($, null, S(C.rooms, (P) => (l(), n("tr", {
2491
+ key: P.name,
2492
2492
  class: y([{ "even:bg-gray-100": C.type === "prices", "odd:bg-gray-100": C.type === "discounts" }])
2493
2493
  }, [
2494
2494
  e("td", Zo, [
@@ -2496,25 +2496,25 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2496
2496
  B(e("input", {
2497
2497
  type: "checkbox",
2498
2498
  class: "absolute left-4 top-1/2 -mt-2 h-4 w-4 rounded border-gray-300 text-lime-400 focus:ring-lime-400",
2499
- value: N.name,
2500
- "onUpdate:modelValue": q[1] || (q[1] = (_) => t.value = _)
2499
+ value: P.name,
2500
+ "onUpdate:modelValue": q[1] || (q[1] = (x) => t.value = x)
2501
2501
  }, null, 8, Wo), [
2502
2502
  [Ee, t.value]
2503
2503
  ]),
2504
- e("span", Go, g(N.name), 1)
2504
+ e("span", Go, g(P.name), 1)
2505
2505
  ]),
2506
- e("td", Qo, g(N.building), 1),
2507
- e("td", Ko, g(N.floor), 1),
2508
- (l(!0), n($, null, S(N.selectionPrices, (_, P) => (l(), n("td", {
2506
+ e("td", Qo, g(P.building), 1),
2507
+ e("td", Ko, g(P.floor), 1),
2508
+ (l(!0), n($, null, S(P.selectionPrices, (x, I) => (l(), n("td", {
2509
2509
  class: "p-0",
2510
- key: P
2510
+ key: I
2511
2511
  }, [
2512
2512
  m(ie, {
2513
- onClick: (L) => F(_, N.id, N.name),
2513
+ onClick: (L) => F(x, P.id, P.name),
2514
2514
  class: "border-l border-gray-200 px-6 py-3 text-black hover:text-lime-400 cursor-pointer",
2515
- price: _,
2515
+ price: x,
2516
2516
  currency: C.currency.symbol,
2517
- basePrice: v(_)
2517
+ basePrice: v(x)
2518
2518
  }, null, 8, ["onClick", "price", "currency", "basePrice"])
2519
2519
  ]))), 128))
2520
2520
  ], 2))), 128))
@@ -2550,10 +2550,10 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2550
2550
  },
2551
2551
  emits: ["selectedRange", "chartUpdated", "dataPointSelection", "maximizeChart"],
2552
2552
  setup(p, { emit: u }) {
2553
- const r = u, i = I((/* @__PURE__ */ new Date()).toISOString().slice(0, (/* @__PURE__ */ new Date()).toISOString().lastIndexOf(":"))), s = p;
2553
+ const r = u, i = N((/* @__PURE__ */ new Date()).toISOString().slice(0, (/* @__PURE__ */ new Date()).toISOString().lastIndexOf(":"))), s = p;
2554
2554
  let o = ae(s.dates || { from: "", to: i });
2555
- H(() => s.dates, (x) => {
2556
- x && (o = x);
2555
+ H(() => s.dates, (_) => {
2556
+ _ && (o = _);
2557
2557
  });
2558
2558
  let a = {
2559
2559
  chart: {
@@ -2566,7 +2566,7 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2566
2566
  },
2567
2567
  colors: function() {
2568
2568
  return s.isNps ? [
2569
- function({ value: x, seriesIndex: A, dataPointIndex: F, w: C }) {
2569
+ function({ value: _, seriesIndex: A, dataPointIndex: F, w: C }) {
2570
2570
  if (F <= 5) return "#F87171";
2571
2571
  if (F > 5 && F <= 7) return "#eab308";
2572
2572
  if (F >= 8) return "#84cc16";
@@ -2613,16 +2613,16 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2613
2613
  }), s.type === "area" && (a.tooltip = { intersect: !1, shared: !0 });
2614
2614
  const d = () => (a.chart.stacked = s.stacked, s.options && (s.options.xaxis.hideOverlappingLabels = !0, s.options.xaxis.decimalsInFloat = 2, s.options.xaxis.tickAmount = 10), { ...a, ...s.options, plotOptions: { bar: { horizontal: s.horizontal } } }), h = () => {
2615
2615
  o.from !== "" && o.to !== "" && V(o.from).isBefore(V(o.to)) && r("selectedRange", { range: o, chartId: s.id });
2616
- }, v = Y(() => s.series), j = Y(() => d()), w = () => r("chartUpdated"), T = (x, A, F) => {
2617
- r("dataPointSelection", { id: s.id, chartContext: A, config: F, event: x });
2616
+ }, v = Y(() => s.series), j = Y(() => d()), w = () => r("chartUpdated"), T = (_, A, F) => {
2617
+ r("dataPointSelection", { id: s.id, chartContext: A, config: F, event: _ });
2618
2618
  };
2619
- return (x, A) => (l(), n($, null, [
2619
+ return (_, A) => (l(), n($, null, [
2620
2620
  B(e("div", {
2621
- class: y(["h-[" + x.height + "px]", "card chart apex-chart p-4 bg-white shadow rounded-lg overflow-hidden flex grow"])
2621
+ class: y(["h-[" + _.height + "px]", "card chart apex-chart p-4 bg-white shadow rounded-lg overflow-hidden flex grow"])
2622
2622
  }, [
2623
2623
  e("div", er, [
2624
- e("div", tr, g(x.title), 1),
2625
- x.isNps && x.npsLiterals ? (l(), n("div", lr, [
2624
+ e("div", tr, g(_.title), 1),
2625
+ _.isNps && _.npsLiterals ? (l(), n("div", lr, [
2626
2626
  m(Z, {
2627
2627
  size: "small",
2628
2628
  color: "red",
@@ -2634,7 +2634,7 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2634
2634
  loading: !1,
2635
2635
  color: "red"
2636
2636
  }, null, 8, ["icon"]),
2637
- e("span", sr, g(x.npsLiterals.unhappy), 1)
2637
+ e("span", sr, g(_.npsLiterals.unhappy), 1)
2638
2638
  ]),
2639
2639
  _: 1
2640
2640
  }),
@@ -2649,7 +2649,7 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2649
2649
  loading: !1,
2650
2650
  color: "yellow"
2651
2651
  }, null, 8, ["icon"]),
2652
- e("span", or, g(x.npsLiterals.neutral), 1)
2652
+ e("span", or, g(_.npsLiterals.neutral), 1)
2653
2653
  ]),
2654
2654
  _: 1
2655
2655
  }),
@@ -2664,7 +2664,7 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2664
2664
  loading: !1,
2665
2665
  color: "green"
2666
2666
  }, null, 8, ["icon"]),
2667
- e("span", rr, g(x.npsLiterals.happy), 1)
2667
+ e("span", rr, g(_.npsLiterals.happy), 1)
2668
2668
  ]),
2669
2669
  _: 1
2670
2670
  })
@@ -2699,28 +2699,28 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2699
2699
  m(O, {
2700
2700
  class: "ml-4 cursor-pointer",
2701
2701
  size: "big",
2702
- loading: x.loading,
2702
+ loading: _.loading,
2703
2703
  icon: c(Xe),
2704
- onClick: A[2] || (A[2] = (F) => x.$emit("maximizeChart", x.id))
2704
+ onClick: A[2] || (A[2] = (F) => _.$emit("maximizeChart", _.id))
2705
2705
  }, null, 8, ["loading", "icon"])
2706
2706
  ])
2707
2707
  ]),
2708
2708
  B(e("div", cr, [
2709
2709
  m(c(ze), {
2710
2710
  class: "chart",
2711
- type: x.type,
2711
+ type: _.type,
2712
2712
  series: v.value,
2713
- height: x.height,
2713
+ height: _.height,
2714
2714
  options: j.value,
2715
2715
  onUpdated: w,
2716
2716
  onMounted: w,
2717
2717
  onDataPointSelection: T
2718
2718
  }, null, 8, ["type", "series", "height", "options"])
2719
2719
  ], 512), [
2720
- [D, !x.empty]
2720
+ [D, !_.empty]
2721
2721
  ]),
2722
2722
  B(e("div", {
2723
- class: y(["h-[" + x.height + "px]", "w-full flex items-center justify-center flex-col"])
2723
+ class: y(["h-[" + _.height + "px]", "w-full flex items-center justify-center flex-col"])
2724
2724
  }, [
2725
2725
  m(O, {
2726
2726
  icon: c(W),
@@ -2730,13 +2730,13 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2730
2730
  }, null, 8, ["icon"]),
2731
2731
  A[3] || (A[3] = e("p", { class: "text-xs uppercase text-gray-300 font-bold" }, "No data for this time frame", -1))
2732
2732
  ], 2), [
2733
- [D, x.empty]
2733
+ [D, _.empty]
2734
2734
  ])
2735
2735
  ], 2), [
2736
- [D, !x.loading]
2736
+ [D, !_.loading]
2737
2737
  ]),
2738
2738
  B(e("div", {
2739
- class: y(["h-[" + x.height + "px]", "card chart apex-chart px-4 py-5 bg-white shadow rounded-lg overflow-hidden sm:p-6 flex grow h-80"])
2739
+ class: y(["h-[" + _.height + "px]", "card chart apex-chart px-4 py-5 bg-white shadow rounded-lg overflow-hidden sm:p-6 flex grow h-80"])
2740
2740
  }, A[4] || (A[4] = [
2741
2741
  e("div", {
2742
2742
  role: "status",
@@ -2764,7 +2764,7 @@ const ie = /* @__PURE__ */ le(xo, [["render", $o]]), Co = {
2764
2764
  ])
2765
2765
  ], -1)
2766
2766
  ]), 2), [
2767
- [D, x.loading]
2767
+ [D, _.loading]
2768
2768
  ])
2769
2769
  ], 64));
2770
2770
  }
@@ -2833,7 +2833,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
2833
2833
  },
2834
2834
  emits: ["changePage"],
2835
2835
  setup(p, { emit: u }) {
2836
- const r = u, i = p, s = I(3), o = Y(
2836
+ const r = u, i = p, s = N(3), o = Y(
2837
2837
  () => Math.max(1, Number(i.current) - Number(s.value))
2838
2838
  ), t = Y(
2839
2839
  () => Math.min(Number(i.current) + Number(s.value), Number(i.total))
@@ -3428,7 +3428,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
3428
3428
  },
3429
3429
  emits: ["tableAction", "orderBy", "customEmit", "selectedItemsDeleted"],
3430
3430
  setup(p, { emit: u }) {
3431
- let r = I([]), i = I(""), s = I(!1);
3431
+ let r = N([]), i = N(""), s = N(!1);
3432
3432
  const o = u, t = p, a = Y(
3433
3433
  () => r.value.length > 0 && r.value.length < t.items.length
3434
3434
  ), d = (w, T) => {
@@ -3446,12 +3446,12 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
3446
3446
  e("div", Ia, [
3447
3447
  e("div", Na, [
3448
3448
  c(r)?.length > 0 && w.actions?.length > 0 ? (l(), n("div", Pa, [
3449
- (l(!0), n($, null, S(w.actions, (x, A) => (l(), n("button", {
3450
- onClick: (F) => w.$emit("tableAction", { action: x.id, items: c(r) }),
3449
+ (l(!0), n($, null, S(w.actions, (_, A) => (l(), n("button", {
3450
+ onClick: (F) => w.$emit("tableAction", { action: _.id, items: c(r) }),
3451
3451
  key: A,
3452
3452
  type: "button",
3453
3453
  class: "inline-flex items-center rounded bg-lime-400 hover:bg-black px-2.5 py-1.5 text-xs font-medium text-white shadow-sm disabled:cursor-not-allowed disabled:opacity-30"
3454
- }, g(x.name), 9, Va))), 128))
3454
+ }, g(_.name), 9, Va))), 128))
3455
3455
  ])) : b("", !0),
3456
3456
  e("table", Ya, [
3457
3457
  e("thead", qa, [
@@ -3469,38 +3469,38 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
3469
3469
  onChange: h
3470
3470
  }, null, 40, Ra)) : b("", !0)
3471
3471
  ], 2),
3472
- (l(!0), n($, null, S(w.header, (x, A) => B((l(), n("th", {
3472
+ (l(!0), n($, null, S(w.header, (_, A) => B((l(), n("th", {
3473
3473
  key: A,
3474
3474
  class: "py-3.5 pr-3 text-left font-semibold relative",
3475
3475
  scope: "col",
3476
- onMouseover: (F) => d(x.name, !0),
3477
- onMouseleave: (F) => d(x.name, !1)
3476
+ onMouseover: (F) => d(_.name, !0),
3477
+ onMouseleave: (F) => d(_.name, !1)
3478
3478
  }, [
3479
- x.tooltip ? B((l(), k(La, {
3479
+ _.tooltip ? B((l(), k(La, {
3480
3480
  key: 0,
3481
- tip: x.tooltip
3481
+ tip: _.tooltip
3482
3482
  }, null, 8, ["tip"])), [
3483
- [D, c(i) === x.name]
3483
+ [D, c(i) === _.name]
3484
3484
  ]) : b("", !0),
3485
- x.value ? (l(), n("button", {
3485
+ _.value ? (l(), n("button", {
3486
3486
  key: 1,
3487
3487
  class: "group flex items-center uppercase text-xs relative text-nowrap",
3488
- onClick: (F) => o("orderBy", { value: x.value, orderDirection: w.orderDirection === "asc" ? "desc" : "asc" })
3488
+ onClick: (F) => o("orderBy", { value: _.value, orderDirection: w.orderDirection === "asc" ? "desc" : "asc" })
3489
3489
  }, [
3490
- e("span", null, g(x.name), 1),
3490
+ e("span", null, g(_.name), 1),
3491
3491
  e("span", {
3492
3492
  class: y([[
3493
- x.value === w.orderedBy ? "bg-black text-white group-hover:bg-lime-400 group-hover:text-black" : "group-hover:visible group-focus:visible"
3493
+ _.value === w.orderedBy ? "bg-black text-white group-hover:bg-lime-400 group-hover:text-black" : "group-hover:visible group-focus:visible"
3494
3494
  ], "ml-2 flex-none rounded group-hover:bg-lime-200 group-hover:text-white"])
3495
3495
  }, [
3496
3496
  m(O, {
3497
3497
  icon: w.orderDirection === "asc" ? c(oe) : c(st),
3498
3498
  loading: w.loading,
3499
- color: x.value === w.orderedBy ? "white" : "primary"
3499
+ color: _.value === w.orderedBy ? "white" : "primary"
3500
3500
  }, null, 8, ["icon", "loading", "color"])
3501
3501
  ], 2)
3502
3502
  ], 8, Ua)) : (l(), n("p", Ha, [
3503
- e("span", null, g(x.name), 1)
3503
+ e("span", null, g(_.name), 1)
3504
3504
  ]))
3505
3505
  ], 40, Ea)), [
3506
3506
  [D, j(A)]
@@ -3508,32 +3508,32 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
3508
3508
  ])
3509
3509
  ]),
3510
3510
  e("tbody", Za, [
3511
- (l(!0), n($, null, S(w.items, (x, A) => (l(), n("tr", {
3512
- key: x.id,
3511
+ (l(!0), n($, null, S(w.items, (_, A) => (l(), n("tr", {
3512
+ key: _.id,
3513
3513
  class: y([
3514
- c(r).includes(x.id) && "bg-gray-50",
3514
+ c(r).includes(_.id) && "bg-gray-50",
3515
3515
  A % 2 == 0 ? void 0 : "bg-gray-50"
3516
3516
  ])
3517
3517
  }, [
3518
3518
  e("td", {
3519
3519
  class: y([w.actions?.length > 0 ? "w-2" : "w-0", "relative"])
3520
3520
  }, [
3521
- c(r).includes(x.id) ? (l(), n("div", Ja)) : b("", !0),
3521
+ c(r).includes(_.id) ? (l(), n("div", Ja)) : b("", !0),
3522
3522
  w.actions?.length > 0 ? B((l(), n("input", {
3523
3523
  key: 1,
3524
3524
  "onUpdate:modelValue": T[0] || (T[0] = (F) => xe(r) ? r.value = F : r = F),
3525
- value: x.id,
3525
+ value: _.id,
3526
3526
  class: "absolute left-4 top-1/2 -mt-2 h-4 w-4 rounded border-gray-300 text-black focus:ring-lime-400 flex-wrap",
3527
3527
  type: "checkbox"
3528
3528
  }, null, 8, Wa)), [
3529
3529
  [Ee, c(r)]
3530
3530
  ]) : b("", !0)
3531
3531
  ], 2),
3532
- (l(!0), n($, null, S(x.row, (F, C) => B((l(), n("td", {
3532
+ (l(!0), n($, null, S(_.row, (F, C) => B((l(), n("td", {
3533
3533
  key: C,
3534
3534
  class: y([
3535
3535
  "whitespace-nowrap py-4 pr-3 text-sm",
3536
- c(r).includes(x.id) ? "text-black font-bold" : ""
3536
+ c(r).includes(_.id) ? "text-black font-bold" : ""
3537
3537
  ])
3538
3538
  }, [
3539
3539
  typeof F == "object" && F.type === "tag" ? (l(), k(Z, {
@@ -4232,7 +4232,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
4232
4232
  },
4233
4233
  emits: ["modalAction", "deleteImage", "imgClicked"],
4234
4234
  setup(p, { emit: u }) {
4235
- const r = u, i = I(!1), s = (o) => {
4235
+ const r = u, i = N(!1), s = (o) => {
4236
4236
  i.value = !1, r("modalAction", o);
4237
4237
  };
4238
4238
  return (o, t) => (l(), n("div", _i, [
@@ -4313,7 +4313,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
4313
4313
  emits: ["dragAndDropUpdated"],
4314
4314
  setup(p, { emit: u }) {
4315
4315
  const r = u, i = p;
4316
- let s = I(i.elements);
4316
+ let s = N(i.elements);
4317
4317
  H(() => i.elements, (t) => {
4318
4318
  s.value = t;
4319
4319
  });
@@ -4373,7 +4373,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
4373
4373
  },
4374
4374
  emits: ["selectedRange", "chartUpdated", "dataPointSelection", "maximizeChart"],
4375
4375
  setup(p, { emit: u }) {
4376
- const r = u, i = p, s = I((/* @__PURE__ */ new Date()).toISOString().slice(0, (/* @__PURE__ */ new Date()).toISOString().lastIndexOf(":")));
4376
+ const r = u, i = p, s = N((/* @__PURE__ */ new Date()).toISOString().slice(0, (/* @__PURE__ */ new Date()).toISOString().lastIndexOf(":")));
4377
4377
  let o = ae(i.dates || { from: "", to: s });
4378
4378
  H(() => i.dates, (T) => {
4379
4379
  T && (o = T);
@@ -4410,12 +4410,12 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
4410
4410
  }
4411
4411
  }
4412
4412
  };
4413
- const a = () => ({ ...t, ...i.options }), d = Y(() => i.series), h = Y(() => a()), v = () => r("chartUpdated"), j = (T, x, A) => {
4414
- r("dataPointSelection", { id: i.id, chartContext: x, config: A, event: T });
4413
+ const a = () => ({ ...t, ...i.options }), d = Y(() => i.series), h = Y(() => a()), v = () => r("chartUpdated"), j = (T, _, A) => {
4414
+ r("dataPointSelection", { id: i.id, chartContext: _, config: A, event: T });
4415
4415
  }, w = () => {
4416
4416
  o.from !== "" && o.to !== "" && V(o.from).isBefore(V(o.to)) && r("selectedRange", { range: o, chartId: i.id });
4417
4417
  };
4418
- return (T, x) => (l(), n($, null, [
4418
+ return (T, _) => (l(), n($, null, [
4419
4419
  B(e("div", {
4420
4420
  class: y(["h-[" + T.height + "px]", "card chart apex-chart px-4 py-5 bg-white shadow rounded-lg overflow-hidden sm:p-6 flex grow"])
4421
4421
  }, [
@@ -4425,7 +4425,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
4425
4425
  e("div", Ei, [
4426
4426
  B(e("input", {
4427
4427
  type: "datetime-local",
4428
- "onUpdate:modelValue": x[0] || (x[0] = (A) => c(o).from = A),
4428
+ "onUpdate:modelValue": _[0] || (_[0] = (A) => c(o).from = A),
4429
4429
  max: s.value.toString(),
4430
4430
  onChange: w,
4431
4431
  name: "from",
@@ -4438,7 +4438,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
4438
4438
  e("div", Hi, [
4439
4439
  B(e("input", {
4440
4440
  type: "datetime-local",
4441
- "onUpdate:modelValue": x[1] || (x[1] = (A) => c(o).to = A),
4441
+ "onUpdate:modelValue": _[1] || (_[1] = (A) => c(o).to = A),
4442
4442
  max: s.value.toString(),
4443
4443
  onChange: w,
4444
4444
  name: "to",
@@ -4453,7 +4453,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
4453
4453
  size: "big",
4454
4454
  loading: T.loading,
4455
4455
  icon: c(Xe),
4456
- onClick: x[2] || (x[2] = (A) => T.$emit("maximizeChart", T.id))
4456
+ onClick: _[2] || (_[2] = (A) => T.$emit("maximizeChart", T.id))
4457
4457
  }, null, 8, ["loading", "icon"])
4458
4458
  ])
4459
4459
  ]),
@@ -4478,14 +4478,14 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
4478
4478
  loading: !1,
4479
4479
  size: "huge"
4480
4480
  }, null, 8, ["icon"]),
4481
- x[3] || (x[3] = e("p", { class: "text-xs uppercase text-gray-300 font-bold" }, "No data", -1))
4481
+ _[3] || (_[3] = e("p", { class: "text-xs uppercase text-gray-300 font-bold" }, "No data", -1))
4482
4482
  ], 512), [
4483
4483
  [D, T.empty]
4484
4484
  ])
4485
4485
  ], 2), [
4486
4486
  [D, !T.loading]
4487
4487
  ]),
4488
- B(e("div", Gi, x[4] || (x[4] = [
4488
+ B(e("div", Gi, _[4] || (_[4] = [
4489
4489
  e("div", {
4490
4490
  role: "status",
4491
4491
  class: "w-full animate-pulse h-full flex flex-col"
@@ -4537,7 +4537,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
4537
4537
  },
4538
4538
  emits: ["uiDateRangeButtonClicked"],
4539
4539
  setup(p, { emit: u }) {
4540
- const r = p, i = I((/* @__PURE__ */ new Date()).toISOString().slice(0, (/* @__PURE__ */ new Date()).toISOString().lastIndexOf(":")));
4540
+ const r = p, i = N((/* @__PURE__ */ new Date()).toISOString().slice(0, (/* @__PURE__ */ new Date()).toISOString().lastIndexOf(":")));
4541
4541
  let s = ae(r.values || { from: "", to: i });
4542
4542
  const o = u;
4543
4543
  H(() => r.values, (a) => {
@@ -4627,7 +4627,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
4627
4627
  },
4628
4628
  emits: ["sliderUpdated"],
4629
4629
  setup(p, { emit: u }) {
4630
- const r = u, s = I(p.sliderValue);
4630
+ const r = u, s = N(p.sliderValue);
4631
4631
  return (o, t) => (l(), n("div", null, [
4632
4632
  e("div", td, [
4633
4633
  o.label ? (l(), n("label", ld, g(o.label), 1)) : b("", !0),
@@ -4770,7 +4770,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
4770
4770
  },
4771
4771
  emits: ["productBarClick", "sideBarClick", "selectChanged", "topBarClick", "checkboxChanged", "inputChanged", "sidebarToggle", "bellClick"],
4772
4772
  setup(p, { emit: u }) {
4773
- const r = p, i = u, s = I(r.sidebarOpen), o = () => {
4773
+ const r = p, i = u, s = N(r.sidebarOpen), o = () => {
4774
4774
  s.value = !s.value, i("sidebarToggle", s.value);
4775
4775
  };
4776
4776
  return (t, a) => (l(), n("div", null, [
@@ -4995,7 +4995,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
4995
4995
  loading: { type: Boolean, default: !0 }
4996
4996
  },
4997
4997
  setup(p) {
4998
- const u = p, r = () => u.dynamicStats.length <= 5 ? `lg:grid-cols-${u.dynamicStats.length}` : `lg:grid-cols-${Math.floor(u.dynamicStats.length / 2)} xl:grid-cols-${u.dynamicStats.length}`, i = I(0), s = I(r());
4998
+ const u = p, r = () => u.dynamicStats.length <= 5 ? `lg:grid-cols-${u.dynamicStats.length}` : `lg:grid-cols-${Math.floor(u.dynamicStats.length / 2)} xl:grid-cols-${u.dynamicStats.length}`, i = N(0), s = N(r());
4999
4999
  return mt(() => i.value += 1), (o, t) => (l(), n("div", {
5000
5000
  class: y([s.value, "grid grid-cols-1 md:grid-cols-2 gap-4"]),
5001
5001
  key: i.value
@@ -5033,7 +5033,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
5033
5033
  emits: ["selectChanged"],
5034
5034
  setup(p, { emit: u }) {
5035
5035
  const r = u, i = p;
5036
- let s = I(Array.isArray(i.select) ? i.select : i.select ? [i.select] : []);
5036
+ let s = N(Array.isArray(i.select) ? i.select : i.select ? [i.select] : []);
5037
5037
  const o = (a) => {
5038
5038
  r("selectChanged", a);
5039
5039
  };
@@ -5196,7 +5196,7 @@ const hr = /* @__PURE__ */ le(mr, [["render", fr]]), yr = /* @__PURE__ */ M({
5196
5196
  },
5197
5197
  emits: ["smartFilterSelected", "smartInputChanged", "smartSelectChanged", "smartOptionSelected", "rightAddOnClicked"],
5198
5198
  setup(p, { emit: u }) {
5199
- const r = p, i = u, s = pt(J), o = I(r.items[0].props), t = (a) => {
5199
+ const r = p, i = u, s = pt(J), o = N(r.items[0].props), t = (a) => {
5200
5200
  switch (a.type) {
5201
5201
  case "uiInput":
5202
5202
  s.value = J, i("smartFilterSelected", a.value);
@@ -5255,7 +5255,7 @@ const Ye = /* @__PURE__ */ le(Rd, [["render", Ud]]), Hd = { class: "flex flex-co
5255
5255
  },
5256
5256
  emits: ["smartFilterMultipleSent", "smartFilterSelected", "smartInputChanged", "smartSelectChanged", "smartOptionSelected", "rightAddOnClicked"],
5257
5257
  setup(p, { emit: u }) {
5258
- const r = p, i = u, s = I([JSON.parse(JSON.stringify(r))]), o = I([{ name: r.items[0].name, value: null }]), t = () => {
5258
+ const r = p, i = u, s = N([JSON.parse(JSON.stringify(r))]), o = N([{ name: r.items[0].name, value: null }]), t = () => {
5259
5259
  s.value.push(JSON.parse(JSON.stringify(r))), o.value.push({ name: r.items[0].name, value: null });
5260
5260
  }, a = () => {
5261
5261
  o.value.pop(), s.value.pop();
@@ -5376,88 +5376,92 @@ const Ye = /* @__PURE__ */ le(Rd, [["render", Ud]]), Hd = { class: "flex flex-co
5376
5376
  },
5377
5377
  emits: ["smartFiltersSent", "smartFiltersCleared", "smartFilterDeleted"],
5378
5378
  setup(p, { emit: u }) {
5379
- const r = p, i = u, s = I({ id: "1", name: r.literals.and }), o = ae([]), t = I(r.availableCategories[0]), a = (_) => _ ? _ === "uiInput" ? r.literals.contains : r.literals.is : "", d = (_) => {
5380
- o.splice(0, o.length), _.logicOperator === "and" || _.logicOperator === r.literals.and ? s.value = { id: "1", name: r.literals.and } : (_.logicOperator === "or" || _.logicOperator === r.literals.or) && (s.value = { id: "2", name: r.literals.or }), _.filters.forEach((P) => {
5381
- const L = r.availableCategories.find((R) => R.name === P.category);
5379
+ const r = p, i = u, s = N({ id: "1", name: r.literals.and }), o = ae([]), t = N(r.availableCategories[0] || {}), a = (x) => x ? x === "uiInput" ? r.literals.contains : r.literals.is : "", d = (x) => {
5380
+ o.splice(0, o.length), x.logicOperator === "and" || x.logicOperator === r.literals.and ? s.value = { id: "1", name: r.literals.and } : (x.logicOperator === "or" || x.logicOperator === r.literals.or) && (s.value = { id: "2", name: r.literals.or }), x.filters.forEach((I) => {
5381
+ const L = r.availableCategories.find((R) => R.name === I.name);
5382
5382
  if (L) {
5383
5383
  const R = {
5384
- id: Date.now().toString() + Math.random().toString(36).substr(2, 9),
5385
- name: P.category,
5386
- type: P.type,
5384
+ label: I.label,
5385
+ name: I.name,
5386
+ type: I.type,
5387
5387
  props: { ...L.defaultProps }
5388
5388
  };
5389
- if (P.type === "uiInput")
5390
- R.props.value = P.value || "";
5391
- else if (P.type === "uiSelect") {
5392
- const G = L.defaultProps.items?.find((ut) => ut.name === P.value);
5389
+ if (I.type === "uiInput")
5390
+ R.props.value = I.value || "";
5391
+ else if (I.type === "uiSelect") {
5392
+ const G = L.defaultProps.items?.find((ut) => ut.name === I.value);
5393
5393
  G ? R.props.select = G : L.defaultProps.items && L.defaultProps.items.length > 0 && (R.props.select = L.defaultProps.items[0]);
5394
5394
  }
5395
5395
  o.push(R);
5396
5396
  }
5397
5397
  });
5398
5398
  };
5399
- H(() => r.literals, (_) => {
5400
- s.value.id === "1" ? s.value.name = _.and : s.value.id === "2" && (s.value.name = _.or);
5401
- }, { deep: !0 }), H(() => r.availableCategories, (_) => {
5402
- _.length > 0 && (_.some((L) => L.id === t.value.id) || (t.value = _[0]));
5403
- }, { deep: !0 }), H(() => r.filters, (_) => {
5404
- _ && d(_);
5399
+ H(() => r.literals, (x) => {
5400
+ s.value.id === "1" ? s.value.name = x.and : s.value.id === "2" && (s.value.name = x.or);
5401
+ }, { deep: !0 }), H(() => r.availableCategories, (x) => {
5402
+ x.length > 0 && (!t.value.name || !x.some((I) => I.name === t.value.name)) && (t.value = x[0]);
5403
+ }, { deep: !0, immediate: !0 }), H(() => r.filters, (x) => {
5404
+ x && d(x);
5405
5405
  }, { deep: !0, immediate: !0 });
5406
5406
  const h = Y(() => [
5407
5407
  { id: "1", name: r.literals.and },
5408
5408
  { id: "2", name: r.literals.or }
5409
- ]), v = Y(() => r.availableCategories.map((_) => ({
5410
- id: _.id,
5411
- name: _.name
5409
+ ]), v = Y(() => r.availableCategories.map((x) => ({
5410
+ id: x.name,
5411
+ name: x.name,
5412
+ label: x.label
5412
5413
  }))), j = Y(() => ({
5413
- id: t.value.id,
5414
+ id: t.value.name,
5415
+ label: t.value.label,
5414
5416
  name: t.value.name
5415
- })), w = Y(() => o.map((_) => _.type === "uiInput" ? {
5416
- name: _.name,
5417
+ })), w = Y(() => o.map((x) => x.type === "uiInput" ? {
5418
+ name: x.name,
5417
5419
  operator: r.literals.contains,
5418
- value: _.props.value || ""
5419
- } : _.type === "uiSelect" ? {
5420
- name: _.name,
5420
+ value: x.props.value || ""
5421
+ } : x.type === "uiSelect" ? {
5422
+ name: x.name,
5421
5423
  operator: r.literals.is,
5422
- value: _.props.select?.name || ""
5424
+ value: x.props.select?.name || ""
5423
5425
  } : {
5424
- name: _.name,
5426
+ name: x.name,
5425
5427
  operator: r.literals.contains,
5426
5428
  value: ""
5427
- })), T = (_) => {
5428
- s.value = Array.isArray(_) ? _[0] || { id: "1", name: r.literals.and } : _;
5429
- }, x = (_) => {
5430
- const P = Array.isArray(_) ? _[0] : _, L = r.availableCategories.find((R) => R.id === P.id);
5429
+ })), T = (x) => {
5430
+ s.value = Array.isArray(x) ? x[0] || { id: "1", name: r.literals.and } : x;
5431
+ }, _ = (x) => {
5432
+ const I = Array.isArray(x) ? x[0] : x, L = r.availableCategories.find((R) => R.name === I.id);
5431
5433
  L && (t.value = L);
5432
5434
  }, A = () => {
5433
- if (!t.value) return;
5434
- const _ = {
5435
- id: Date.now().toString(),
5435
+ if (!t.value || !t.value.name)
5436
+ return;
5437
+ const x = {
5438
+ label: t.value.label,
5436
5439
  name: t.value.name,
5437
5440
  type: t.value.componentType,
5438
5441
  props: { ...t.value.defaultProps }
5439
5442
  };
5440
- o.push(_);
5441
- }, F = (_, P) => {
5442
- if (_ < 0 || _ >= o.length) return;
5443
- const L = o[_];
5444
- L.type === "uiInput" ? typeof P == "string" && (L.props.value = P) : L.type === "uiSelect" && (Array.isArray(P) ? L.props.select = P[0] : typeof P == "object" && P !== null && (L.props.select = P));
5445
- }, C = (_) => {
5446
- _ >= 0 && _ < o.length && (o.splice(_, 1), i("smartFilterDeleted", _));
5443
+ o.push(x);
5444
+ }, F = (x, I) => {
5445
+ if (x < 0 || x >= o.length) return;
5446
+ const L = o[x];
5447
+ L.type === "uiInput" ? typeof I == "string" && (L.props.value = I) : L.type === "uiSelect" && (Array.isArray(I) ? L.props.select = I[0] : typeof I == "object" && I !== null && (L.props.select = I));
5448
+ }, C = (x) => {
5449
+ x >= 0 && x < o.length && (o.splice(x, 1), i("smartFilterDeleted", x));
5447
5450
  }, q = () => {
5448
5451
  o.splice(0, o.length), i("smartFiltersCleared");
5449
- }, N = () => {
5450
- const P = {
5452
+ }, P = () => {
5453
+ const I = {
5451
5454
  logicOperator: s.value.id === "1" ? "and" : "or",
5452
5455
  filters: o.map((L) => ({
5453
- category: L.id,
5456
+ name: L.name,
5457
+ label: L.label,
5454
5458
  type: L.type,
5455
5459
  value: L.type === "uiInput" ? L.props.value : L.props.select?.id
5456
5460
  }))
5457
5461
  };
5458
- i("smartFiltersSent", P);
5462
+ i("smartFiltersSent", I);
5459
5463
  };
5460
- return (_, P) => (l(), k(c(_t), { class: "relative" }, {
5464
+ return (x, I) => (l(), k(c(_t), { class: "relative" }, {
5461
5465
  default: f(() => [
5462
5466
  m(c($t), { class: "inline-flex items-center gap-x-2 text-sm/6 font-semibold text-gray-900 outline-none" }, {
5463
5467
  default: f(() => [
@@ -5492,14 +5496,14 @@ const Ye = /* @__PURE__ */ le(Rd, [["render", Ud]]), Hd = { class: "flex flex-co
5492
5496
  class: "w-60",
5493
5497
  items: v.value,
5494
5498
  select: j.value,
5495
- onSelectChanged: x
5499
+ onSelectChanged: _
5496
5500
  }, null, 8, ["items", "select"]),
5497
5501
  m(U, {
5498
5502
  loading: !1,
5499
5503
  onClick: A,
5500
- disabled: !t.value
5504
+ disabled: !t.value || !t.value.name
5501
5505
  }, {
5502
- default: f(() => P[0] || (P[0] = [
5506
+ default: f(() => I[0] || (I[0] = [
5503
5507
  z(" Agregar Filtro ", -1)
5504
5508
  ])),
5505
5509
  _: 1,
@@ -5508,7 +5512,7 @@ const Ye = /* @__PURE__ */ le(Rd, [["render", Ud]]), Hd = { class: "flex flex-co
5508
5512
  ]),
5509
5513
  (l(!0), n($, null, S(o, (L, R) => (l(), n("div", {
5510
5514
  class: "flex items-center gap-x-2 w-full",
5511
- key: L.id
5515
+ key: L.name
5512
5516
  }, [
5513
5517
  m(Z, {
5514
5518
  loading: !1,
@@ -5516,7 +5520,7 @@ const Ye = /* @__PURE__ */ le(Rd, [["render", Ud]]), Hd = { class: "flex flex-co
5516
5520
  color: "gray"
5517
5521
  }, {
5518
5522
  default: f(() => [
5519
- z(g(L.name), 1)
5523
+ z(g(L.label), 1)
5520
5524
  ]),
5521
5525
  _: 2
5522
5526
  }, 1024),
@@ -5590,7 +5594,7 @@ const Ye = /* @__PURE__ */ le(Rd, [["render", Ud]]), Hd = { class: "flex flex-co
5590
5594
  m(U, {
5591
5595
  loading: !1,
5592
5596
  icon: c(At),
5593
- onClick: N
5597
+ onClick: P
5594
5598
  }, {
5595
5599
  default: f(() => [
5596
5600
  z(g(r.literals.filter), 1)