@rpcbase/ui 0.53.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,88 @@
1
- import * as ve from "react";
2
- import _e, { useState as I, useEffect as $, useRef as C, useMemo as xe } from "react";
3
- import ie, { clsx as ye } from "clsx";
1
+ import * as _e from "react";
2
+ import xe, { useState as L, useEffect as $, useRef as I, useMemo as ye } from "react";
3
+ import le, { clsx as we } from "clsx";
4
4
  import * as N from "@radix-ui/react-dialog";
5
5
  import { XIcon as Ee } from "lucide-react";
6
- import { Link as we } from "react-router";
7
- const dt = () => typeof navigator > "u" ? !1 : /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
8
- var ee = { exports: {} }, X = {};
6
+ import { Link as Te } from "react-router";
7
+ const mt = () => typeof navigator > "u" ? !1 : /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
8
+ function ke(e, t) {
9
+ e.src = t;
10
+ }
11
+ const je = (e) => {
12
+ var t, o, n, a = "The Google Maps JavaScript API", i = "google", u = "importLibrary", p = "__ib__", m = document, x = window, v = x[i] || (x[i] = {}), c = v.maps || (v.maps = {}), d = /* @__PURE__ */ new Set(), T = new URLSearchParams(), w = () => t || (t = new Promise(async (_, k) => {
13
+ await (o = m.createElement("script")), T.set("libraries", [...d] + "");
14
+ for (n in e)
15
+ T.set(n.replace(/[A-Z]/g, (y) => "_" + y[0].toLowerCase()), e[n]);
16
+ T.set("callback", i + ".maps." + p), ke(o, "https://maps.googleapis.com/maps/api/js?" + T), c[p] = _, o.onerror = () => t = k(Error(a + " could not load.")), o.nonce = m.querySelector("script[nonce]")?.nonce || "", m.head.append(o);
17
+ }));
18
+ c[u] ? console.warn(a + " only loads once. Ignoring:", e) : c[u] = (_, ...k) => d.add(_) && w().then(() => c[u](_, ...k));
19
+ }, Pe = (e) => `The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(e)}) will be ignored.`, Re = (e) => `The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(e)}) will be ignored.`, Ne = "No options were set before calling importLibrary. Make sure to configure the loader using setOptions().", Ae = "There already is a script loading the Google Maps JavaScript API, and no google.maps.importLibrary function is defined. @googlemaps/js-api-loader will proceed to bootstrap the API with the specified options, but the existing script might cause problems using the API. Make sure to remove the script loading the API.", he = process.env.NODE_ENV !== "production", ce = he ? (e) => {
20
+ console.warn(`[@googlemaps/js-api-loader] ${e}`);
21
+ } : () => {
22
+ }, Se = he ? (e) => {
23
+ console.info(`[@googlemaps/js-api-loader] ${e}`);
24
+ } : () => {
25
+ }, Oe = process.env.NODE_ENV !== "production";
26
+ let ie = !1;
27
+ function Me(e) {
28
+ if (ie) {
29
+ ce(Pe(e));
30
+ return;
31
+ }
32
+ Le(e), ie = !0;
33
+ }
34
+ async function Ie(e) {
35
+ if (ie || ce(Ne), !window?.google?.maps?.importLibrary)
36
+ throw new Error("google.maps.importLibrary is not installed.");
37
+ return await google.maps.importLibrary(e);
38
+ }
39
+ function Le(e) {
40
+ const t = !!window.google?.maps?.importLibrary;
41
+ t ? Se(Re(e)) : Oe && document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]') && ce(Ae), t || je(e);
42
+ }
43
+ let K = null, de = null;
44
+ const oe = /* @__PURE__ */ new Map(), De = (e) => {
45
+ if (!e) {
46
+ const t = new Error("useMapsLibrary: missing Google Maps API key");
47
+ return console.error(t.message), Promise.reject(t);
48
+ }
49
+ return K ? de !== e && console.warn(
50
+ "useMapsLibrary: ignoring attempt to re-initialize Google Maps with a different API key than the one already in use."
51
+ ) : (de = e, Me({
52
+ key: e,
53
+ v: "weekly"
54
+ }), K = Ie("core").then(() => {
55
+ }).catch((t) => {
56
+ throw K = null, t;
57
+ })), K;
58
+ }, Ce = (e, t) => {
59
+ const o = String(e), n = oe.get(o);
60
+ if (n)
61
+ return n;
62
+ const a = De(t).then(() => {
63
+ if (typeof window > "u" || !window.google?.maps?.importLibrary)
64
+ throw new Error("useMapsLibrary: google.maps.importLibrary is not available.");
65
+ return window.google.maps.importLibrary(o);
66
+ }).then((i) => i).catch((i) => {
67
+ throw oe.delete(o), i;
68
+ });
69
+ return oe.set(o, a), a;
70
+ }, $e = (e, t) => {
71
+ const [o, n] = L(null);
72
+ return $(() => {
73
+ if (typeof window > "u")
74
+ return;
75
+ let a = !1;
76
+ return Ce(e, t).then((i) => {
77
+ a || n(i);
78
+ }).catch((i) => {
79
+ a || (console.error(`useMapsLibrary: failed to load ${String(e)} library`, i), n(null));
80
+ }), () => {
81
+ a = !0;
82
+ };
83
+ }, [e, t]), o;
84
+ };
85
+ var ee = { exports: {} }, B = {};
9
86
  /**
10
87
  * @license React
11
88
  * react-jsx-runtime.production.js
@@ -15,29 +92,29 @@ var ee = { exports: {} }, X = {};
15
92
  * This source code is licensed under the MIT license found in the
16
93
  * LICENSE file in the root directory of this source tree.
17
94
  */
18
- var ue;
19
- function Te() {
20
- if (ue) return X;
21
- ue = 1;
22
- var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
23
- function o(n, a, c) {
24
- var d = null;
25
- if (c !== void 0 && (d = "" + c), a.key !== void 0 && (d = "" + a.key), "key" in a) {
26
- c = {};
95
+ var fe;
96
+ function ze() {
97
+ if (fe) return B;
98
+ fe = 1;
99
+ var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
100
+ function o(n, a, i) {
101
+ var u = null;
102
+ if (i !== void 0 && (u = "" + i), a.key !== void 0 && (u = "" + a.key), "key" in a) {
103
+ i = {};
27
104
  for (var p in a)
28
- p !== "key" && (c[p] = a[p]);
29
- } else c = a;
30
- return a = c.ref, {
105
+ p !== "key" && (i[p] = a[p]);
106
+ } else i = a;
107
+ return a = i.ref, {
31
108
  $$typeof: e,
32
109
  type: n,
33
- key: d,
110
+ key: u,
34
111
  ref: a !== void 0 ? a : null,
35
- props: c
112
+ props: i
36
113
  };
37
114
  }
38
- return X.Fragment = r, X.jsx = o, X.jsxs = o, X;
115
+ return B.Fragment = t, B.jsx = o, B.jsxs = o, B;
39
116
  }
40
- var H = {};
117
+ var J = {};
41
118
  /**
42
119
  * @license React
43
120
  * react-jsx-runtime.development.js
@@ -47,322 +124,261 @@ var H = {};
47
124
  * This source code is licensed under the MIT license found in the
48
125
  * LICENSE file in the root directory of this source tree.
49
126
  */
50
- var de;
51
- function ke() {
52
- return de || (de = 1, process.env.NODE_ENV !== "production" && (function() {
53
- function e(t) {
54
- if (t == null) return null;
55
- if (typeof t == "function")
56
- return t.$$typeof === Q ? null : t.displayName || t.name || null;
57
- if (typeof t == "string") return t;
58
- switch (t) {
127
+ var me;
128
+ function Fe() {
129
+ return me || (me = 1, process.env.NODE_ENV !== "production" && (function() {
130
+ function e(r) {
131
+ if (r == null) return null;
132
+ if (typeof r == "function")
133
+ return r.$$typeof === Z ? null : r.displayName || r.name || null;
134
+ if (typeof r == "string") return r;
135
+ switch (r) {
59
136
  case k:
60
137
  return "Fragment";
61
- case D:
138
+ case M:
62
139
  return "Profiler";
63
140
  case y:
64
141
  return "StrictMode";
65
- case O:
142
+ case S:
66
143
  return "Suspense";
67
- case F:
144
+ case z:
68
145
  return "SuspenseList";
69
- case W:
146
+ case H:
70
147
  return "Activity";
71
148
  }
72
- if (typeof t == "object")
73
- switch (typeof t.tag == "number" && console.error(
149
+ if (typeof r == "object")
150
+ switch (typeof r.tag == "number" && console.error(
74
151
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
75
- ), t.$$typeof) {
76
- case v:
152
+ ), r.$$typeof) {
153
+ case _:
77
154
  return "Portal";
78
155
  case P:
79
- return t.displayName || "Context";
156
+ return r.displayName || "Context";
80
157
  case j:
81
- return (t._context.displayName || "Context") + ".Consumer";
158
+ return (r._context.displayName || "Context") + ".Consumer";
82
159
  case A:
83
- var i = t.render;
84
- return t = t.displayName, t || (t = i.displayName || i.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
160
+ var l = r.render;
161
+ return r = r.displayName, r || (r = l.displayName || l.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
85
162
  case R:
86
- return i = t.displayName || null, i !== null ? i : e(t.type) || "Memo";
87
- case Y:
88
- i = t._payload, t = t._init;
163
+ return l = r.displayName || null, l !== null ? l : e(r.type) || "Memo";
164
+ case D:
165
+ l = r._payload, r = r._init;
89
166
  try {
90
- return e(t(i));
167
+ return e(r(l));
91
168
  } catch {
92
169
  }
93
170
  }
94
171
  return null;
95
172
  }
96
- function r(t) {
97
- return "" + t;
173
+ function t(r) {
174
+ return "" + r;
98
175
  }
99
- function o(t) {
176
+ function o(r) {
100
177
  try {
101
- r(t);
102
- var i = !1;
178
+ t(r);
179
+ var l = !1;
103
180
  } catch {
104
- i = !0;
181
+ l = !0;
105
182
  }
106
- if (i) {
107
- i = console;
108
- var g = i.error, h = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
109
- return g.call(
110
- i,
183
+ if (l) {
184
+ l = console;
185
+ var h = l.error, g = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
186
+ return h.call(
187
+ l,
111
188
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
112
- h
113
- ), r(t);
189
+ g
190
+ ), t(r);
114
191
  }
115
192
  }
116
- function n(t) {
117
- if (t === k) return "<>";
118
- if (typeof t == "object" && t !== null && t.$$typeof === Y)
193
+ function n(r) {
194
+ if (r === k) return "<>";
195
+ if (typeof r == "object" && r !== null && r.$$typeof === D)
119
196
  return "<...>";
120
197
  try {
121
- var i = e(t);
122
- return i ? "<" + i + ">" : "<...>";
198
+ var l = e(r);
199
+ return l ? "<" + l + ">" : "<...>";
123
200
  } catch {
124
201
  return "<...>";
125
202
  }
126
203
  }
127
204
  function a() {
128
- var t = U.A;
129
- return t === null ? null : t.getOwner();
205
+ var r = U.A;
206
+ return r === null ? null : r.getOwner();
130
207
  }
131
- function c() {
208
+ function i() {
132
209
  return Error("react-stack-top-frame");
133
210
  }
134
- function d(t) {
135
- if (q.call(t, "key")) {
136
- var i = Object.getOwnPropertyDescriptor(t, "key").get;
137
- if (i && i.isReactWarning) return !1;
211
+ function u(r) {
212
+ if (Q.call(r, "key")) {
213
+ var l = Object.getOwnPropertyDescriptor(r, "key").get;
214
+ if (l && l.isReactWarning) return !1;
138
215
  }
139
- return t.key !== void 0;
216
+ return r.key !== void 0;
140
217
  }
141
- function p(t, i) {
142
- function g() {
143
- K || (K = !0, console.error(
218
+ function p(r, l) {
219
+ function h() {
220
+ f || (f = !0, console.error(
144
221
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
145
- i
222
+ l
146
223
  ));
147
224
  }
148
- g.isReactWarning = !0, Object.defineProperty(t, "key", {
149
- get: g,
225
+ h.isReactWarning = !0, Object.defineProperty(r, "key", {
226
+ get: h,
150
227
  configurable: !0
151
228
  });
152
229
  }
153
230
  function m() {
154
- var t = e(this.type);
155
- return B[t] || (B[t] = !0, console.error(
231
+ var r = e(this.type);
232
+ return E[r] || (E[r] = !0, console.error(
156
233
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
157
- )), t = this.props.ref, t !== void 0 ? t : null;
234
+ )), r = this.props.ref, r !== void 0 ? r : null;
158
235
  }
159
- function x(t, i, g, h, G, S) {
160
- var _ = g.ref;
161
- return t = {
236
+ function x(r, l, h, g, C, V) {
237
+ var b = h.ref;
238
+ return r = {
162
239
  $$typeof: w,
163
- type: t,
164
- key: i,
165
- props: g,
166
- _owner: h
167
- }, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(t, "ref", {
240
+ type: r,
241
+ key: l,
242
+ props: h,
243
+ _owner: g
244
+ }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(r, "ref", {
168
245
  enumerable: !1,
169
246
  get: m
170
- }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
247
+ }) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
171
248
  configurable: !1,
172
249
  enumerable: !1,
173
250
  writable: !0,
174
251
  value: 0
175
- }), Object.defineProperty(t, "_debugInfo", {
252
+ }), Object.defineProperty(r, "_debugInfo", {
176
253
  configurable: !1,
177
254
  enumerable: !1,
178
255
  writable: !0,
179
256
  value: null
180
- }), Object.defineProperty(t, "_debugStack", {
257
+ }), Object.defineProperty(r, "_debugStack", {
181
258
  configurable: !1,
182
259
  enumerable: !1,
183
260
  writable: !0,
184
- value: G
185
- }), Object.defineProperty(t, "_debugTask", {
261
+ value: C
262
+ }), Object.defineProperty(r, "_debugTask", {
186
263
  configurable: !1,
187
264
  enumerable: !1,
188
265
  writable: !0,
189
- value: S
190
- }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
266
+ value: V
267
+ }), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
191
268
  }
192
- function b(t, i, g, h, G, S) {
193
- var _ = i.children;
194
- if (_ !== void 0)
195
- if (h)
196
- if (te(_)) {
197
- for (h = 0; h < _.length; h++)
198
- l(_[h]);
199
- Object.freeze && Object.freeze(_);
269
+ function v(r, l, h, g, C, V) {
270
+ var b = l.children;
271
+ if (b !== void 0)
272
+ if (g)
273
+ if (te(b)) {
274
+ for (g = 0; g < b.length; g++)
275
+ c(b[g]);
276
+ Object.freeze && Object.freeze(b);
200
277
  } else
201
278
  console.error(
202
279
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
203
280
  );
204
- else l(_);
205
- if (q.call(i, "key")) {
206
- _ = e(t);
207
- var L = Object.keys(i).filter(function(be) {
208
- return be !== "key";
281
+ else c(b);
282
+ if (Q.call(l, "key")) {
283
+ b = e(r);
284
+ var Y = Object.keys(l).filter(function(ve) {
285
+ return ve !== "key";
209
286
  });
210
- h = 0 < L.length ? "{key: someKey, " + L.join(": ..., ") + ": ...}" : "{key: someKey}", J[_ + h] || (L = 0 < L.length ? "{" + L.join(": ..., ") + ": ...}" : "{}", console.error(
287
+ g = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", q[b + g] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
211
288
  `A props object containing a "key" prop is being spread into JSX:
212
289
  let props = %s;
213
290
  <%s {...props} />
214
291
  React keys must be passed directly to JSX without using spread:
215
292
  let props = %s;
216
293
  <%s key={someKey} {...props} />`,
217
- h,
218
- _,
219
- L,
220
- _
221
- ), J[_ + h] = !0);
294
+ g,
295
+ b,
296
+ Y,
297
+ b
298
+ ), q[b + g] = !0);
222
299
  }
223
- if (_ = null, g !== void 0 && (o(g), _ = "" + g), d(i) && (o(i.key), _ = "" + i.key), "key" in i) {
224
- g = {};
225
- for (var z in i)
226
- z !== "key" && (g[z] = i[z]);
227
- } else g = i;
228
- return _ && p(
229
- g,
230
- typeof t == "function" ? t.displayName || t.name || "Unknown" : t
300
+ if (b = null, h !== void 0 && (o(h), b = "" + h), u(l) && (o(l.key), b = "" + l.key), "key" in l) {
301
+ h = {};
302
+ for (var re in l)
303
+ re !== "key" && (h[re] = l[re]);
304
+ } else h = l;
305
+ return b && p(
306
+ h,
307
+ typeof r == "function" ? r.displayName || r.name || "Unknown" : r
231
308
  ), x(
232
- t,
233
- _,
234
- g,
309
+ r,
310
+ b,
311
+ h,
235
312
  a(),
236
- G,
237
- S
313
+ C,
314
+ V
238
315
  );
239
316
  }
240
- function l(t) {
241
- f(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === Y && (t._payload.status === "fulfilled" ? f(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
317
+ function c(r) {
318
+ d(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === D && (r._payload.status === "fulfilled" ? d(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
242
319
  }
243
- function f(t) {
244
- return typeof t == "object" && t !== null && t.$$typeof === w;
320
+ function d(r) {
321
+ return typeof r == "object" && r !== null && r.$$typeof === w;
245
322
  }
246
- var T = _e, w = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), j = Symbol.for("react.consumer"), P = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), W = Symbol.for("react.activity"), Q = Symbol.for("react.client.reference"), U = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, q = Object.prototype.hasOwnProperty, te = Array.isArray, V = console.createTask ? console.createTask : function() {
323
+ var T = xe, w = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), M = Symbol.for("react.profiler"), j = Symbol.for("react.consumer"), P = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), z = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), U = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Q = Object.prototype.hasOwnProperty, te = Array.isArray, F = console.createTask ? console.createTask : function() {
247
324
  return null;
248
325
  };
249
326
  T = {
250
- react_stack_bottom_frame: function(t) {
251
- return t();
327
+ react_stack_bottom_frame: function(r) {
328
+ return r();
252
329
  }
253
330
  };
254
- var K, B = {}, u = T.react_stack_bottom_frame.bind(
331
+ var f, E = {}, G = T.react_stack_bottom_frame.bind(
255
332
  T,
256
- c
257
- )(), E = V(n(c)), J = {};
258
- H.Fragment = k, H.jsx = function(t, i, g) {
259
- var h = 1e4 > U.recentlyCreatedOwnerStacks++;
260
- return b(
261
- t,
262
- i,
263
- g,
333
+ i
334
+ )(), W = F(n(i)), q = {};
335
+ J.Fragment = k, J.jsx = function(r, l, h) {
336
+ var g = 1e4 > U.recentlyCreatedOwnerStacks++;
337
+ return v(
338
+ r,
339
+ l,
340
+ h,
264
341
  !1,
265
- h ? Error("react-stack-top-frame") : u,
266
- h ? V(n(t)) : E
342
+ g ? Error("react-stack-top-frame") : G,
343
+ g ? F(n(r)) : W
267
344
  );
268
- }, H.jsxs = function(t, i, g) {
269
- var h = 1e4 > U.recentlyCreatedOwnerStacks++;
270
- return b(
271
- t,
272
- i,
273
- g,
345
+ }, J.jsxs = function(r, l, h) {
346
+ var g = 1e4 > U.recentlyCreatedOwnerStacks++;
347
+ return v(
348
+ r,
349
+ l,
350
+ h,
274
351
  !0,
275
- h ? Error("react-stack-top-frame") : u,
276
- h ? V(n(t)) : E
352
+ g ? Error("react-stack-top-frame") : G,
353
+ g ? F(n(r)) : W
277
354
  );
278
355
  };
279
- })()), H;
356
+ })()), J;
280
357
  }
281
- var fe;
282
- function je() {
283
- return fe || (fe = 1, process.env.NODE_ENV === "production" ? ee.exports = Te() : ee.exports = ke()), ee.exports;
358
+ var pe;
359
+ function Ye() {
360
+ return pe || (pe = 1, process.env.NODE_ENV === "production" ? ee.exports = ze() : ee.exports = Fe()), ee.exports;
284
361
  }
285
- var s = je();
286
- function Pe(e, r) {
287
- e.src = r;
362
+ var s = Ye();
363
+ function O(...e) {
364
+ return we(e);
288
365
  }
289
- const Re = (e) => {
290
- var r, o, n, a = "The Google Maps JavaScript API", c = "google", d = "importLibrary", p = "__ib__", m = document, x = window, b = x[c] || (x[c] = {}), l = b.maps || (b.maps = {}), f = /* @__PURE__ */ new Set(), T = new URLSearchParams(), w = () => r || (r = new Promise(async (v, k) => {
291
- await (o = m.createElement("script")), T.set("libraries", [...f] + "");
292
- for (n in e)
293
- T.set(n.replace(/[A-Z]/g, (y) => "_" + y[0].toLowerCase()), e[n]);
294
- T.set("callback", c + ".maps." + p), Pe(o, "https://maps.googleapis.com/maps/api/js?" + T), l[p] = v, o.onerror = () => r = k(Error(a + " could not load.")), o.nonce = m.querySelector("script[nonce]")?.nonce || "", m.head.append(o);
295
- }));
296
- l[d] ? console.warn(a + " only loads once. Ignoring:", e) : l[d] = (v, ...k) => f.add(v) && w().then(() => l[d](v, ...k));
297
- }, Ne = (e) => `The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(e)}) will be ignored.`, Ae = (e) => `The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(e)}) will be ignored.`, Oe = "No options were set before calling importLibrary. Make sure to configure the loader using setOptions().", Se = "There already is a script loading the Google Maps JavaScript API, and no google.maps.importLibrary function is defined. @googlemaps/js-api-loader will proceed to bootstrap the API with the specified options, but the existing script might cause problems using the API. Make sure to remove the script loading the API.", ge = process.env.NODE_ENV !== "production", le = ge ? (e) => {
298
- console.warn(`[@googlemaps/js-api-loader] ${e}`);
299
- } : () => {
300
- }, Ie = ge ? (e) => {
301
- console.info(`[@googlemaps/js-api-loader] ${e}`);
302
- } : () => {
303
- }, Me = process.env.NODE_ENV !== "production";
304
- let ae = !1;
305
- function De(e) {
306
- if (ae) {
307
- le(Ne(e));
308
- return;
309
- }
310
- Ce(e), ae = !0;
311
- }
312
- async function Le(e) {
313
- if (ae || le(Oe), !window?.google?.maps?.importLibrary)
314
- throw new Error("google.maps.importLibrary is not installed.");
315
- return await google.maps.importLibrary(e);
316
- }
317
- function Ce(e) {
318
- const r = !!window.google?.maps?.importLibrary;
319
- r ? Ie(Ae(e)) : Me && document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]') && le(Se), r || Re(e);
320
- }
321
- let re = null, me = null;
322
- const $e = (e) => {
323
- if (!e) {
324
- const r = new Error("useMapsLibrary: missing Google Maps API key");
325
- return console.error(r.message), Promise.reject(r);
326
- }
327
- return re ? me !== e && console.warn(
328
- "useMapsLibrary: ignoring attempt to re-initialize Google Maps with a different API key than the one already in use."
329
- ) : (me = e, De({
330
- key: e,
331
- v: "weekly"
332
- }), re = Le("core").then(() => {
333
- })), re;
334
- }, ze = (e, r) => {
335
- const [o, n] = I(!1);
336
- return $(() => {
337
- let a = !1;
338
- return $e(r).then(() => {
339
- a || n(!0);
340
- }).catch((c) => {
341
- console.error("Failed to init Google Maps JS", c);
342
- }), () => {
343
- a = !0;
344
- };
345
- }, [r]), o ? "loaded" : null;
346
- };
347
- function M(...e) {
348
- return ye(e);
349
- }
350
- function he(e) {
351
- const { className: r, type: o, ...n } = e;
366
+ function be(e) {
367
+ const { className: t, type: o, ...n } = e;
352
368
  return /* @__PURE__ */ s.jsx(
353
369
  "input",
354
370
  {
355
371
  type: o,
356
- className: M(
372
+ className: O(
357
373
  "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
358
- r
374
+ t
359
375
  ),
360
376
  ...n
361
377
  }
362
378
  );
363
379
  }
364
- he.displayName = "Input";
365
- const Fe = /* @__PURE__ */ new Set([
380
+ be.displayName = "Input";
381
+ const Ue = /* @__PURE__ */ new Set([
366
382
  "street_address",
367
383
  "route",
368
384
  "premise",
@@ -392,161 +408,150 @@ const Fe = /* @__PURE__ */ new Set([
392
408
  "lodging",
393
409
  "train_station",
394
410
  "transit_station"
395
- ]), ce = (e) => (e.text?.text ?? "").replace(/, France$/, "").trim(), Ye = ({ prediction: e }) => {
396
- const r = ce(e), o = e.text?.text ?? "", n = e.text?.matches ?? [], a = r.length < o.length;
411
+ ]), ue = (e) => (e.text?.text ?? "").replace(/, France$/, "").trim(), Ge = ({ prediction: e }) => {
412
+ const t = ue(e), o = e.text?.text ?? "", n = e.text?.matches ?? [], a = t.length < o.length;
397
413
  if (n.length === 0)
398
- return /* @__PURE__ */ s.jsx(s.Fragment, { children: r });
399
- const c = [];
400
- let d = 0;
414
+ return /* @__PURE__ */ s.jsx(s.Fragment, { children: t });
415
+ const i = [];
416
+ let u = 0;
401
417
  return n.forEach((p, m) => {
402
- if (a && p.startOffset >= r.length)
418
+ if (a && p.startOffset >= t.length)
403
419
  return;
404
- const x = p.startOffset, b = Math.min(p.endOffset, r.length);
405
- if (x > d && c.push(r.substring(d, x)), b > x) {
406
- const l = r.substring(x, b);
407
- c.push(/* @__PURE__ */ s.jsx("strong", { children: l }, m));
420
+ const x = p.startOffset, v = Math.min(p.endOffset, t.length);
421
+ if (x > u && i.push(t.substring(u, x)), v > x) {
422
+ const c = t.substring(x, v);
423
+ i.push(/* @__PURE__ */ s.jsx("strong", { children: c }, m));
408
424
  }
409
- d = Math.max(d, b);
410
- }), d < r.length && c.push(r.substring(d)), c.length === 0 ? /* @__PURE__ */ s.jsx(s.Fragment, { children: r }) : /* @__PURE__ */ s.jsx(s.Fragment, { children: c });
411
- }, Ue = (e, r) => !e.types || e.types.length === 0 || !r || r.size === 0 ? !0 : e.types.some((o) => r.has(o)), Ge = (e, r) => e.placeId || `${e.text?.text ?? "prediction"}-${r}`, We = (e) => {
412
- const r = /* @__PURE__ */ new Map();
425
+ u = Math.max(u, v);
426
+ }), u < t.length && i.push(t.substring(u)), i.length === 0 ? /* @__PURE__ */ s.jsx(s.Fragment, { children: t }) : /* @__PURE__ */ s.jsx(s.Fragment, { children: i });
427
+ }, We = (e, t) => !e.types || e.types.length === 0 || !t || t.size === 0 ? !0 : e.types.some((o) => t.has(o)), qe = (e, t) => e.placeId || `${e.text?.text ?? "prediction"}-${t}`, Ve = (e) => {
428
+ const t = /* @__PURE__ */ new Map();
413
429
  return e.forEach((o) => {
414
430
  const n = o.placeId;
415
- n && (r.has(n) || r.set(n, o));
416
- }), Array.from(r.values());
417
- }, qe = (e, r) => e.filter((o) => Ue(o, r)), Ve = (e) => e.sort((r, o) => {
418
- const n = r.distanceMeters ?? Number.POSITIVE_INFINITY, a = o.distanceMeters ?? Number.POSITIVE_INFINITY;
431
+ n && (t.has(n) || t.set(n, o));
432
+ }), Array.from(t.values());
433
+ }, Be = (e, t) => e.filter((o) => We(o, t)), Je = (e) => e.sort((t, o) => {
434
+ const n = t.distanceMeters ?? Number.POSITIVE_INFINITY, a = o.distanceMeters ?? Number.POSITIVE_INFINITY;
419
435
  return n - a;
420
- }), Be = (e, r) => Ve(qe(We(e), r)), Je = (e, r) => ce(e).toLowerCase() === r.trim().toLowerCase(), ft = ({
436
+ }), Xe = (e, t) => Je(Be(Ve(e), t)), He = (e, t) => ue(e).toLowerCase() === t.trim().toLowerCase(), pt = ({
421
437
  id: e,
422
- label: r,
438
+ label: t,
423
439
  placeholder: o,
424
440
  value: n,
425
441
  onValueChange: a,
426
- disabled: c,
427
- name: d,
442
+ disabled: i,
443
+ name: u,
428
444
  className: p,
429
445
  autofillShimName: m,
430
446
  googleMapsApiKey: x,
431
- locationRestriction: b,
432
- allowedTypes: l
447
+ locationRestriction: v,
448
+ allowedTypes: c
433
449
  }) => {
434
- const [f, T] = I(n ?? ""), [w, v] = I([]), [k, y] = I(!1), [D, j] = I(-1), P = C(null), A = C(null), O = C(!1), F = C(!1), R = C(null), Y = ze("places", x), [W, Q] = I(null), U = xe(() => {
435
- if (!l)
436
- return Fe;
437
- const u = /* @__PURE__ */ new Set();
438
- for (const E of l)
439
- u.add(E);
440
- return u;
441
- }, [l]);
450
+ const [d, T] = L(n ?? ""), [w, _] = L([]), [k, y] = L(!1), [M, j] = L(-1), P = I(null), A = I(null), S = I(!1), z = I(!1), R = I(null), D = $e("places", x), H = ye(() => {
451
+ if (!c)
452
+ return Ue;
453
+ const f = /* @__PURE__ */ new Set();
454
+ for (const E of c)
455
+ f.add(E);
456
+ return f;
457
+ }, [c]);
442
458
  $(() => {
443
- T(n ?? ""), F.current = !1;
459
+ T(n ?? ""), z.current = !1;
444
460
  }, [n]), $(() => {
445
- if (!Y || typeof google > "u" || !google.maps?.importLibrary)
446
- return;
447
- let u = !0;
448
- return google.maps.importLibrary("places").then((E) => {
449
- u && Q(E);
450
- }).catch(() => {
451
- u && (console.error("AddressAutocompleteInput: failed to load places library"), Q(null));
452
- }), () => {
453
- u = !1;
454
- };
455
- }, [Y]), $(() => {
456
- if (O.current) {
457
- O.current = !1;
461
+ if (S.current) {
462
+ S.current = !1;
458
463
  return;
459
464
  }
460
- let u = !0;
465
+ let f = !0;
461
466
  const E = setTimeout(() => {
462
- if (!u)
467
+ if (!f)
463
468
  return;
464
- if (f.trim() === "") {
465
- v([]), y(!1), R.current = null, n !== "" && a("");
469
+ if (d.trim() === "") {
470
+ _([]), y(!1), R.current = null, n !== "" && a("");
466
471
  return;
467
472
  }
468
- if (!W) return;
469
- const { AutocompleteSuggestion: t, AutocompleteSessionToken: i } = W;
470
- if (!t || !i) {
471
- console.error("AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports"), v([]), y(!1);
473
+ if (!D) return;
474
+ const { AutocompleteSuggestion: W, AutocompleteSessionToken: q } = D;
475
+ if (!W || !q) {
476
+ console.error("AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports"), _([]), y(!1);
472
477
  return;
473
478
  }
474
- R.current || (R.current = new i());
475
- const g = {
476
- input: f,
479
+ R.current || (R.current = new q());
480
+ const r = {
481
+ input: d,
477
482
  sessionToken: R.current ?? void 0,
478
- locationRestriction: b,
483
+ locationRestriction: v,
479
484
  includedRegionCodes: ["fr"]
480
485
  };
481
- t.fetchAutocompleteSuggestions(g).then((h) => {
482
- if (!u)
486
+ W.fetchAutocompleteSuggestions(r).then((l) => {
487
+ if (!f)
483
488
  return;
484
- const G = h.suggestions.map((z) => z.placePrediction).filter((z) => !!z), S = Be(G, U), _ = S[0], L = _ && S.length === 1 && Je(_, f);
485
- if (!F.current && L) {
486
- v(S), y(!1);
489
+ const h = l.suggestions.map((b) => b.placePrediction).filter((b) => !!b), g = Xe(h, H), C = g[0], V = C && g.length === 1 && He(C, d);
490
+ if (!z.current && V) {
491
+ _(g), y(!1);
487
492
  return;
488
493
  }
489
- S.length > 0 ? (v(S), F.current && y(!0), j(-1)) : (v([]), y(!1));
490
- }).catch((h) => {
491
- u && (console.error("AddressAutocompleteInput: suggestion fetch failed", h), v([]), y(!1));
494
+ g.length > 0 ? (_(g), z.current && y(!0), j(-1)) : (_([]), y(!1));
495
+ }).catch((l) => {
496
+ f && (console.error("AddressAutocompleteInput: suggestion fetch failed", l), _([]), y(!1));
492
497
  });
493
498
  }, 300);
494
499
  return () => {
495
- u = !1, clearTimeout(E);
500
+ f = !1, clearTimeout(E);
496
501
  };
497
- }, [f, W, a, n, b, U]), $(() => {
498
- const u = (E) => {
502
+ }, [d, D, a, n, v, H]), $(() => {
503
+ const f = (E) => {
499
504
  P.current && !P.current.contains(E.target) && A.current && !A.current.contains(E.target) && y(!1);
500
505
  };
501
- return document.addEventListener("mousedown", u), () => {
502
- document.removeEventListener("mousedown", u);
506
+ return document.addEventListener("mousedown", f), () => {
507
+ document.removeEventListener("mousedown", f);
503
508
  };
504
509
  }, []);
505
- const q = (u) => {
506
- O.current = !0;
507
- const E = ce(u);
508
- T(E), a(E), v([]), y(!1), R.current = null;
509
- }, te = (u) => {
510
- F.current = !0, T(u.target.value);
511
- }, V = (u) => {
510
+ const Z = (f) => {
511
+ S.current = !0;
512
+ const E = ue(f);
513
+ T(E), a(E), _([]), y(!1), R.current = null;
514
+ }, U = (f) => {
515
+ z.current = !0, T(f.target.value);
516
+ }, Q = (f) => {
512
517
  if (!k || w.length === 0) {
513
- u.key === "Enter" && (u.preventDefault(), a(f), y(!1), R.current = null);
518
+ f.key === "Enter" && (f.preventDefault(), a(d), y(!1), R.current = null);
514
519
  return;
515
520
  }
516
- u.key === "ArrowDown" ? (u.preventDefault(), j((E) => (E + 1) % w.length)) : u.key === "ArrowUp" ? (u.preventDefault(), j((E) => (E - 1 + w.length) % w.length)) : u.key === "Enter" ? (u.preventDefault(), D > -1 && w[D] ? q(w[D]) : (a(f), y(!1), R.current = null)) : u.key === "Escape" && y(!1);
517
- }, K = () => {
518
- y(!1), n !== f && a(f), R.current = null;
519
- }, B = m ?? (d ? `${d}_shim` : void 0);
521
+ f.key === "ArrowDown" ? (f.preventDefault(), j((E) => (E + 1) % w.length)) : f.key === "ArrowUp" ? (f.preventDefault(), j((E) => (E - 1 + w.length) % w.length)) : f.key === "Enter" ? (f.preventDefault(), M > -1 && w[M] ? Z(w[M]) : (a(d), y(!1), R.current = null)) : f.key === "Escape" && y(!1);
522
+ }, te = () => {
523
+ y(!1), n !== d && a(d), R.current = null;
524
+ }, F = m ?? (u ? `${u}_shim` : void 0);
520
525
  return /* @__PURE__ */ s.jsxs("div", { className: "relative", children: [
521
- B && /* @__PURE__ */ s.jsx(
526
+ F && /* @__PURE__ */ s.jsx(
522
527
  "input",
523
528
  {
524
529
  tabIndex: -1,
525
530
  autoComplete: "street-address",
526
- name: B,
531
+ name: F,
527
532
  "aria-hidden": "true",
528
533
  className: "pointer-events-none absolute left-0 top-0 h-0 w-0 opacity-0"
529
534
  }
530
535
  ),
531
- /* @__PURE__ */ s.jsx("label", { htmlFor: e, className: "text-left block text-sm font-medium text-gray-700 mb-1", children: r }),
536
+ /* @__PURE__ */ s.jsx("label", { htmlFor: e, className: "text-left block text-sm font-medium text-gray-700 mb-1", children: t }),
532
537
  /* @__PURE__ */ s.jsx(
533
- he,
538
+ be,
534
539
  {
535
540
  ref: P,
536
541
  id: e,
537
542
  type: "text",
538
543
  placeholder: o,
539
- name: d ?? `${e}_input`,
540
- value: f,
541
- onChange: te,
542
- onKeyDown: V,
544
+ name: u ?? `${e}_input`,
545
+ value: d,
546
+ onChange: U,
547
+ onKeyDown: Q,
543
548
  onFocus: () => {
544
- w.length > 0 && f && y(!0);
549
+ w.length > 0 && d && y(!0);
545
550
  },
546
- onBlur: K,
547
- disabled: c,
551
+ onBlur: te,
552
+ disabled: i,
548
553
  autoComplete: "off",
549
- className: M("w-full", p)
554
+ className: O("w-full", p)
550
555
  }
551
556
  ),
552
557
  k && w.length > 0 && /* @__PURE__ */ s.jsx(
@@ -554,34 +559,34 @@ const Fe = /* @__PURE__ */ new Set([
554
559
  {
555
560
  ref: A,
556
561
  className: "absolute z-10 w-full mt-1 bg-white border border-gray-200 rounded-md shadow-lg text-left",
557
- children: w.map((u, E) => /* @__PURE__ */ s.jsx(
562
+ children: w.map((f, E) => /* @__PURE__ */ s.jsx(
558
563
  "li",
559
564
  {
560
- className: ie(
565
+ className: le(
561
566
  "px-3 py-2 cursor-pointer text-sm text-gray-700 hover:bg-gray-100",
562
- { "bg-gray-100": D === E }
567
+ { "bg-gray-100": M === E }
563
568
  ),
564
- onMouseDown: (J) => {
565
- J.preventDefault(), q(u);
569
+ onMouseDown: (G) => {
570
+ G.preventDefault(), Z(f);
566
571
  },
567
- children: /* @__PURE__ */ s.jsx(Ye, { prediction: u })
572
+ children: /* @__PURE__ */ s.jsx(Ge, { prediction: f })
568
573
  },
569
- Ge(u, E)
574
+ qe(f, E)
570
575
  ))
571
576
  }
572
577
  )
573
578
  ] });
574
- }, mt = ({
579
+ }, gt = ({
575
580
  className: e,
576
- onClick: r,
581
+ onClick: t,
577
582
  children: o,
578
583
  ...n
579
584
  }) => /* @__PURE__ */ s.jsxs(
580
585
  "button",
581
586
  {
582
587
  type: "button",
583
- onClick: r,
584
- className: ie(
588
+ onClick: t,
589
+ className: le(
585
590
  "flex w-full items-center justify-center rounded-md border border-transparent bg-black py-2 text-white hover:bg-gray-800 focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 focus:outline-hidden",
586
591
  e
587
592
  ),
@@ -591,32 +596,32 @@ const Fe = /* @__PURE__ */ new Set([
591
596
  /* @__PURE__ */ s.jsx("svg", { fill: "currentColor", viewBox: "0 0 50 20", className: "h-5 w-auto", children: /* @__PURE__ */ s.jsx("path", { d: "M9.536 2.579c-.571.675-1.485 1.208-2.4 1.132-.113-.914.334-1.884.858-2.484C8.565.533 9.564.038 10.374 0c.095.951-.276 1.884-.838 2.579zm.829 1.313c-1.324-.077-2.457.751-3.085.751-.638 0-1.6-.713-2.647-.694-1.362.019-2.628.79-3.323 2.017-1.429 2.455-.372 6.09 1.009 8.087.676.99 1.485 2.075 2.552 2.036 1.009-.038 1.409-.656 2.628-.656 1.228 0 1.58.656 2.647.637 1.104-.019 1.8-.99 2.475-1.979.771-1.122 1.086-2.217 1.105-2.274-.02-.019-2.133-.828-2.152-3.263-.02-2.036 1.666-3.007 1.742-3.064-.952-1.408-2.437-1.56-2.951-1.598zm7.645-2.76v14.834h2.305v-5.072h3.19c2.913 0 4.96-1.998 4.96-4.89 0-2.893-2.01-4.872-4.885-4.872h-5.57zm2.305 1.941h2.656c2 0 3.142 1.066 3.142 2.94 0 1.875-1.142 2.95-3.151 2.95h-2.647v-5.89zM32.673 16.08c1.448 0 2.79-.733 3.4-1.893h.047v1.779h2.133V8.582c0-2.14-1.714-3.52-4.351-3.52-2.447 0-4.256 1.399-4.323 3.32h2.076c.171-.913 1.018-1.512 2.18-1.512 1.41 0 2.2.656 2.2 1.865v.818l-2.876.171c-2.675.162-4.123 1.256-4.123 3.159 0 1.922 1.495 3.197 3.637 3.197zm.62-1.76c-1.229 0-2.01-.59-2.01-1.494 0-.933.752-1.475 2.19-1.56l2.562-.162v.837c0 1.39-1.181 2.379-2.743 2.379zM41.1 20c2.247 0 3.304-.856 4.227-3.454l4.047-11.341h-2.342l-2.714 8.763h-.047l-2.714-8.763h-2.409l3.904 10.799-.21.656c-.352 1.114-.923 1.542-1.942 1.542-.18 0-.533-.02-.676-.038v1.779c.133.038.705.057.876.057z" }) })
592
597
  ]
593
598
  }
594
- ), Xe = {
599
+ ), Ze = {
595
600
  red: "checked:border-red-700 checked:bg-red-700 indeterminate:border-red-700 indeterminate:bg-red-700 focus-visible:outline-red-700",
596
601
  sky: "checked:border-sky-600 checked:bg-sky-600 indeterminate:border-sky-600 indeterminate:bg-sky-600 focus-visible:outline-sky-600"
597
- }, pt = ({
602
+ }, ht = ({
598
603
  id: e,
599
- name: r,
604
+ name: t,
600
605
  defaultValue: o,
601
606
  defaultChecked: n,
602
607
  checked: a,
603
- onChange: c,
604
- color: d = "sky",
608
+ onChange: i,
609
+ color: u = "sky",
605
610
  ...p
606
611
  }) => {
607
- const m = Xe[d];
612
+ const m = Ze[u];
608
613
  return /* @__PURE__ */ s.jsx("div", { className: "flex h-6 shrink-0 items-center", children: /* @__PURE__ */ s.jsxs("div", { className: "group grid size-4 grid-cols-1", children: [
609
614
  /* @__PURE__ */ s.jsx(
610
615
  "input",
611
616
  {
612
617
  ...p,
613
618
  id: e,
614
- name: r,
619
+ name: t,
615
620
  type: "checkbox",
616
621
  defaultValue: o,
617
622
  defaultChecked: n,
618
623
  checked: a,
619
- onChange: c,
624
+ onChange: i,
620
625
  className: `col-start-1 row-start-1 appearance-none cursor-pointer rounded-sm border border-gray-300 bg-white focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto ${m}`
621
626
  }
622
627
  ),
@@ -652,59 +657,59 @@ const Fe = /* @__PURE__ */ new Set([
652
657
  )
653
658
  ] }) });
654
659
  };
655
- function gt({
660
+ function bt({
656
661
  ...e
657
662
  }) {
658
663
  return /* @__PURE__ */ s.jsx(N.Root, { "data-slot": "dialog", ...e });
659
664
  }
660
- function ht({
665
+ function vt({
661
666
  ...e
662
667
  }) {
663
668
  return /* @__PURE__ */ s.jsx(N.Trigger, { "data-slot": "dialog-trigger", ...e });
664
669
  }
665
- function He({
670
+ function Qe({
666
671
  ...e
667
672
  }) {
668
673
  return /* @__PURE__ */ s.jsx(N.Portal, { "data-slot": "dialog-portal", ...e });
669
674
  }
670
- function bt({
675
+ function _t({
671
676
  ...e
672
677
  }) {
673
678
  return /* @__PURE__ */ s.jsx(N.Close, { "data-slot": "dialog-close", ...e });
674
679
  }
675
- function Ze({
680
+ function Ke({
676
681
  className: e,
677
- ...r
682
+ ...t
678
683
  }) {
679
684
  return /* @__PURE__ */ s.jsx(
680
685
  N.Overlay,
681
686
  {
682
687
  "data-slot": "dialog-overlay",
683
- className: M(
688
+ className: O(
684
689
  "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
685
690
  e
686
691
  ),
687
- ...r
692
+ ...t
688
693
  }
689
694
  );
690
695
  }
691
- const Qe = ve.forwardRef(({ className: e, children: r, showCloseButton: o = !0, showCloseButtonOutside: n = !1, ...a }, c) => /* @__PURE__ */ s.jsx(He, { "data-slot": "dialog-portal", children: /* @__PURE__ */ s.jsx(Ze, { children: /* @__PURE__ */ s.jsxs(
696
+ const et = _e.forwardRef(({ className: e, children: t, showCloseButton: o = !0, showCloseButtonOutside: n = !1, ...a }, i) => /* @__PURE__ */ s.jsx(Qe, { "data-slot": "dialog-portal", children: /* @__PURE__ */ s.jsx(Ke, { children: /* @__PURE__ */ s.jsxs(
692
697
  N.Content,
693
698
  {
694
- ref: c,
699
+ ref: i,
695
700
  "data-slot": "dialog-content",
696
- className: M(
701
+ className: O(
697
702
  "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
698
703
  e
699
704
  ),
700
705
  ...a,
701
706
  children: [
702
- r,
707
+ t,
703
708
  o && /* @__PURE__ */ s.jsxs(
704
709
  N.Close,
705
710
  {
706
711
  "data-slot": "dialog-close",
707
- className: M(
712
+ className: O(
708
713
  "absolute ring-offset-background focus:ring-ring transition-opacity focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
709
714
  n ? "-top-3 -right-3 z-[51] rounded-full border bg-background p-1 opacity-100 hover:bg-accent [&_svg]:size-5" : "top-4 right-4 rounded-xs opacity-70 hover:opacity-100 data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4"
710
715
  ),
@@ -717,126 +722,126 @@ const Qe = ve.forwardRef(({ className: e, children: r, showCloseButton: o = !0,
717
722
  ]
718
723
  }
719
724
  ) }) }));
720
- Qe.displayName = N.Content.displayName;
721
- function vt({ className: e, ...r }) {
725
+ et.displayName = N.Content.displayName;
726
+ function xt({ className: e, ...t }) {
722
727
  return /* @__PURE__ */ s.jsx(
723
728
  "div",
724
729
  {
725
730
  "data-slot": "dialog-header",
726
- className: M("flex flex-col gap-2 text-center sm:text-left", e),
727
- ...r
731
+ className: O("flex flex-col gap-2 text-center sm:text-left", e),
732
+ ...t
728
733
  }
729
734
  );
730
735
  }
731
- function _t({ className: e, ...r }) {
736
+ function yt({ className: e, ...t }) {
732
737
  return /* @__PURE__ */ s.jsx(
733
738
  "div",
734
739
  {
735
740
  "data-slot": "dialog-footer",
736
- className: M("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
737
- ...r
741
+ className: O("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
742
+ ...t
738
743
  }
739
744
  );
740
745
  }
741
- function xt({
746
+ function wt({
742
747
  className: e,
743
- ...r
748
+ ...t
744
749
  }) {
745
750
  return /* @__PURE__ */ s.jsx(
746
751
  N.Title,
747
752
  {
748
753
  "data-slot": "dialog-title",
749
- className: M("text-lg leading-none font-semibold", e),
750
- ...r
754
+ className: O("text-lg leading-none font-semibold", e),
755
+ ...t
751
756
  }
752
757
  );
753
758
  }
754
- function yt({
759
+ function Et({
755
760
  className: e,
756
- ...r
761
+ ...t
757
762
  }) {
758
763
  return /* @__PURE__ */ s.jsx(
759
764
  N.Description,
760
765
  {
761
766
  "data-slot": "dialog-description",
762
- className: M("text-muted-foreground text-sm", e),
763
- ...r
767
+ className: O("text-muted-foreground text-sm", e),
768
+ ...t
764
769
  }
765
770
  );
766
771
  }
767
- var Ke = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "#", "$", "%", "*", "+", ",", "-", ".", ":", ";", "=", "?", "@", "[", "]", "^", "_", "{", "|", "}", "~"], Z = (e) => {
768
- let r = 0;
772
+ var tt = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "#", "$", "%", "*", "+", ",", "-", ".", ":", ";", "=", "?", "@", "[", "]", "^", "_", "{", "|", "}", "~"], X = (e) => {
773
+ let t = 0;
769
774
  for (let o = 0; o < e.length; o++) {
770
- let n = e[o], a = Ke.indexOf(n);
771
- r = r * 83 + a;
775
+ let n = e[o], a = tt.indexOf(n);
776
+ t = t * 83 + a;
772
777
  }
773
- return r;
774
- }, oe = (e) => {
775
- let r = e / 255;
776
- return r <= 0.04045 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);
778
+ return t;
777
779
  }, ne = (e) => {
778
- let r = Math.max(0, Math.min(1, e));
779
- return r <= 31308e-7 ? Math.trunc(r * 12.92 * 255 + 0.5) : Math.trunc((1.055 * Math.pow(r, 0.4166666666666667) - 0.055) * 255 + 0.5);
780
- }, et = (e) => e < 0 ? -1 : 1, se = (e, r) => et(e) * Math.pow(Math.abs(e), r), pe = class extends Error {
780
+ let t = e / 255;
781
+ return t <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
782
+ }, se = (e) => {
783
+ let t = Math.max(0, Math.min(1, e));
784
+ return t <= 31308e-7 ? Math.trunc(t * 12.92 * 255 + 0.5) : Math.trunc((1.055 * Math.pow(t, 0.4166666666666667) - 0.055) * 255 + 0.5);
785
+ }, rt = (e) => e < 0 ? -1 : 1, ae = (e, t) => rt(e) * Math.pow(Math.abs(e), t), ge = class extends Error {
781
786
  constructor(e) {
782
787
  super(e), this.name = "ValidationError", this.message = e;
783
788
  }
784
- }, tt = (e) => {
785
- if (!e || e.length < 6) throw new pe("The blurhash string must be at least 6 characters");
786
- let r = Z(e[0]), o = Math.floor(r / 9) + 1, n = r % 9 + 1;
787
- if (e.length !== 4 + 2 * n * o) throw new pe(`blurhash length mismatch: length is ${e.length} but it should be ${4 + 2 * n * o}`);
788
- }, rt = (e) => {
789
- let r = e >> 16, o = e >> 8 & 255, n = e & 255;
790
- return [oe(r), oe(o), oe(n)];
791
- }, ot = (e, r) => {
789
+ }, ot = (e) => {
790
+ if (!e || e.length < 6) throw new ge("The blurhash string must be at least 6 characters");
791
+ let t = X(e[0]), o = Math.floor(t / 9) + 1, n = t % 9 + 1;
792
+ if (e.length !== 4 + 2 * n * o) throw new ge(`blurhash length mismatch: length is ${e.length} but it should be ${4 + 2 * n * o}`);
793
+ }, nt = (e) => {
794
+ let t = e >> 16, o = e >> 8 & 255, n = e & 255;
795
+ return [ne(t), ne(o), ne(n)];
796
+ }, st = (e, t) => {
792
797
  let o = Math.floor(e / 361), n = Math.floor(e / 19) % 19, a = e % 19;
793
- return [se((o - 9) / 9, 2) * r, se((n - 9) / 9, 2) * r, se((a - 9) / 9, 2) * r];
794
- }, nt = (e, r, o, n) => {
795
- tt(e), n = n | 1;
796
- let a = Z(e[0]), c = Math.floor(a / 9) + 1, d = a % 9 + 1, p = (Z(e[1]) + 1) / 166, m = new Array(d * c);
797
- for (let l = 0; l < m.length; l++) if (l === 0) {
798
- let f = Z(e.substring(2, 6));
799
- m[l] = rt(f);
798
+ return [ae((o - 9) / 9, 2) * t, ae((n - 9) / 9, 2) * t, ae((a - 9) / 9, 2) * t];
799
+ }, at = (e, t, o, n) => {
800
+ ot(e), n = n | 1;
801
+ let a = X(e[0]), i = Math.floor(a / 9) + 1, u = a % 9 + 1, p = (X(e[1]) + 1) / 166, m = new Array(u * i);
802
+ for (let c = 0; c < m.length; c++) if (c === 0) {
803
+ let d = X(e.substring(2, 6));
804
+ m[c] = nt(d);
800
805
  } else {
801
- let f = Z(e.substring(4 + l * 2, 6 + l * 2));
802
- m[l] = ot(f, p * n);
806
+ let d = X(e.substring(4 + c * 2, 6 + c * 2));
807
+ m[c] = st(d, p * n);
803
808
  }
804
- let x = r * 4, b = new Uint8ClampedArray(x * o);
805
- for (let l = 0; l < o; l++) for (let f = 0; f < r; f++) {
806
- let T = 0, w = 0, v = 0;
807
- for (let j = 0; j < c; j++) for (let P = 0; P < d; P++) {
808
- let A = Math.cos(Math.PI * f * P / r) * Math.cos(Math.PI * l * j / o), O = m[P + j * d];
809
- T += O[0] * A, w += O[1] * A, v += O[2] * A;
809
+ let x = t * 4, v = new Uint8ClampedArray(x * o);
810
+ for (let c = 0; c < o; c++) for (let d = 0; d < t; d++) {
811
+ let T = 0, w = 0, _ = 0;
812
+ for (let j = 0; j < i; j++) for (let P = 0; P < u; P++) {
813
+ let A = Math.cos(Math.PI * d * P / t) * Math.cos(Math.PI * c * j / o), S = m[P + j * u];
814
+ T += S[0] * A, w += S[1] * A, _ += S[2] * A;
810
815
  }
811
- let k = ne(T), y = ne(w), D = ne(v);
812
- b[4 * f + 0 + l * x] = k, b[4 * f + 1 + l * x] = y, b[4 * f + 2 + l * x] = D, b[4 * f + 3 + l * x] = 255;
816
+ let k = se(T), y = se(w), M = se(_);
817
+ v[4 * d + 0 + c * x] = k, v[4 * d + 1 + c * x] = y, v[4 * d + 2 + c * x] = M, v[4 * d + 3 + c * x] = 255;
813
818
  }
814
- return b;
815
- }, st = nt;
816
- const Et = ({
819
+ return v;
820
+ }, it = at;
821
+ const Tt = ({
817
822
  src: e,
818
- hash: r,
823
+ hash: t,
819
824
  alt: o = "",
820
825
  className: n
821
826
  }) => {
822
- const [a, c] = I(!1), [d, p] = I(null), m = C(null);
827
+ const [a, i] = L(!1), [u, p] = L(null), m = I(null);
823
828
  $(() => {
824
- if (!r) return;
825
- const [l, f, T] = r, w = st(T, l, f), v = document.createElement("canvas"), k = v.getContext("2d");
829
+ if (!t) return;
830
+ const [c, d, T] = t, w = it(T, c, d), _ = document.createElement("canvas"), k = _.getContext("2d");
826
831
  if (k) {
827
- v.width = l, v.height = f;
832
+ _.width = c, _.height = d;
828
833
  const y = new ImageData(
829
834
  new Uint8ClampedArray(w),
830
- l,
831
- f
835
+ c,
836
+ d
832
837
  );
833
- k.putImageData(y, 0, 0), p(v.toDataURL());
838
+ k.putImageData(y, 0, 0), p(_.toDataURL());
834
839
  }
835
- }, [r]), $(() => {
836
- m.current && m.current.complete && c(!0);
840
+ }, [t]), $(() => {
841
+ m.current && m.current.complete && i(!0);
837
842
  }, [e]);
838
843
  const x = () => {
839
- }, b = () => {
844
+ }, v = () => {
840
845
  };
841
846
  return /* @__PURE__ */ s.jsxs(
842
847
  "div",
@@ -844,12 +849,12 @@ const Et = ({
844
849
  style: { position: "relative", overflow: "hidden" },
845
850
  className: n,
846
851
  onMouseEnter: x,
847
- onMouseLeave: b,
852
+ onMouseLeave: v,
848
853
  children: [
849
- d && !a && /* @__PURE__ */ s.jsx(
854
+ u && !a && /* @__PURE__ */ s.jsx(
850
855
  "img",
851
856
  {
852
- src: d,
857
+ src: u,
853
858
  style: {
854
859
  position: "absolute",
855
860
  top: 0,
@@ -876,25 +881,25 @@ const Et = ({
876
881
  left: 0
877
882
  },
878
883
  onLoad: () => {
879
- c(!0);
884
+ i(!0);
880
885
  },
881
- onError: (l) => console.error("Image failed to load:", e, l)
886
+ onError: (c) => console.error("Image failed to load:", e, c)
882
887
  }
883
888
  )
884
889
  ]
885
890
  }
886
891
  );
887
- }, at = ({
892
+ }, lt = ({
888
893
  href: e,
889
- labelClassName: r,
894
+ labelClassName: t,
890
895
  labelActiveClassName: o,
891
896
  labelElement: n,
892
897
  isActive: a,
893
- children: c
898
+ children: i
894
899
  }) => {
895
- const [d, p] = I(!1), m = C(null), x = C(null), b = () => {
900
+ const [u, p] = L(!1), m = I(null), x = I(null), v = () => {
896
901
  m.current && clearTimeout(m.current), p(!0);
897
- }, l = () => {
902
+ }, c = () => {
898
903
  m.current = setTimeout(() => {
899
904
  p(!1);
900
905
  }, 120);
@@ -906,25 +911,25 @@ const Et = ({
906
911
  {
907
912
  className: "flex",
908
913
  ref: x,
909
- onMouseEnter: b,
910
- onMouseLeave: l,
914
+ onMouseEnter: v,
915
+ onMouseLeave: c,
911
916
  children: [
912
917
  /* @__PURE__ */ s.jsx("div", { className: "relative flex", children: /* @__PURE__ */ s.jsx(
913
- we,
918
+ Te,
914
919
  {
915
920
  to: e,
916
921
  onClick: () => {
917
922
  p(!1);
918
923
  },
919
- className: ie(
924
+ className: le(
920
925
  "relative z-10 -mb-px flex items-center border-b-2 pt-px text-sm font-medium text-gray-700 cursor-pointer transition-colors duration-200 ease-out hover:text-gray-800",
921
- r,
922
- d || a ? o : "border-transparent"
926
+ t,
927
+ u || a ? o : "border-transparent"
923
928
  ),
924
929
  children: n
925
930
  }
926
931
  ) }),
927
- d && /* @__PURE__ */ s.jsxs(
932
+ u && /* @__PURE__ */ s.jsxs(
928
933
  "div",
929
934
  {
930
935
  className: "absolute left-0 right-0 top-full z-20 text-gray-500 sm:text-sm",
@@ -937,32 +942,33 @@ const Et = ({
937
942
  className: "absolute inset-0 top-1/2 bg-white shadow-sm"
938
943
  }
939
944
  ),
940
- /* @__PURE__ */ s.jsx("div", { className: "relative bg-white", children: c({ setIsOpen: p }) })
945
+ /* @__PURE__ */ s.jsx("div", { className: "relative bg-white", children: i({ setIsOpen: p }) })
941
946
  ]
942
947
  }
943
948
  )
944
949
  ]
945
950
  }
946
951
  );
947
- }, wt = {
948
- MenuPopover: at
952
+ }, kt = {
953
+ MenuPopover: lt
949
954
  };
950
955
  export {
951
- ft as AddressAutocompleteInput,
952
- mt as ApplePayButton,
953
- pt as Checkbox,
954
- gt as Dialog,
955
- bt as DialogClose,
956
- Qe as DialogContent,
957
- yt as DialogDescription,
958
- _t as DialogFooter,
959
- vt as DialogHeader,
960
- Ze as DialogOverlay,
961
- He as DialogPortal,
962
- xt as DialogTitle,
963
- ht as DialogTrigger,
964
- wt as Header,
965
- Et as Image,
966
- he as Input,
967
- dt as isMobileDevice
956
+ pt as AddressAutocompleteInput,
957
+ gt as ApplePayButton,
958
+ ht as Checkbox,
959
+ bt as Dialog,
960
+ _t as DialogClose,
961
+ et as DialogContent,
962
+ Et as DialogDescription,
963
+ yt as DialogFooter,
964
+ xt as DialogHeader,
965
+ Ke as DialogOverlay,
966
+ Qe as DialogPortal,
967
+ wt as DialogTitle,
968
+ vt as DialogTrigger,
969
+ kt as Header,
970
+ Tt as Image,
971
+ be as Input,
972
+ mt as isMobileDevice,
973
+ $e as useMapsLibrary
968
974
  };