@levo-so/site-runtime 0.3.16 → 0.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { C as e, a as t, c as n, f as r, g as i, h as a, l as o, m as s, n as c, o as l, p as u, r as d, t as f, u as p } from "./pillChrome-CEpWGNZB.js";
3
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
4
- import { useEffect as g, useRef as _, useState as v } from "react";
3
+ import { useEffect as m, useRef as h, useState as g } from "react";
4
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
5
5
  import { ArrowUp as y, Sparkles as b } from "lucide-react";
6
6
  //#region ../../libraries/ai-chat/src/useActiveAgent.ts
7
7
  var x = (t) => e("active_agent", t), S = (e) => {
@@ -21,16 +21,16 @@ var x = (t) => e("active_agent", t), S = (e) => {
21
21
  t === null ? window.sessionStorage.removeItem(n) : window.sessionStorage.setItem(n, JSON.stringify(t));
22
22
  } catch {}
23
23
  }, w = ({ url: e, workspaceId: t, headers: n, path: r }) => {
24
- let [i, a] = v({ status: "loading" });
25
- g(() => {
24
+ let [i, a] = g({ status: "loading" });
25
+ m(() => {
26
26
  let e = S(t);
27
27
  a(e ? {
28
28
  status: "ready",
29
29
  agent: e
30
30
  } : (e) => e.status === "ready" ? { status: "loading" } : e);
31
31
  }, [t]);
32
- let o = _(n);
33
- return o.current = n, g(() => {
32
+ let o = h(n);
33
+ return o.current = n, m(() => {
34
34
  if (!t || !e) return;
35
35
  let n = r ? `${e}${e.includes("?") ? "&" : "?"}path=${encodeURIComponent(r)}` : e, i = new AbortController();
36
36
  return (async () => {
@@ -64,13 +64,13 @@ var x = (t) => e("active_agent", t), S = (e) => {
64
64
  e,
65
65
  r
66
66
  ]), i;
67
- }, T = (...e) => e.filter(Boolean).join(" "), E = () => import("./KBChatWidget-GRi6sLpp.js"), D = (e) => {
68
- let [t, n] = v(null), [r, i] = v(!1), [a, o] = v("");
69
- return t ? /* @__PURE__ */ m(t, {
67
+ }, T = (...e) => e.filter(Boolean).join(" "), E = () => import("./KBChatWidget-BMuZ-VI3.js"), D = (e) => {
68
+ let [t, n] = g(null), [r, i] = g(!1), [a, o] = g("");
69
+ return t ? /* @__PURE__ */ _(t, {
70
70
  initialOpen: !0,
71
71
  initialDraft: a,
72
72
  ...e
73
- }) : /* @__PURE__ */ m(k, {
73
+ }) : /* @__PURE__ */ _(k, {
74
74
  siteName: e.siteName,
75
75
  draft: a,
76
76
  loading: r,
@@ -84,31 +84,31 @@ var x = (t) => e("active_agent", t), S = (e) => {
84
84
  E().catch(() => {});
85
85
  }
86
86
  });
87
- }, O = () => /* @__PURE__ */ m("span", {
87
+ }, O = () => /* @__PURE__ */ _("span", {
88
88
  "aria-hidden": !0,
89
89
  className: "h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"
90
- }), k = ({ siteName: e, draft: i, loading: g, onDraftChange: x, onActivate: S, onPrefetch: C }) => {
91
- let w = _(null), E = _(null), D = a(e), [k, A] = v(!1);
92
- return /* @__PURE__ */ m("div", {
90
+ }), k = ({ siteName: e, draft: i, loading: m, onDraftChange: x, onActivate: S, onPrefetch: C }) => {
91
+ let w = h(null), E = h(null), D = a(e), [k, A] = g(!1);
92
+ return /* @__PURE__ */ _("div", {
93
93
  onPointerEnter: C,
94
94
  className: T("ai-chat-launcher fixed bottom-8 left-1/2 z-[60] -translate-x-1/2", u),
95
- children: /* @__PURE__ */ m("div", {
95
+ children: /* @__PURE__ */ _("div", {
96
96
  className: T(c, n, "ai-chat-intro-morph"),
97
- children: /* @__PURE__ */ h("div", {
97
+ children: /* @__PURE__ */ v("div", {
98
98
  ref: E,
99
99
  className: T(p, k && "ai-chat-pill-surface--stacked"),
100
100
  children: [
101
- /* @__PURE__ */ m("button", {
101
+ /* @__PURE__ */ _("button", {
102
102
  type: "button",
103
103
  onClick: S,
104
104
  onFocus: C,
105
105
  "aria-label": "Open AI chat",
106
106
  className: o,
107
- children: g ? /* @__PURE__ */ m(O, {}) : /* @__PURE__ */ m(b, { className: "h-5 w-5" })
107
+ children: m ? /* @__PURE__ */ _(O, {}) : /* @__PURE__ */ _(b, { className: "h-5 w-5" })
108
108
  }),
109
- /* @__PURE__ */ h("div", {
109
+ /* @__PURE__ */ v("div", {
110
110
  className: d,
111
- children: [/* @__PURE__ */ m("textarea", {
111
+ children: [/* @__PURE__ */ _("textarea", {
112
112
  ref: w,
113
113
  rows: 1,
114
114
  autoComplete: "off",
@@ -123,21 +123,21 @@ var x = (t) => e("active_agent", t), S = (e) => {
123
123
  x(t.value), E.current && A(s(E.current, t));
124
124
  },
125
125
  className: r
126
- }), !i && /* @__PURE__ */ m("span", {
126
+ }), !i && /* @__PURE__ */ _("span", {
127
127
  className: T("ai-chat-pill-label pointer-events-none absolute inset-y-0 left-0 flex max-w-full items-center truncate bg-clip-text font-semibold text-[15px] text-transparent", "ai-chat-intro-label"),
128
128
  "aria-hidden": !0,
129
129
  children: D
130
130
  })]
131
131
  }),
132
- /* @__PURE__ */ m("div", {
132
+ /* @__PURE__ */ _("div", {
133
133
  className: f,
134
- children: /* @__PURE__ */ m("button", {
134
+ children: /* @__PURE__ */ _("button", {
135
135
  type: "button",
136
136
  onClick: S,
137
137
  "aria-label": "Open AI chat",
138
138
  className: t,
139
139
  style: l,
140
- children: g ? /* @__PURE__ */ m(O, {}) : /* @__PURE__ */ m(y, { className: "h-5 w-5 stroke-[2.5px]" })
140
+ children: m ? /* @__PURE__ */ _(O, {}) : /* @__PURE__ */ _(y, { className: "h-5 w-5 stroke-[2.5px]" })
141
141
  })
142
142
  })
143
143
  ]
@@ -154,9 +154,9 @@ var x = (t) => e("active_agent", t), S = (e) => {
154
154
  } : i(o),
155
155
  path: l
156
156
  });
157
- return u.status === "ready" ? /* @__PURE__ */ m("div", {
157
+ return u.status === "ready" ? /* @__PURE__ */ _("div", {
158
158
  "data-ai-chat-root": !0,
159
- children: /* @__PURE__ */ m(D, {
159
+ children: /* @__PURE__ */ _(D, {
160
160
  workspaceId: e,
161
161
  siteName: t,
162
162
  siteLogo: n,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levo-so/site-runtime",
3
- "version": "0.3.16",
3
+ "version": "0.3.17",
4
4
  "description": "Runtime for Levo Studio v3 sites — the editor preview inspector, page head metadata, and the Levo data client.",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -82,8 +82,8 @@
82
82
  "@assistant-ui/store": "0.3.13",
83
83
  "@assistant-ui/tap": "0.9.17",
84
84
  "remark-gfm": "4.0.1",
85
- "@levo-so/core": "0.3.16",
86
- "@levo-so/insights": "0.3.16",
85
+ "@levo-so/core": "0.3.17",
86
+ "@levo-so/insights": "0.3.17",
87
87
  "@stripe/react-stripe-js": "3.1.1",
88
88
  "@stripe/stripe-js": "5.5.0",
89
89
  "react-razorpay": "3.0.1"
package/popups.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./dist-B1BSD6Np.js";
1
+ import { t as e } from "./dist-C6-eVcUB.js";
2
2
  //#region src/popups/usePopup.ts
3
3
  var t = () => e();
4
4
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import { c as e, f as t, r as n, s as r } from "./popupState-JmpeKzgM-D_77LiAa.js";
2
2
  import { c as i } from "react/compiler-runtime";
3
- import { jsx as a } from "react/jsx-runtime";
4
- import { createRuntimeFn as o } from "@vanilla-extract/recipes/createRuntimeFn";
5
- import { createContext as s, useContext as c } from "react";
3
+ import { createContext as a, useContext as o } from "react";
4
+ import { jsx as s } from "react/jsx-runtime";
5
+ import { createRuntimeFn as c } from "@vanilla-extract/recipes/createRuntimeFn";
6
6
  //#region ../../libraries/popups/dist/rolldown-runtime-CAFD8bLK.js
7
7
  var l = Object.defineProperty, u = (e, t) => {
8
8
  let n = {};
@@ -11,7 +11,7 @@ var l = Object.defineProperty, u = (e, t) => {
11
11
  enumerable: !0
12
12
  });
13
13
  return t || l(n, Symbol.toStringTag, { value: "Module" }), n;
14
- }, d = o({
14
+ }, d = c({
15
15
  defaultClassName: "_1gklknd4",
16
16
  variantClassNames: {
17
17
  placement: {
@@ -27,7 +27,7 @@ var l = Object.defineProperty, u = (e, t) => {
27
27
  },
28
28
  defaultVariants: { placement: "popup" },
29
29
  compoundVariants: []
30
- }), f = "_1gklkndb", p = "_1gklkndc", m = o({
30
+ }), f = "_1gklkndb", p = "_1gklkndc", m = c({
31
31
  defaultClassName: "_1gklknde",
32
32
  variantClassNames: { size: {
33
33
  small: "_1gklkndf",
@@ -37,24 +37,24 @@ var l = Object.defineProperty, u = (e, t) => {
37
37
  } },
38
38
  defaultVariants: { size: "medium" },
39
39
  compoundVariants: []
40
- }), h = "_1gklkndn", g = s(null), _ = (e) => {
41
- let t = i(8), { popup: n, callbacks: r, client: o, preview: s, children: c } = e, l;
42
- t[0] !== r || t[1] !== o || t[2] !== n || t[3] !== s ? (l = {
40
+ }), h = "_1gklkndn", g = a(null), _ = (e) => {
41
+ let t = i(8), { popup: n, callbacks: r, client: a, preview: o, children: c } = e, l;
42
+ t[0] !== r || t[1] !== a || t[2] !== n || t[3] !== o ? (l = {
43
43
  popup: n,
44
44
  callbacks: r,
45
- client: o,
46
- preview: s
47
- }, t[0] = r, t[1] = o, t[2] = n, t[3] = s, t[4] = l) : l = t[4];
45
+ client: a,
46
+ preview: o
47
+ }, t[0] = r, t[1] = a, t[2] = n, t[3] = o, t[4] = l) : l = t[4];
48
48
  let u;
49
- return t[5] !== c || t[6] !== l ? (u = /* @__PURE__ */ a(g.Provider, {
49
+ return t[5] !== c || t[6] !== l ? (u = /* @__PURE__ */ s(g.Provider, {
50
50
  value: l,
51
51
  children: c
52
52
  }), t[5] = c, t[6] = l, t[7] = u) : u = t[7], u;
53
53
  }, v = () => {
54
- let e = c(g);
54
+ let e = o(g);
55
55
  if (!e) throw Error("usePopupContext must be used within a PopupProvider");
56
56
  return e;
57
- }, y = () => c(g), b = () => {
57
+ }, y = () => o(g), b = () => {
58
58
  let a = i(2), o = y(), s;
59
59
  return a[0] === o ? s = a[1] : (s = (i) => {
60
60
  let a = i === void 0 ? "programmatic" : i;
@@ -1,255 +0,0 @@
1
- import { r as e, t } from "./CollectionField-DCAXOmBN.js";
2
- import { r as n } from "./ThemeProvider-DutrjSTF.js";
3
- import { t as ee } from "./CollectionInput-BJ__qcbk.js";
4
- import { a as r, i, n as a, r as o, t as s } from "./Popover-C29yJ7rz.js";
5
- import { FieldInterfaces as c } from "@levo-so/core";
6
- import l from "dayjs";
7
- import { c as u } from "react/compiler-runtime";
8
- import { useController as d } from "react-hook-form";
9
- import f from "clsx";
10
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
11
- import { useEffect as h, useRef as g, useState as te } from "react";
12
- import { IconCalendar as _, IconChevronDown as v, IconChevronLeft as y, IconChevronRight as b, IconX as ne } from "@tabler/icons-react";
13
- import { DayPicker as re, getDefaultClassNames as x } from "react-day-picker";
14
- //#region ../../libraries/react-collection/dist/widgets/dateTimeWidget/DateTimeWidget.cssm.js
15
- var ie = "rpx4b10", ae = "rpx4b11", oe = "rpx4b12", se = "rpx4b14 _6o7s4x0", ce = "rpx4b15", le = "rpx4b17", ue = "rpx4b18", de = "rpx4b19", fe = "rpx4b1a", pe = "rpx4b1b", me = "rpx4b1c", he = "rpx4b1d", ge = "rpx4b1e", _e = "rpx4b1f", ve = "rpx4b1g", ye = "rpx4b1h", be = "rpx4b1i", xe = "rpx4b1j", Se = "rpx4b1k", Ce = "rpx4b1l", we = "rpx4b1m", Te = "rpx4b1n", Ee = "rpx4b1o", De = "rpx4b1p", Oe = "rpx4b1q", ke = "rpx4b1r", Ae = "rpx4b1s", je = "rpx4b1t", Me = "rpx4b1u", Ne = "rpx4b1v", Pe = (e) => {
16
- if (e) {
17
- let t = new Date(e);
18
- return Number.isNaN(t.getTime()) ? null : t;
19
- }
20
- return null;
21
- }, Fe = (e, t) => e ? t ? l(e).format("D MMMM, YYYY — h:mm A") : l(e).format("D MMMM, YYYY") : "", Ie = (e) => {
22
- let t = u(19), { value: n, onChange: ee } = e, [r, i] = te(-1), a = g(null), o;
23
- t[0] === n ? o = t[1] : (o = () => {
24
- if (!n) return -1;
25
- let e = n.getHours(), t = n.getMinutes();
26
- return e * 4 + Math.floor(t / 15);
27
- }, t[0] = n, t[1] = o);
28
- let s = o, c, l;
29
- t[2] === s ? (c = t[3], l = t[4]) : (c = () => {
30
- let e = s();
31
- e >= 0 && a.current && a.current.querySelector(`[data-time-index="${e}"]`)?.scrollIntoView({
32
- block: "center",
33
- behavior: "smooth"
34
- });
35
- }, l = [s], t[2] = s, t[3] = c, t[4] = l), h(c, l);
36
- let d;
37
- t[5] !== ee || t[6] !== n ? (d = (e, t) => {
38
- let r = t * 15, a = n ? new Date(n) : /* @__PURE__ */ new Date();
39
- a.setHours(e, r, 0, 0), ee(a), i(e * 4 + t);
40
- }, t[5] = ee, t[6] = n, t[7] = d) : d = t[7];
41
- let _ = d, v;
42
- t[8] !== r || t[9] !== _ ? (v = (e) => {
43
- e.stopPropagation();
44
- let t = (e) => {
45
- let t = a.current?.querySelector(`[data-time-index="${e}"]`);
46
- t?.scrollIntoView({
47
- block: "center",
48
- behavior: "smooth"
49
- }), t?.focus();
50
- };
51
- bb48: switch (e.key) {
52
- case "ArrowUp": {
53
- e.preventDefault();
54
- let n = r - 1 < 0 ? 95 : r - 1;
55
- i(n), t(n);
56
- break bb48;
57
- }
58
- case "ArrowDown": {
59
- e.preventDefault();
60
- let n = r + 1 >= 96 ? 0 : r + 1;
61
- i(n), t(n);
62
- break bb48;
63
- }
64
- case "Enter":
65
- e.preventDefault(), r >= 0 && _(Math.floor(r / 4), r % 4);
66
- break bb48;
67
- case "Escape": i(-1);
68
- }
69
- }, t[8] = r, t[9] = _, t[10] = v) : v = t[10];
70
- let y = v, b = s(), ne;
71
- t[11] === Symbol.for("react.memo_cache_sentinel") ? (ne = /* @__PURE__ */ p("div", {
72
- className: je,
73
- children: "Time"
74
- }), t[11] = ne) : ne = t[11];
75
- let re;
76
- t[12] === Symbol.for("react.memo_cache_sentinel") ? (re = Array.from({ length: 24 }), t[12] = re) : re = t[12];
77
- let x;
78
- t[13] !== b || t[14] !== _ ? (x = re.map((e, t) => {
79
- let n = t === 0 ? 12 : t > 12 ? t - 12 : t, ee = t >= 12 ? "PM" : "AM";
80
- return Array.from({ length: 4 }).map((e, r) => {
81
- let i = r * 15, a = t * 4 + r, o = a === b, s = `${n}:${i.toString().padStart(2, "0")} ${ee}`;
82
- return /* @__PURE__ */ p("button", {
83
- type: "button",
84
- role: "option",
85
- "aria-selected": o,
86
- "data-time-index": a,
87
- className: f(Ne, o && "rpx4b1w"),
88
- onClick: () => _(t, r),
89
- tabIndex: o ? 0 : -1,
90
- children: s
91
- }, a);
92
- });
93
- }), t[13] = b, t[14] = _, t[15] = x) : x = t[15];
94
- let ie;
95
- return t[16] !== y || t[17] !== x ? (ie = /* @__PURE__ */ m("div", {
96
- className: Ae,
97
- children: [ne, /* @__PURE__ */ p("div", {
98
- ref: a,
99
- className: Me,
100
- onKeyDown: y,
101
- tabIndex: 0,
102
- role: "listbox",
103
- "aria-label": "Select time",
104
- children: x
105
- })]
106
- }), t[16] = y, t[17] = x, t[18] = ie) : ie = t[18], ie;
107
- }, Le = (l) => {
108
- let h = u(160), { field: g } = l, { key: v, label: y, helper_text: b, readonly: Ae } = g, je = v === void 0 ? "" : v, Me = y === void 0 ? "" : y, Ne = b === void 0 ? "" : b, Le = Ae === void 0 ? !1 : Ae, S = je, [ze, Be] = te(!1), C;
109
- h[0] === g ? C = h[1] : (C = e(g), h[0] = g, h[1] = C);
110
- let Ve;
111
- h[2] !== S || h[3] !== C ? (Ve = {
112
- name: S,
113
- rules: C
114
- }, h[2] = S, h[3] = C, h[4] = Ve) : Ve = h[4];
115
- let { field: He, fieldState: Ue } = d(Ve), w, T, E, D, O;
116
- h[5] === He ? (w = h[6], T = h[7], E = h[8], D = h[9], O = h[10]) : ({value: O, onBlur: w, onChange: T, ref: E, ...D} = He, h[5] = He, h[6] = w, h[7] = T, h[8] = E, h[9] = D, h[10] = O);
117
- let We = !!g?.required, Ge = Ue?.error?.message, k = g?.field_interface === c.DateTimeWidget, A, Ke;
118
- h[11] !== k || h[12] !== O ? (A = Pe(O), Ke = Fe(A, k), h[11] = k, h[12] = O, h[13] = A, h[14] = Ke) : (A = h[13], Ke = h[14]);
119
- let qe = Ke, j, M, N, Je, P, F, I, L, R, z, B, V, H, U, W, G, K, q, Ye, Xe, Ze, Qe, $e, et, tt, nt, J, Y, rt, X, it, at, ot, st, ct, Z, lt, ut, dt, ft, pt, Q, mt;
120
- if (h[15] !== qe || h[16] !== k || h[17] !== Ge || h[18] !== Ne || h[19] !== ze || h[20] !== We || h[21] !== Me || h[22] !== S || h[23] !== w || h[24] !== T || h[25] !== Le || h[26] !== E || h[27] !== D || h[28] !== A || h[29] !== O) {
121
- let e = x(), n;
122
- h[73] !== k || h[74] !== T || h[75] !== A ? (n = (e) => {
123
- e && (k && A && e.setHours(A.getHours(), A.getMinutes(), 0, 0), T(e.toISOString()), k || Be(!1));
124
- }, h[73] = k, h[74] = T, h[75] = A, h[76] = n) : n = h[76];
125
- let c = n, l;
126
- h[77] === T ? l = h[78] : (l = (e) => {
127
- T(e.toISOString());
128
- }, h[77] = T, h[78] = l), I = l;
129
- let u;
130
- h[79] === T ? u = h[80] : (u = (e) => {
131
- e.preventDefault(), e.stopPropagation(), T(null);
132
- }, h[79] = T, h[80] = u);
133
- let d = u;
134
- F = t, lt = Ne, ut = Le, dt = Ge, ft = S, pt = We, Q = Me, P = a, st = ze, ct = Be;
135
- let m;
136
- h[81] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ p(_, { size: 18 }), h[81] = m) : m = h[81];
137
- let g;
138
- h[82] !== d || h[83] !== O ? (g = O ? /* @__PURE__ */ p("button", {
139
- type: "button",
140
- onClick: d,
141
- "aria-label": "Clear date",
142
- className: oe,
143
- children: /* @__PURE__ */ p(ne, { size: 14 })
144
- }) : void 0, h[82] = d, h[83] = O, h[84] = g) : g = h[84], h[85] !== qe || h[86] !== S || h[87] !== w || h[88] !== E || h[89] !== D || h[90] !== g ? (Z = /* @__PURE__ */ p(r.Trigger, { render: /* @__PURE__ */ p("div", {
145
- className: ie,
146
- children: /* @__PURE__ */ p(ee, {
147
- id: S,
148
- ref: E,
149
- value: qe,
150
- readOnly: !0,
151
- leftIcon: m,
152
- rightIcon: g,
153
- className: ae,
154
- autoComplete: "off",
155
- onBlur: w,
156
- placeholder: "Select date",
157
- ...D
158
- })
159
- }) }), h[85] = qe, h[86] = S, h[87] = w, h[88] = E, h[89] = D, h[90] = g, h[91] = Z) : Z = h[91], Je = i, N = o, at = "start", ot = 4, M = s, it = se;
160
- let te = k && "rpx4b16";
161
- h[92] === te ? X = h[93] : (X = f(ce, te), h[92] = te, h[93] = X), j = re, $e = "single", et = A || void 0, tt = c, nt = "dropdown", h[94] === Symbol.for("react.memo_cache_sentinel") ? (J = new Date((/* @__PURE__ */ new Date()).getFullYear() - 100, 0), h[94] = J) : J = h[94], h[95] === Symbol.for("react.memo_cache_sentinel") ? (Y = new Date((/* @__PURE__ */ new Date()).getFullYear() + 10, 11), h[95] = Y) : Y = h[95], rt = !0, mt = f(e.root, ue), L = de, R = fe, z = f(e.month_caption, pe), B = f(me, e.dropdowns), V = f(ge, e.dropdown), H = f(he, e.dropdown_root), U = f(_e, e.caption_label), W = f(ve, e.nav), G = f(ye, e.button_previous), K = f(be, e.button_next), q = f(xe, e.weekdays), Ye = f(Se, e.weekday), Xe = f(Ce, e.week), Ze = f(we, e.day), Qe = f(Te, e.day_button), h[15] = qe, h[16] = k, h[17] = Ge, h[18] = Ne, h[19] = ze, h[20] = We, h[21] = Me, h[22] = S, h[23] = w, h[24] = T, h[25] = Le, h[26] = E, h[27] = D, h[28] = A, h[29] = O, h[30] = j, h[31] = M, h[32] = N, h[33] = Je, h[34] = P, h[35] = F, h[36] = I, h[37] = L, h[38] = R, h[39] = z, h[40] = B, h[41] = V, h[42] = H, h[43] = U, h[44] = W, h[45] = G, h[46] = K, h[47] = q, h[48] = Ye, h[49] = Xe, h[50] = Ze, h[51] = Qe, h[52] = $e, h[53] = et, h[54] = tt, h[55] = nt, h[56] = J, h[57] = Y, h[58] = rt, h[59] = X, h[60] = it, h[61] = at, h[62] = ot, h[63] = st, h[64] = ct, h[65] = Z, h[66] = lt, h[67] = ut, h[68] = dt, h[69] = ft, h[70] = pt, h[71] = Q, h[72] = mt;
162
- } else j = h[30], M = h[31], N = h[32], Je = h[33], P = h[34], F = h[35], I = h[36], L = h[37], R = h[38], z = h[39], B = h[40], V = h[41], H = h[42], U = h[43], W = h[44], G = h[45], K = h[46], q = h[47], Ye = h[48], Xe = h[49], Ze = h[50], Qe = h[51], $e = h[52], et = h[53], tt = h[54], nt = h[55], J = h[56], Y = h[57], rt = h[58], X = h[59], it = h[60], at = h[61], ot = h[62], st = h[63], ct = h[64], Z = h[65], lt = h[66], ut = h[67], dt = h[68], ft = h[69], pt = h[70], Q = h[71], mt = h[72];
163
- let ht;
164
- h[96] !== L || h[97] !== R || h[98] !== z || h[99] !== B || h[100] !== V || h[101] !== H || h[102] !== U || h[103] !== W || h[104] !== G || h[105] !== K || h[106] !== q || h[107] !== Ye || h[108] !== Xe || h[109] !== Ze || h[110] !== Qe || h[111] !== mt ? (ht = {
165
- root: mt,
166
- months: L,
167
- month: R,
168
- month_caption: z,
169
- dropdowns: B,
170
- dropdown: V,
171
- dropdown_root: H,
172
- caption_label: U,
173
- nav: W,
174
- button_previous: G,
175
- button_next: K,
176
- weekdays: q,
177
- weekday: Ye,
178
- week: Xe,
179
- day: Ze,
180
- day_button: Qe,
181
- selected: Ee,
182
- today: De,
183
- outside: Oe,
184
- disabled: ke
185
- }, h[96] = L, h[97] = R, h[98] = z, h[99] = B, h[100] = V, h[101] = H, h[102] = U, h[103] = W, h[104] = G, h[105] = K, h[106] = q, h[107] = Ye, h[108] = Xe, h[109] = Ze, h[110] = Qe, h[111] = mt, h[112] = ht) : ht = h[112];
186
- let gt;
187
- h[113] === Symbol.for("react.memo_cache_sentinel") ? (gt = { Chevron: Re }, h[113] = gt) : gt = h[113];
188
- let _t;
189
- h[114] !== j || h[115] !== $e || h[116] !== et || h[117] !== tt || h[118] !== nt || h[119] !== J || h[120] !== Y || h[121] !== rt || h[122] !== ht ? (_t = /* @__PURE__ */ p(j, {
190
- mode: $e,
191
- selected: et,
192
- onSelect: tt,
193
- captionLayout: nt,
194
- startMonth: J,
195
- endMonth: Y,
196
- showOutsideDays: rt,
197
- classNames: ht,
198
- components: gt
199
- }), h[114] = j, h[115] = $e, h[116] = et, h[117] = tt, h[118] = nt, h[119] = J, h[120] = Y, h[121] = rt, h[122] = ht, h[123] = _t) : _t = h[123];
200
- let vt;
201
- h[124] !== k || h[125] !== I || h[126] !== A ? (vt = k && /* @__PURE__ */ p(Ie, {
202
- value: A,
203
- onChange: I
204
- }), h[124] = k, h[125] = I, h[126] = A, h[127] = vt) : vt = h[127];
205
- let yt;
206
- h[128] !== X || h[129] !== _t || h[130] !== vt ? (yt = /* @__PURE__ */ m("div", {
207
- className: X,
208
- children: [_t, vt]
209
- }), h[128] = X, h[129] = _t, h[130] = vt, h[131] = yt) : yt = h[131];
210
- let bt;
211
- h[132] === Symbol.for("react.memo_cache_sentinel") ? (bt = /* @__PURE__ */ p("div", {
212
- className: le,
213
- children: /* @__PURE__ */ p(n, {
214
- variant: "ghost",
215
- size: "sm",
216
- onClick: () => Be(!1),
217
- children: "Done"
218
- })
219
- }), h[132] = bt) : bt = h[132];
220
- let xt;
221
- h[133] !== M || h[134] !== it || h[135] !== yt ? (xt = /* @__PURE__ */ m(M, {
222
- className: it,
223
- children: [yt, bt]
224
- }), h[133] = M, h[134] = it, h[135] = yt, h[136] = xt) : xt = h[136];
225
- let St;
226
- h[137] !== N || h[138] !== at || h[139] !== ot || h[140] !== xt ? (St = /* @__PURE__ */ p(N, {
227
- align: at,
228
- sideOffset: ot,
229
- children: xt
230
- }), h[137] = N, h[138] = at, h[139] = ot, h[140] = xt, h[141] = St) : St = h[141];
231
- let Ct;
232
- h[142] !== Je || h[143] !== St ? (Ct = /* @__PURE__ */ p(Je, { children: St }), h[142] = Je, h[143] = St, h[144] = Ct) : Ct = h[144];
233
- let $;
234
- h[145] !== P || h[146] !== st || h[147] !== ct || h[148] !== Z || h[149] !== Ct ? ($ = /* @__PURE__ */ m(P, {
235
- open: st,
236
- onOpenChange: ct,
237
- children: [Z, Ct]
238
- }), h[145] = P, h[146] = st, h[147] = ct, h[148] = Z, h[149] = Ct, h[150] = $) : $ = h[150];
239
- let wt;
240
- return h[151] !== F || h[152] !== lt || h[153] !== ut || h[154] !== dt || h[155] !== ft || h[156] !== pt || h[157] !== Q || h[158] !== $ ? (wt = /* @__PURE__ */ p(F, {
241
- helperText: lt,
242
- readOnly: ut,
243
- error: dt,
244
- htmlFor: ft,
245
- isRequired: pt,
246
- label: Q,
247
- children: $
248
- }), h[151] = F, h[152] = lt, h[153] = ut, h[154] = dt, h[155] = ft, h[156] = pt, h[157] = Q, h[158] = $, h[159] = wt) : wt = h[159], wt;
249
- };
250
- function Re(e) {
251
- let { orientation: t } = e;
252
- return t === "left" ? /* @__PURE__ */ p(y, { size: 16 }) : t === "right" ? /* @__PURE__ */ p(b, { size: 16 }) : /* @__PURE__ */ p(v, { size: 14 });
253
- }
254
- //#endregion
255
- export { Le as default };
@@ -1,99 +0,0 @@
1
- "use client";
2
- import { r as e, t } from "./CollectionField-DCAXOmBN.js";
3
- import { t as ee } from "./VerifyButton-BUT70lgz.js";
4
- import { t as n } from "./CollectionInput-BJ__qcbk.js";
5
- import { c as te } from "react/compiler-runtime";
6
- import { useController as r } from "react-hook-form";
7
- import i, { isSupportedCountry as a } from "react-phone-number-input";
8
- import { jsx as o, jsxs as ne } from "react/jsx-runtime";
9
- import { useState as s } from "react";
10
- import { IconPencil as re } from "@tabler/icons-react";
11
- //#region ../../libraries/react-collection/dist/widgets/phoneWidget/PhoneWidget.cssm.js
12
- var ie = "_89f1hw0", c = "_89f1hw1", l = "_89f1hw2", ae = "_89f1hw4", u = (u) => {
13
- let d = te(51), { field: f, settings: oe } = u, { key: p, label: m, helper_text: h, readonly: g, options: _ } = f, v = p === void 0 ? "" : p, y = m === void 0 ? "" : m, b = h === void 0 ? "" : h, x = g === void 0 ? !1 : g, S = v, C = !!_?.verification && !!oe?.enableVerification, [w, T] = s(null), [E, se] = s(!1), D;
14
- d[0] !== E || d[1] !== C || d[2] !== w ? (D = (e) => E ? !0 : C && (!w || w !== e) ? "Phone verification required" : !0, d[0] = E, d[1] = C, d[2] = w, d[3] = D) : D = d[3];
15
- let O;
16
- d[4] !== f || d[5] !== D ? (O = e(f, D), d[4] = f, d[5] = D, d[6] = O) : O = d[6];
17
- let k = O, A;
18
- d[7] !== S || d[8] !== k ? (A = {
19
- name: S,
20
- rules: k
21
- }, d[7] = S, d[8] = k, d[9] = A) : A = d[9];
22
- let { field: j, fieldState: M } = r(A), N, P, F, I;
23
- d[10] === j ? (N = d[11], P = d[12], F = d[13], I = d[14]) : ({value: I, onBlur: N, onChange: P, ...F} = j, d[10] = j, d[11] = N, d[12] = P, d[13] = F, d[14] = I);
24
- let { error: ce } = M, L = !!f?.required, R = ce?.message, z = !!w && !!I && w === I, B;
25
- d[15] === _?.country ? B = d[16] : (B = () => {
26
- let e = _?.country;
27
- if (e && typeof e == "string") {
28
- let t = e?.toUpperCase();
29
- if (a(t)) return t;
30
- }
31
- return "IN";
32
- }, d[15] = _?.country, d[16] = B);
33
- let V = B, H;
34
- d[17] === P ? H = d[18] : (H = (e) => {
35
- T(e), P(e);
36
- }, d[17] = P, d[18] = H);
37
- let U = H, W = I ?? "", G;
38
- d[19] === V ? G = d[20] : (G = V(), d[19] = V, d[20] = G);
39
- let K;
40
- d[21] === P ? K = d[22] : (K = (e) => {
41
- P?.(e ?? "");
42
- }, d[21] = P, d[22] = K);
43
- let q;
44
- d[23] === N ? q = d[24] : (q = () => {
45
- N?.();
46
- }, d[23] = N, d[24] = q);
47
- let J = x || z, Y;
48
- d[25] === z ? Y = d[26] : (Y = z ? /* @__PURE__ */ o("button", {
49
- type: "button",
50
- onClick: () => T(null),
51
- className: ae,
52
- title: "Change phone number",
53
- children: /* @__PURE__ */ o(re, { size: 14 })
54
- }) : null, d[25] = z, d[26] = Y);
55
- let X;
56
- d[27] !== F || d[28] !== W || d[29] !== G || d[30] !== K || d[31] !== q || d[32] !== J || d[33] !== Y ? (X = /* @__PURE__ */ o("div", {
57
- className: l,
58
- children: /* @__PURE__ */ o(i, {
59
- value: W,
60
- international: !0,
61
- inputComponent: n,
62
- defaultCountry: G,
63
- onChange: K,
64
- onBlur: q,
65
- className: ie,
66
- readOnly: J,
67
- rightIcon: Y,
68
- ...F
69
- })
70
- }), d[27] = F, d[28] = W, d[29] = G, d[30] = K, d[31] = q, d[32] = J, d[33] = Y, d[34] = X) : X = d[34];
71
- let Z;
72
- d[35] !== U || d[36] !== z || d[37] !== C || d[38] !== I ? (Z = C && /* @__PURE__ */ o("div", {
73
- className: "_89f1hw3",
74
- children: /* @__PURE__ */ o(ee, {
75
- value: I,
76
- type: "phone",
77
- isVerified: z,
78
- onVerifySuccess: U,
79
- onStateChange: se
80
- })
81
- }), d[35] = U, d[36] = z, d[37] = C, d[38] = I, d[39] = Z) : Z = d[39];
82
- let Q;
83
- d[40] !== X || d[41] !== Z ? (Q = /* @__PURE__ */ ne("div", {
84
- className: c,
85
- children: [X, Z]
86
- }), d[40] = X, d[41] = Z, d[42] = Q) : Q = d[42];
87
- let $;
88
- return d[43] !== R || d[44] !== b || d[45] !== L || d[46] !== y || d[47] !== S || d[48] !== x || d[49] !== Q ? ($ = /* @__PURE__ */ o(t, {
89
- error: R,
90
- helperText: b,
91
- readOnly: x,
92
- label: y,
93
- htmlFor: S,
94
- isRequired: L,
95
- children: Q
96
- }), d[43] = R, d[44] = b, d[45] = L, d[46] = y, d[47] = S, d[48] = x, d[49] = Q, d[50] = $) : $ = d[50], $;
97
- };
98
- //#endregion
99
- export { u as PhoneWidget, u as default };