@cal.macconnachie/web-components 0.0.9 → 0.0.10

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,190 +1,190 @@
1
- const Y = globalThis, X = Y.ShadowRoot && (Y.ShadyCSS === void 0 || Y.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, tt = Symbol(), nt = /* @__PURE__ */ new WeakMap();
2
- let vt = class {
3
- constructor(t, s, i) {
4
- if (this._$cssResult$ = !0, i !== tt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
5
- this.cssText = t, this.t = s;
1
+ const ve = globalThis, Je = ve.ShadowRoot && (ve.ShadyCSS === void 0 || ve.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ge = Symbol(), pt = /* @__PURE__ */ new WeakMap();
2
+ let zt = class {
3
+ constructor(e, s, r) {
4
+ if (this._$cssResult$ = !0, r !== Ge) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
5
+ this.cssText = e, this.t = s;
6
6
  }
7
7
  get styleSheet() {
8
- let t = this.o;
8
+ let e = this.o;
9
9
  const s = this.t;
10
- if (X && t === void 0) {
11
- const i = s !== void 0 && s.length === 1;
12
- i && (t = nt.get(s)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && nt.set(s, t));
10
+ if (Je && e === void 0) {
11
+ const r = s !== void 0 && s.length === 1;
12
+ r && (e = pt.get(s)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), r && pt.set(s, e));
13
13
  }
14
- return t;
14
+ return e;
15
15
  }
16
16
  toString() {
17
17
  return this.cssText;
18
18
  }
19
19
  };
20
- const Ot = (e) => new vt(typeof e == "string" ? e : e + "", void 0, tt), At = (e, ...t) => {
21
- const s = e.length === 1 ? e[0] : t.reduce(((i, r, o) => i + ((a) => {
22
- if (a._$cssResult$ === !0) return a.cssText;
23
- if (typeof a == "number") return a;
24
- throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
25
- })(r) + e[o + 1]), e[0]);
26
- return new vt(s, e, tt);
27
- }, Dt = (e, t) => {
28
- if (X) e.adoptedStyleSheets = t.map(((s) => s instanceof CSSStyleSheet ? s : s.styleSheet));
29
- else for (const s of t) {
30
- const i = document.createElement("style"), r = Y.litNonce;
31
- r !== void 0 && i.setAttribute("nonce", r), i.textContent = s.cssText, e.appendChild(i);
32
- }
33
- }, lt = X ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
20
+ const Ts = (t) => new zt(typeof t == "string" ? t : t + "", void 0, Ge), Kt = (t, ...e) => {
21
+ const s = t.length === 1 ? t[0] : e.reduce(((r, i, o) => r + ((n) => {
22
+ if (n._$cssResult$ === !0) return n.cssText;
23
+ if (typeof n == "number") return n;
24
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
25
+ })(i) + t[o + 1]), t[0]);
26
+ return new zt(s, t, Ge);
27
+ }, ks = (t, e) => {
28
+ if (Je) t.adoptedStyleSheets = e.map(((s) => s instanceof CSSStyleSheet ? s : s.styleSheet));
29
+ else for (const s of e) {
30
+ const r = document.createElement("style"), i = ve.litNonce;
31
+ i !== void 0 && r.setAttribute("nonce", i), r.textContent = s.cssText, t.appendChild(r);
32
+ }
33
+ }, ft = Je ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
34
34
  let s = "";
35
- for (const i of t.cssRules) s += i.cssText;
36
- return Ot(s);
37
- })(e) : e;
38
- const { is: Ut, defineProperty: Rt, getOwnPropertyDescriptor: It, getOwnPropertyNames: Nt, getOwnPropertySymbols: Lt, getPrototypeOf: Mt } = Object, W = globalThis, ht = W.trustedTypes, Ht = ht ? ht.emptyScript : "", zt = W.reactiveElementPolyfillSupport, j = (e, t) => e, V = { toAttribute(e, t) {
39
- switch (t) {
35
+ for (const r of e.cssRules) s += r.cssText;
36
+ return Ts(s);
37
+ })(t) : t;
38
+ const { is: Cs, defineProperty: Os, getOwnPropertyDescriptor: xs, getOwnPropertyNames: Rs, getOwnPropertySymbols: Ps, getPrototypeOf: Ds } = Object, xe = globalThis, mt = xe.trustedTypes, Us = mt ? mt.emptyScript : "", Ns = xe.reactiveElementPolyfillSupport, de = (t, e) => t, ke = { toAttribute(t, e) {
39
+ switch (e) {
40
40
  case Boolean:
41
- e = e ? Ht : null;
41
+ t = t ? Us : null;
42
42
  break;
43
43
  case Object:
44
44
  case Array:
45
- e = e == null ? e : JSON.stringify(e);
45
+ t = t == null ? t : JSON.stringify(t);
46
46
  }
47
- return e;
48
- }, fromAttribute(e, t) {
49
- let s = e;
50
- switch (t) {
47
+ return t;
48
+ }, fromAttribute(t, e) {
49
+ let s = t;
50
+ switch (e) {
51
51
  case Boolean:
52
- s = e !== null;
52
+ s = t !== null;
53
53
  break;
54
54
  case Number:
55
- s = e === null ? null : Number(e);
55
+ s = t === null ? null : Number(t);
56
56
  break;
57
57
  case Object:
58
58
  case Array:
59
59
  try {
60
- s = JSON.parse(e);
60
+ s = JSON.parse(t);
61
61
  } catch {
62
62
  s = null;
63
63
  }
64
64
  }
65
65
  return s;
66
- } }, et = (e, t) => !Ut(e, t), ct = { attribute: !0, type: String, converter: V, reflect: !1, useDefault: !1, hasChanged: et };
67
- Symbol.metadata ??= Symbol("metadata"), W.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
- let R = class extends HTMLElement {
69
- static addInitializer(t) {
70
- this._$Ei(), (this.l ??= []).push(t);
66
+ } }, Ze = (t, e) => !Cs(t, e), gt = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: Ze };
67
+ Symbol.metadata ??= Symbol("metadata"), xe.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
+ let Q = class extends HTMLElement {
69
+ static addInitializer(e) {
70
+ this._$Ei(), (this.l ??= []).push(e);
71
71
  }
72
72
  static get observedAttributes() {
73
73
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
74
74
  }
75
- static createProperty(t, s = ct) {
76
- if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(t, s), !s.noAccessor) {
77
- const i = Symbol(), r = this.getPropertyDescriptor(t, i, s);
78
- r !== void 0 && Rt(this.prototype, t, r);
75
+ static createProperty(e, s = gt) {
76
+ if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(e, s), !s.noAccessor) {
77
+ const r = Symbol(), i = this.getPropertyDescriptor(e, r, s);
78
+ i !== void 0 && Os(this.prototype, e, i);
79
79
  }
80
80
  }
81
- static getPropertyDescriptor(t, s, i) {
82
- const { get: r, set: o } = It(this.prototype, t) ?? { get() {
81
+ static getPropertyDescriptor(e, s, r) {
82
+ const { get: i, set: o } = xs(this.prototype, e) ?? { get() {
83
83
  return this[s];
84
- }, set(a) {
85
- this[s] = a;
84
+ }, set(n) {
85
+ this[s] = n;
86
86
  } };
87
- return { get: r, set(a) {
88
- const c = r?.call(this);
89
- o?.call(this, a), this.requestUpdate(t, c, i);
87
+ return { get: i, set(n) {
88
+ const a = i?.call(this);
89
+ o?.call(this, n), this.requestUpdate(e, a, r);
90
90
  }, configurable: !0, enumerable: !0 };
91
91
  }
92
- static getPropertyOptions(t) {
93
- return this.elementProperties.get(t) ?? ct;
92
+ static getPropertyOptions(e) {
93
+ return this.elementProperties.get(e) ?? gt;
94
94
  }
95
95
  static _$Ei() {
96
- if (this.hasOwnProperty(j("elementProperties"))) return;
97
- const t = Mt(this);
98
- t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
96
+ if (this.hasOwnProperty(de("elementProperties"))) return;
97
+ const e = Ds(this);
98
+ e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
99
99
  }
100
100
  static finalize() {
101
- if (this.hasOwnProperty(j("finalized"))) return;
102
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(j("properties"))) {
103
- const s = this.properties, i = [...Nt(s), ...Lt(s)];
104
- for (const r of i) this.createProperty(r, s[r]);
101
+ if (this.hasOwnProperty(de("finalized"))) return;
102
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(de("properties"))) {
103
+ const s = this.properties, r = [...Rs(s), ...Ps(s)];
104
+ for (const i of r) this.createProperty(i, s[i]);
105
105
  }
106
- const t = this[Symbol.metadata];
107
- if (t !== null) {
108
- const s = litPropertyMetadata.get(t);
109
- if (s !== void 0) for (const [i, r] of s) this.elementProperties.set(i, r);
106
+ const e = this[Symbol.metadata];
107
+ if (e !== null) {
108
+ const s = litPropertyMetadata.get(e);
109
+ if (s !== void 0) for (const [r, i] of s) this.elementProperties.set(r, i);
110
110
  }
111
111
  this._$Eh = /* @__PURE__ */ new Map();
112
- for (const [s, i] of this.elementProperties) {
113
- const r = this._$Eu(s, i);
114
- r !== void 0 && this._$Eh.set(r, s);
112
+ for (const [s, r] of this.elementProperties) {
113
+ const i = this._$Eu(s, r);
114
+ i !== void 0 && this._$Eh.set(i, s);
115
115
  }
116
116
  this.elementStyles = this.finalizeStyles(this.styles);
117
117
  }
118
- static finalizeStyles(t) {
118
+ static finalizeStyles(e) {
119
119
  const s = [];
120
- if (Array.isArray(t)) {
121
- const i = new Set(t.flat(1 / 0).reverse());
122
- for (const r of i) s.unshift(lt(r));
123
- } else t !== void 0 && s.push(lt(t));
120
+ if (Array.isArray(e)) {
121
+ const r = new Set(e.flat(1 / 0).reverse());
122
+ for (const i of r) s.unshift(ft(i));
123
+ } else e !== void 0 && s.push(ft(e));
124
124
  return s;
125
125
  }
126
- static _$Eu(t, s) {
127
- const i = s.attribute;
128
- return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
126
+ static _$Eu(e, s) {
127
+ const r = s.attribute;
128
+ return r === !1 ? void 0 : typeof r == "string" ? r : typeof e == "string" ? e.toLowerCase() : void 0;
129
129
  }
130
130
  constructor() {
131
131
  super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
132
132
  }
133
133
  _$Ev() {
134
- this._$ES = new Promise(((t) => this.enableUpdating = t)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t) => t(this)));
134
+ this._$ES = new Promise(((e) => this.enableUpdating = e)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((e) => e(this)));
135
135
  }
136
- addController(t) {
137
- (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
136
+ addController(e) {
137
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
138
138
  }
139
- removeController(t) {
140
- this._$EO?.delete(t);
139
+ removeController(e) {
140
+ this._$EO?.delete(e);
141
141
  }
142
142
  _$E_() {
143
- const t = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties;
144
- for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
145
- t.size > 0 && (this._$Ep = t);
143
+ const e = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties;
144
+ for (const r of s.keys()) this.hasOwnProperty(r) && (e.set(r, this[r]), delete this[r]);
145
+ e.size > 0 && (this._$Ep = e);
146
146
  }
147
147
  createRenderRoot() {
148
- const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
149
- return Dt(t, this.constructor.elementStyles), t;
148
+ const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
149
+ return ks(e, this.constructor.elementStyles), e;
150
150
  }
151
151
  connectedCallback() {
152
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
152
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((e) => e.hostConnected?.()));
153
153
  }
154
- enableUpdating(t) {
154
+ enableUpdating(e) {
155
155
  }
156
156
  disconnectedCallback() {
157
- this._$EO?.forEach(((t) => t.hostDisconnected?.()));
157
+ this._$EO?.forEach(((e) => e.hostDisconnected?.()));
158
158
  }
159
- attributeChangedCallback(t, s, i) {
160
- this._$AK(t, i);
159
+ attributeChangedCallback(e, s, r) {
160
+ this._$AK(e, r);
161
161
  }
162
- _$ET(t, s) {
163
- const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
164
- if (r !== void 0 && i.reflect === !0) {
165
- const o = (i.converter?.toAttribute !== void 0 ? i.converter : V).toAttribute(s, i.type);
166
- this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
162
+ _$ET(e, s) {
163
+ const r = this.constructor.elementProperties.get(e), i = this.constructor._$Eu(e, r);
164
+ if (i !== void 0 && r.reflect === !0) {
165
+ const o = (r.converter?.toAttribute !== void 0 ? r.converter : ke).toAttribute(s, r.type);
166
+ this._$Em = e, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
167
167
  }
168
168
  }
169
- _$AK(t, s) {
170
- const i = this.constructor, r = i._$Eh.get(t);
171
- if (r !== void 0 && this._$Em !== r) {
172
- const o = i.getPropertyOptions(r), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : V;
173
- this._$Em = r;
174
- const c = a.fromAttribute(s, o.type);
175
- this[r] = c ?? this._$Ej?.get(r) ?? c, this._$Em = null;
169
+ _$AK(e, s) {
170
+ const r = this.constructor, i = r._$Eh.get(e);
171
+ if (i !== void 0 && this._$Em !== i) {
172
+ const o = r.getPropertyOptions(i), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : ke;
173
+ this._$Em = i;
174
+ const a = n.fromAttribute(s, o.type);
175
+ this[i] = a ?? this._$Ej?.get(i) ?? a, this._$Em = null;
176
176
  }
177
177
  }
178
- requestUpdate(t, s, i) {
179
- if (t !== void 0) {
180
- const r = this.constructor, o = this[t];
181
- if (i ??= r.getPropertyOptions(t), !((i.hasChanged ?? et)(o, s) || i.useDefault && i.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(r._$Eu(t, i)))) return;
182
- this.C(t, s, i);
178
+ requestUpdate(e, s, r) {
179
+ if (e !== void 0) {
180
+ const i = this.constructor, o = this[e];
181
+ if (r ??= i.getPropertyOptions(e), !((r.hasChanged ?? Ze)(o, s) || r.useDefault && r.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(i._$Eu(e, r)))) return;
182
+ this.C(e, s, r);
183
183
  }
184
184
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
185
185
  }
186
- C(t, s, { useDefault: i, reflect: r, wrapped: o }, a) {
187
- i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, a ?? s ?? this[t]), o !== !0 || a !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (s = void 0), this._$AL.set(t, s)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
186
+ C(e, s, { useDefault: r, reflect: i, wrapped: o }, n) {
187
+ r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? s ?? this[e]), o !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || r || (s = void 0), this._$AL.set(e, s)), i === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
188
188
  }
189
189
  async _$EP() {
190
190
  this.isUpdatePending = !0;
@@ -193,8 +193,8 @@ let R = class extends HTMLElement {
193
193
  } catch (s) {
194
194
  Promise.reject(s);
195
195
  }
196
- const t = this.scheduleUpdate();
197
- return t != null && await t, !this.isUpdatePending;
196
+ const e = this.scheduleUpdate();
197
+ return e != null && await e, !this.isUpdatePending;
198
198
  }
199
199
  scheduleUpdate() {
200
200
  return this.performUpdate();
@@ -203,28 +203,28 @@ let R = class extends HTMLElement {
203
203
  if (!this.isUpdatePending) return;
204
204
  if (!this.hasUpdated) {
205
205
  if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
206
- for (const [r, o] of this._$Ep) this[r] = o;
206
+ for (const [i, o] of this._$Ep) this[i] = o;
207
207
  this._$Ep = void 0;
208
208
  }
209
- const i = this.constructor.elementProperties;
210
- if (i.size > 0) for (const [r, o] of i) {
211
- const { wrapped: a } = o, c = this[r];
212
- a !== !0 || this._$AL.has(r) || c === void 0 || this.C(r, void 0, o, c);
209
+ const r = this.constructor.elementProperties;
210
+ if (r.size > 0) for (const [i, o] of r) {
211
+ const { wrapped: n } = o, a = this[i];
212
+ n !== !0 || this._$AL.has(i) || a === void 0 || this.C(i, void 0, o, a);
213
213
  }
214
214
  }
215
- let t = !1;
215
+ let e = !1;
216
216
  const s = this._$AL;
217
217
  try {
218
- t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(((i) => i.hostUpdate?.())), this.update(s)) : this._$EM();
219
- } catch (i) {
220
- throw t = !1, this._$EM(), i;
218
+ e = this.shouldUpdate(s), e ? (this.willUpdate(s), this._$EO?.forEach(((r) => r.hostUpdate?.())), this.update(s)) : this._$EM();
219
+ } catch (r) {
220
+ throw e = !1, this._$EM(), r;
221
221
  }
222
- t && this._$AE(s);
222
+ e && this._$AE(s);
223
223
  }
224
- willUpdate(t) {
224
+ willUpdate(e) {
225
225
  }
226
- _$AE(t) {
227
- this._$EO?.forEach(((s) => s.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
226
+ _$AE(e) {
227
+ this._$EO?.forEach(((s) => s.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
228
228
  }
229
229
  _$EM() {
230
230
  this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
@@ -235,83 +235,83 @@ let R = class extends HTMLElement {
235
235
  getUpdateComplete() {
236
236
  return this._$ES;
237
237
  }
238
- shouldUpdate(t) {
238
+ shouldUpdate(e) {
239
239
  return !0;
240
240
  }
241
- update(t) {
241
+ update(e) {
242
242
  this._$Eq &&= this._$Eq.forEach(((s) => this._$ET(s, this[s]))), this._$EM();
243
243
  }
244
- updated(t) {
244
+ updated(e) {
245
245
  }
246
- firstUpdated(t) {
246
+ firstUpdated(e) {
247
247
  }
248
248
  };
249
- R.elementStyles = [], R.shadowRootOptions = { mode: "open" }, R[j("elementProperties")] = /* @__PURE__ */ new Map(), R[j("finalized")] = /* @__PURE__ */ new Map(), zt?.({ ReactiveElement: R }), (W.reactiveElementVersions ??= []).push("2.1.1");
250
- const st = globalThis, F = st.trustedTypes, dt = F ? F.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, _t = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, St = "?" + C, jt = `<${St}>`, U = document, q = () => U.createComment(""), B = (e) => e === null || typeof e != "object" && typeof e != "function", it = Array.isArray, qt = (e) => it(e) || typeof e?.[Symbol.iterator] == "function", J = `[
251
- \f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, pt = /-->/g, ut = />/g, P = RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^
252
- \f\r"'\`<>=]|("|')|))|$)`, "g"), gt = /'/g, mt = /"/g, kt = /^(?:script|style|textarea|title)$/i, Bt = (e) => (t, ...s) => ({ _$litType$: e, strings: t, values: s }), g = Bt(1), x = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), ft = /* @__PURE__ */ new WeakMap(), D = U.createTreeWalker(U, 129);
253
- function Ct(e, t) {
254
- if (!it(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
255
- return dt !== void 0 ? dt.createHTML(t) : t;
256
- }
257
- const Kt = (e, t) => {
258
- const s = e.length - 1, i = [];
259
- let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = H;
260
- for (let c = 0; c < s; c++) {
261
- const n = e[c];
262
- let h, d, l = -1, p = 0;
263
- for (; p < n.length && (a.lastIndex = p, d = a.exec(n), d !== null); ) p = a.lastIndex, a === H ? d[1] === "!--" ? a = pt : d[1] !== void 0 ? a = ut : d[2] !== void 0 ? (kt.test(d[2]) && (r = RegExp("</" + d[2], "g")), a = P) : d[3] !== void 0 && (a = P) : a === P ? d[0] === ">" ? (a = r ?? H, l = -1) : d[1] === void 0 ? l = -2 : (l = a.lastIndex - d[2].length, h = d[1], a = d[3] === void 0 ? P : d[3] === '"' ? mt : gt) : a === mt || a === gt ? a = P : a === pt || a === ut ? a = H : (a = P, r = void 0);
264
- const u = a === P && e[c + 1].startsWith("/>") ? " " : "";
265
- o += a === H ? n + jt : l >= 0 ? (i.push(h), n.slice(0, l) + _t + n.slice(l) + C + u) : n + C + (l === -2 ? c : u);
266
- }
267
- return [Ct(e, o + (e[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
249
+ Q.elementStyles = [], Q.shadowRootOptions = { mode: "open" }, Q[de("elementProperties")] = /* @__PURE__ */ new Map(), Q[de("finalized")] = /* @__PURE__ */ new Map(), Ns?.({ ReactiveElement: Q }), (xe.reactiveElementVersions ??= []).push("2.1.1");
250
+ const Xe = globalThis, Ce = Xe.trustedTypes, yt = Ce ? Ce.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, Vt = "$lit$", H = `lit$${Math.random().toFixed(9).slice(2)}$`, Wt = "?" + H, Ls = `<${Wt}>`, G = document, ue = () => G.createComment(""), pe = (t) => t === null || typeof t != "object" && typeof t != "function", Qe = Array.isArray, Is = (t) => Qe(t) || typeof t?.[Symbol.iterator] == "function", je = `[
251
+ \f\r]`, le = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, wt = /-->/g, bt = />/g, K = RegExp(`>|${je}(?:([^\\s"'>=/]+)(${je}*=${je}*(?:[^
252
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), $t = /'/g, St = /"/g, Yt = /^(?:script|style|textarea|title)$/i, Bs = (t) => (e, ...s) => ({ _$litType$: t, strings: e, values: s }), b = Bs(1), F = Symbol.for("lit-noChange"), $ = Symbol.for("lit-nothing"), At = /* @__PURE__ */ new WeakMap(), W = G.createTreeWalker(G, 129);
253
+ function Jt(t, e) {
254
+ if (!Qe(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
255
+ return yt !== void 0 ? yt.createHTML(e) : e;
256
+ }
257
+ const js = (t, e) => {
258
+ const s = t.length - 1, r = [];
259
+ let i, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = le;
260
+ for (let a = 0; a < s; a++) {
261
+ const l = t[a];
262
+ let h, c, u = -1, f = 0;
263
+ for (; f < l.length && (n.lastIndex = f, c = n.exec(l), c !== null); ) f = n.lastIndex, n === le ? c[1] === "!--" ? n = wt : c[1] !== void 0 ? n = bt : c[2] !== void 0 ? (Yt.test(c[2]) && (i = RegExp("</" + c[2], "g")), n = K) : c[3] !== void 0 && (n = K) : n === K ? c[0] === ">" ? (n = i ?? le, u = -1) : c[1] === void 0 ? u = -2 : (u = n.lastIndex - c[2].length, h = c[1], n = c[3] === void 0 ? K : c[3] === '"' ? St : $t) : n === St || n === $t ? n = K : n === wt || n === bt ? n = le : (n = K, i = void 0);
264
+ const y = n === K && t[a + 1].startsWith("/>") ? " " : "";
265
+ o += n === le ? l + Ls : u >= 0 ? (r.push(h), l.slice(0, u) + Vt + l.slice(u) + H + y) : l + H + (u === -2 ? a : y);
266
+ }
267
+ return [Jt(t, o + (t[s] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
268
268
  };
269
- class K {
270
- constructor({ strings: t, _$litType$: s }, i) {
271
- let r;
269
+ class fe {
270
+ constructor({ strings: e, _$litType$: s }, r) {
271
+ let i;
272
272
  this.parts = [];
273
- let o = 0, a = 0;
274
- const c = t.length - 1, n = this.parts, [h, d] = Kt(t, s);
275
- if (this.el = K.createElement(h, i), D.currentNode = this.el.content, s === 2 || s === 3) {
276
- const l = this.el.content.firstChild;
277
- l.replaceWith(...l.childNodes);
278
- }
279
- for (; (r = D.nextNode()) !== null && n.length < c; ) {
280
- if (r.nodeType === 1) {
281
- if (r.hasAttributes()) for (const l of r.getAttributeNames()) if (l.endsWith(_t)) {
282
- const p = d[a++], u = r.getAttribute(l).split(C), w = /([.?@])?(.*)/.exec(p);
283
- n.push({ type: 1, index: o, name: w[2], strings: u, ctor: w[1] === "." ? Vt : w[1] === "?" ? Ft : w[1] === "@" ? Wt : G }), r.removeAttribute(l);
284
- } else l.startsWith(C) && (n.push({ type: 6, index: o }), r.removeAttribute(l));
285
- if (kt.test(r.tagName)) {
286
- const l = r.textContent.split(C), p = l.length - 1;
287
- if (p > 0) {
288
- r.textContent = F ? F.emptyScript : "";
289
- for (let u = 0; u < p; u++) r.append(l[u], q()), D.nextNode(), n.push({ type: 2, index: ++o });
290
- r.append(l[p], q());
273
+ let o = 0, n = 0;
274
+ const a = e.length - 1, l = this.parts, [h, c] = js(e, s);
275
+ if (this.el = fe.createElement(h, r), W.currentNode = this.el.content, s === 2 || s === 3) {
276
+ const u = this.el.content.firstChild;
277
+ u.replaceWith(...u.childNodes);
278
+ }
279
+ for (; (i = W.nextNode()) !== null && l.length < a; ) {
280
+ if (i.nodeType === 1) {
281
+ if (i.hasAttributes()) for (const u of i.getAttributeNames()) if (u.endsWith(Vt)) {
282
+ const f = c[n++], y = i.getAttribute(u).split(H), p = /([.?@])?(.*)/.exec(f);
283
+ l.push({ type: 1, index: o, name: p[2], strings: y, ctor: p[1] === "." ? Fs : p[1] === "?" ? Ms : p[1] === "@" ? qs : Re }), i.removeAttribute(u);
284
+ } else u.startsWith(H) && (l.push({ type: 6, index: o }), i.removeAttribute(u));
285
+ if (Yt.test(i.tagName)) {
286
+ const u = i.textContent.split(H), f = u.length - 1;
287
+ if (f > 0) {
288
+ i.textContent = Ce ? Ce.emptyScript : "";
289
+ for (let y = 0; y < f; y++) i.append(u[y], ue()), W.nextNode(), l.push({ type: 2, index: ++o });
290
+ i.append(u[f], ue());
291
291
  }
292
292
  }
293
- } else if (r.nodeType === 8) if (r.data === St) n.push({ type: 2, index: o });
293
+ } else if (i.nodeType === 8) if (i.data === Wt) l.push({ type: 2, index: o });
294
294
  else {
295
- let l = -1;
296
- for (; (l = r.data.indexOf(C, l + 1)) !== -1; ) n.push({ type: 7, index: o }), l += C.length - 1;
295
+ let u = -1;
296
+ for (; (u = i.data.indexOf(H, u + 1)) !== -1; ) l.push({ type: 7, index: o }), u += H.length - 1;
297
297
  }
298
298
  o++;
299
299
  }
300
300
  }
301
- static createElement(t, s) {
302
- const i = U.createElement("template");
303
- return i.innerHTML = t, i;
301
+ static createElement(e, s) {
302
+ const r = G.createElement("template");
303
+ return r.innerHTML = e, r;
304
304
  }
305
305
  }
306
- function N(e, t, s = e, i) {
307
- if (t === x) return t;
308
- let r = i !== void 0 ? s._$Co?.[i] : s._$Cl;
309
- const o = B(t) ? void 0 : t._$litDirective$;
310
- return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(e), r._$AT(e, s, i)), i !== void 0 ? (s._$Co ??= [])[i] = r : s._$Cl = r), r !== void 0 && (t = N(e, r._$AS(e, t.values), r, i)), t;
306
+ function te(t, e, s = t, r) {
307
+ if (e === F) return e;
308
+ let i = r !== void 0 ? s._$Co?.[r] : s._$Cl;
309
+ const o = pe(e) ? void 0 : e._$litDirective$;
310
+ return i?.constructor !== o && (i?._$AO?.(!1), o === void 0 ? i = void 0 : (i = new o(t), i._$AT(t, s, r)), r !== void 0 ? (s._$Co ??= [])[r] = i : s._$Cl = i), i !== void 0 && (e = te(t, i._$AS(t, e.values), i, r)), e;
311
311
  }
312
- let Yt = class {
313
- constructor(t, s) {
314
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = s;
312
+ let Hs = class {
313
+ constructor(e, s) {
314
+ this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = s;
315
315
  }
316
316
  get parentNode() {
317
317
  return this._$AM.parentNode;
@@ -319,35 +319,35 @@ let Yt = class {
319
319
  get _$AU() {
320
320
  return this._$AM._$AU;
321
321
  }
322
- u(t) {
323
- const { el: { content: s }, parts: i } = this._$AD, r = (t?.creationScope ?? U).importNode(s, !0);
324
- D.currentNode = r;
325
- let o = D.nextNode(), a = 0, c = 0, n = i[0];
326
- for (; n !== void 0; ) {
327
- if (a === n.index) {
322
+ u(e) {
323
+ const { el: { content: s }, parts: r } = this._$AD, i = (e?.creationScope ?? G).importNode(s, !0);
324
+ W.currentNode = i;
325
+ let o = W.nextNode(), n = 0, a = 0, l = r[0];
326
+ for (; l !== void 0; ) {
327
+ if (n === l.index) {
328
328
  let h;
329
- n.type === 2 ? h = new L(o, o.nextSibling, this, t) : n.type === 1 ? h = new n.ctor(o, n.name, n.strings, this, t) : n.type === 6 && (h = new Gt(o, this, t)), this._$AV.push(h), n = i[++c];
329
+ l.type === 2 ? h = new re(o, o.nextSibling, this, e) : l.type === 1 ? h = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (h = new zs(o, this, e)), this._$AV.push(h), l = r[++a];
330
330
  }
331
- a !== n?.index && (o = D.nextNode(), a++);
331
+ n !== l?.index && (o = W.nextNode(), n++);
332
332
  }
333
- return D.currentNode = U, r;
333
+ return W.currentNode = G, i;
334
334
  }
335
- p(t) {
335
+ p(e) {
336
336
  let s = 0;
337
- for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, s), s += i.strings.length - 2) : i._$AI(t[s])), s++;
337
+ for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(e, r, s), s += r.strings.length - 2) : r._$AI(e[s])), s++;
338
338
  }
339
339
  };
340
- class L {
340
+ class re {
341
341
  get _$AU() {
342
342
  return this._$AM?._$AU ?? this._$Cv;
343
343
  }
344
- constructor(t, s, i, r) {
345
- this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = s, this._$AM = i, this.options = r, this._$Cv = r?.isConnected ?? !0;
344
+ constructor(e, s, r, i) {
345
+ this.type = 2, this._$AH = $, this._$AN = void 0, this._$AA = e, this._$AB = s, this._$AM = r, this.options = i, this._$Cv = i?.isConnected ?? !0;
346
346
  }
347
347
  get parentNode() {
348
- let t = this._$AA.parentNode;
348
+ let e = this._$AA.parentNode;
349
349
  const s = this._$AM;
350
- return s !== void 0 && t?.nodeType === 11 && (t = s.parentNode), t;
350
+ return s !== void 0 && e?.nodeType === 11 && (e = s.parentNode), e;
351
351
  }
352
352
  get startNode() {
353
353
  return this._$AA;
@@ -355,135 +355,135 @@ class L {
355
355
  get endNode() {
356
356
  return this._$AB;
357
357
  }
358
- _$AI(t, s = this) {
359
- t = N(this, t, s), B(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== x && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : qt(t) ? this.k(t) : this._(t);
358
+ _$AI(e, s = this) {
359
+ e = te(this, e, s), pe(e) ? e === $ || e == null || e === "" ? (this._$AH !== $ && this._$AR(), this._$AH = $) : e !== this._$AH && e !== F && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Is(e) ? this.k(e) : this._(e);
360
360
  }
361
- O(t) {
362
- return this._$AA.parentNode.insertBefore(t, this._$AB);
361
+ O(e) {
362
+ return this._$AA.parentNode.insertBefore(e, this._$AB);
363
363
  }
364
- T(t) {
365
- this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
364
+ T(e) {
365
+ this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
366
366
  }
367
- _(t) {
368
- this._$AH !== m && B(this._$AH) ? this._$AA.nextSibling.data = t : this.T(U.createTextNode(t)), this._$AH = t;
367
+ _(e) {
368
+ this._$AH !== $ && pe(this._$AH) ? this._$AA.nextSibling.data = e : this.T(G.createTextNode(e)), this._$AH = e;
369
369
  }
370
- $(t) {
371
- const { values: s, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = K.createElement(Ct(i.h, i.h[0]), this.options)), i);
372
- if (this._$AH?._$AD === r) this._$AH.p(s);
370
+ $(e) {
371
+ const { values: s, _$litType$: r } = e, i = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = fe.createElement(Jt(r.h, r.h[0]), this.options)), r);
372
+ if (this._$AH?._$AD === i) this._$AH.p(s);
373
373
  else {
374
- const o = new Yt(r, this), a = o.u(this.options);
375
- o.p(s), this.T(a), this._$AH = o;
374
+ const o = new Hs(i, this), n = o.u(this.options);
375
+ o.p(s), this.T(n), this._$AH = o;
376
376
  }
377
377
  }
378
- _$AC(t) {
379
- let s = ft.get(t.strings);
380
- return s === void 0 && ft.set(t.strings, s = new K(t)), s;
378
+ _$AC(e) {
379
+ let s = At.get(e.strings);
380
+ return s === void 0 && At.set(e.strings, s = new fe(e)), s;
381
381
  }
382
- k(t) {
383
- it(this._$AH) || (this._$AH = [], this._$AR());
382
+ k(e) {
383
+ Qe(this._$AH) || (this._$AH = [], this._$AR());
384
384
  const s = this._$AH;
385
- let i, r = 0;
386
- for (const o of t) r === s.length ? s.push(i = new L(this.O(q()), this.O(q()), this, this.options)) : i = s[r], i._$AI(o), r++;
387
- r < s.length && (this._$AR(i && i._$AB.nextSibling, r), s.length = r);
385
+ let r, i = 0;
386
+ for (const o of e) i === s.length ? s.push(r = new re(this.O(ue()), this.O(ue()), this, this.options)) : r = s[i], r._$AI(o), i++;
387
+ i < s.length && (this._$AR(r && r._$AB.nextSibling, i), s.length = i);
388
388
  }
389
- _$AR(t = this._$AA.nextSibling, s) {
390
- for (this._$AP?.(!1, !0, s); t !== this._$AB; ) {
391
- const i = t.nextSibling;
392
- t.remove(), t = i;
389
+ _$AR(e = this._$AA.nextSibling, s) {
390
+ for (this._$AP?.(!1, !0, s); e !== this._$AB; ) {
391
+ const r = e.nextSibling;
392
+ e.remove(), e = r;
393
393
  }
394
394
  }
395
- setConnected(t) {
396
- this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
395
+ setConnected(e) {
396
+ this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
397
397
  }
398
398
  }
399
- class G {
399
+ class Re {
400
400
  get tagName() {
401
401
  return this.element.tagName;
402
402
  }
403
403
  get _$AU() {
404
404
  return this._$AM._$AU;
405
405
  }
406
- constructor(t, s, i, r, o) {
407
- this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = s, this._$AM = r, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = m;
406
+ constructor(e, s, r, i, o) {
407
+ this.type = 1, this._$AH = $, this._$AN = void 0, this.element = e, this.name = s, this._$AM = i, this.options = o, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = $;
408
408
  }
409
- _$AI(t, s = this, i, r) {
409
+ _$AI(e, s = this, r, i) {
410
410
  const o = this.strings;
411
- let a = !1;
412
- if (o === void 0) t = N(this, t, s, 0), a = !B(t) || t !== this._$AH && t !== x, a && (this._$AH = t);
411
+ let n = !1;
412
+ if (o === void 0) e = te(this, e, s, 0), n = !pe(e) || e !== this._$AH && e !== F, n && (this._$AH = e);
413
413
  else {
414
- const c = t;
415
- let n, h;
416
- for (t = o[0], n = 0; n < o.length - 1; n++) h = N(this, c[i + n], s, n), h === x && (h = this._$AH[n]), a ||= !B(h) || h !== this._$AH[n], h === m ? t = m : t !== m && (t += (h ?? "") + o[n + 1]), this._$AH[n] = h;
414
+ const a = e;
415
+ let l, h;
416
+ for (e = o[0], l = 0; l < o.length - 1; l++) h = te(this, a[r + l], s, l), h === F && (h = this._$AH[l]), n ||= !pe(h) || h !== this._$AH[l], h === $ ? e = $ : e !== $ && (e += (h ?? "") + o[l + 1]), this._$AH[l] = h;
417
417
  }
418
- a && !r && this.j(t);
418
+ n && !i && this.j(e);
419
419
  }
420
- j(t) {
421
- t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
420
+ j(e) {
421
+ e === $ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
422
422
  }
423
423
  }
424
- class Vt extends G {
424
+ class Fs extends Re {
425
425
  constructor() {
426
426
  super(...arguments), this.type = 3;
427
427
  }
428
- j(t) {
429
- this.element[this.name] = t === m ? void 0 : t;
428
+ j(e) {
429
+ this.element[this.name] = e === $ ? void 0 : e;
430
430
  }
431
431
  }
432
- class Ft extends G {
432
+ class Ms extends Re {
433
433
  constructor() {
434
434
  super(...arguments), this.type = 4;
435
435
  }
436
- j(t) {
437
- this.element.toggleAttribute(this.name, !!t && t !== m);
436
+ j(e) {
437
+ this.element.toggleAttribute(this.name, !!e && e !== $);
438
438
  }
439
439
  }
440
- class Wt extends G {
441
- constructor(t, s, i, r, o) {
442
- super(t, s, i, r, o), this.type = 5;
440
+ class qs extends Re {
441
+ constructor(e, s, r, i, o) {
442
+ super(e, s, r, i, o), this.type = 5;
443
443
  }
444
- _$AI(t, s = this) {
445
- if ((t = N(this, t, s, 0) ?? m) === x) return;
446
- const i = this._$AH, r = t === m && i !== m || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, o = t !== m && (i === m || r);
447
- r && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
444
+ _$AI(e, s = this) {
445
+ if ((e = te(this, e, s, 0) ?? $) === F) return;
446
+ const r = this._$AH, i = e === $ && r !== $ || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, o = e !== $ && (r === $ || i);
447
+ i && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
448
448
  }
449
- handleEvent(t) {
450
- typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
449
+ handleEvent(e) {
450
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
451
451
  }
452
452
  }
453
- class Gt {
454
- constructor(t, s, i) {
455
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = i;
453
+ class zs {
454
+ constructor(e, s, r) {
455
+ this.element = e, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = r;
456
456
  }
457
457
  get _$AU() {
458
458
  return this._$AM._$AU;
459
459
  }
460
- _$AI(t) {
461
- N(this, t);
460
+ _$AI(e) {
461
+ te(this, e);
462
462
  }
463
463
  }
464
- const Jt = { I: L }, Zt = st.litHtmlPolyfillSupport;
465
- Zt?.(K, L), (st.litHtmlVersions ??= []).push("3.3.1");
466
- const Qt = (e, t, s) => {
467
- const i = s?.renderBefore ?? t;
468
- let r = i._$litPart$;
469
- if (r === void 0) {
464
+ const Ks = { I: re }, Vs = Xe.litHtmlPolyfillSupport;
465
+ Vs?.(fe, re), (Xe.litHtmlVersions ??= []).push("3.3.1");
466
+ const Ws = (t, e, s) => {
467
+ const r = s?.renderBefore ?? e;
468
+ let i = r._$litPart$;
469
+ if (i === void 0) {
470
470
  const o = s?.renderBefore ?? null;
471
- i._$litPart$ = r = new L(t.insertBefore(q(), o), o, void 0, s ?? {});
471
+ r._$litPart$ = i = new re(e.insertBefore(ue(), o), o, void 0, s ?? {});
472
472
  }
473
- return r._$AI(e), r;
473
+ return i._$AI(t), i;
474
474
  };
475
- const rt = globalThis;
476
- let I = class extends R {
475
+ const et = globalThis;
476
+ let ee = class extends Q {
477
477
  constructor() {
478
478
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
479
479
  }
480
480
  createRenderRoot() {
481
- const t = super.createRenderRoot();
482
- return this.renderOptions.renderBefore ??= t.firstChild, t;
481
+ const e = super.createRenderRoot();
482
+ return this.renderOptions.renderBefore ??= e.firstChild, e;
483
483
  }
484
- update(t) {
484
+ update(e) {
485
485
  const s = this.render();
486
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Qt(s, this.renderRoot, this.renderOptions);
486
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Ws(s, this.renderRoot, this.renderOptions);
487
487
  }
488
488
  connectedCallback() {
489
489
  super.connectedCallback(), this._$Do?.setConnected(!0);
@@ -492,172 +492,172 @@ let I = class extends R {
492
492
  super.disconnectedCallback(), this._$Do?.setConnected(!1);
493
493
  }
494
494
  render() {
495
- return x;
495
+ return F;
496
496
  }
497
497
  };
498
- I._$litElement$ = !0, I.finalized = !0, rt.litElementHydrateSupport?.({ LitElement: I });
499
- const Xt = rt.litElementPolyfillSupport;
500
- Xt?.({ LitElement: I });
501
- (rt.litElementVersions ??= []).push("4.2.1");
502
- const xt = (e) => (t, s) => {
498
+ ee._$litElement$ = !0, ee.finalized = !0, et.litElementHydrateSupport?.({ LitElement: ee });
499
+ const Ys = et.litElementPolyfillSupport;
500
+ Ys?.({ LitElement: ee });
501
+ (et.litElementVersions ??= []).push("4.2.1");
502
+ const Gt = (t) => (e, s) => {
503
503
  s !== void 0 ? s.addInitializer((() => {
504
- customElements.define(e, t);
505
- })) : customElements.define(e, t);
504
+ customElements.define(t, e);
505
+ })) : customElements.define(t, e);
506
506
  };
507
- const te = { attribute: !0, type: String, converter: V, reflect: !1, hasChanged: et }, ee = (e = te, t, s) => {
508
- const { kind: i, metadata: r } = s;
509
- let o = globalThis.litPropertyMetadata.get(r);
510
- if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), i === "setter" && ((e = Object.create(e)).wrapped = !0), o.set(s.name, e), i === "accessor") {
511
- const { name: a } = s;
512
- return { set(c) {
513
- const n = t.get.call(this);
514
- t.set.call(this, c), this.requestUpdate(a, n, e);
515
- }, init(c) {
516
- return c !== void 0 && this.C(a, void 0, e, c), c;
507
+ const Js = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged: Ze }, Gs = (t = Js, e, s) => {
508
+ const { kind: r, metadata: i } = s;
509
+ let o = globalThis.litPropertyMetadata.get(i);
510
+ if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), r === "setter" && ((t = Object.create(t)).wrapped = !0), o.set(s.name, t), r === "accessor") {
511
+ const { name: n } = s;
512
+ return { set(a) {
513
+ const l = e.get.call(this);
514
+ e.set.call(this, a), this.requestUpdate(n, l, t);
515
+ }, init(a) {
516
+ return a !== void 0 && this.C(n, void 0, t, a), a;
517
517
  } };
518
518
  }
519
- if (i === "setter") {
520
- const { name: a } = s;
521
- return function(c) {
522
- const n = this[a];
523
- t.call(this, c), this.requestUpdate(a, n, e);
519
+ if (r === "setter") {
520
+ const { name: n } = s;
521
+ return function(a) {
522
+ const l = this[n];
523
+ e.call(this, a), this.requestUpdate(n, l, t);
524
524
  };
525
525
  }
526
- throw Error("Unsupported decorator location: " + i);
526
+ throw Error("Unsupported decorator location: " + r);
527
527
  };
528
- function A(e) {
529
- return (t, s) => typeof s == "object" ? ee(e, t, s) : ((i, r, o) => {
530
- const a = r.hasOwnProperty(o);
531
- return r.constructor.createProperty(o, i), a ? Object.getOwnPropertyDescriptor(r, o) : void 0;
532
- })(e, t, s);
533
- }
534
- function $(e) {
535
- return A({ ...e, state: !0, attribute: !1 });
536
- }
537
- const se = (e, t, s) => (s.configurable = !0, s.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, s), s);
538
- function ot(e, t) {
539
- return (s, i, r) => {
540
- const o = (a) => a.renderRoot?.querySelector(e) ?? null;
541
- return se(s, i, { get() {
528
+ function O(t) {
529
+ return (e, s) => typeof s == "object" ? Gs(t, e, s) : ((r, i, o) => {
530
+ const n = i.hasOwnProperty(o);
531
+ return i.constructor.createProperty(o, r), n ? Object.getOwnPropertyDescriptor(i, o) : void 0;
532
+ })(t, e, s);
533
+ }
534
+ function T(t) {
535
+ return O({ ...t, state: !0, attribute: !1 });
536
+ }
537
+ const Zs = (t, e, s) => (s.configurable = !0, s.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, s), s);
538
+ function tt(t, e) {
539
+ return (s, r, i) => {
540
+ const o = (n) => n.renderRoot?.querySelector(t) ?? null;
541
+ return Zs(s, r, { get() {
542
542
  return o(this);
543
543
  } });
544
544
  };
545
545
  }
546
- const Et = { ATTRIBUTE: 1, CHILD: 2 }, Tt = (e) => (...t) => ({ _$litDirective$: e, values: t });
547
- class Pt {
548
- constructor(t) {
546
+ const Zt = { ATTRIBUTE: 1, CHILD: 2 }, Xt = (t) => (...e) => ({ _$litDirective$: t, values: e });
547
+ class Qt {
548
+ constructor(e) {
549
549
  }
550
550
  get _$AU() {
551
551
  return this._$AM._$AU;
552
552
  }
553
- _$AT(t, s, i) {
554
- this._$Ct = t, this._$AM = s, this._$Ci = i;
553
+ _$AT(e, s, r) {
554
+ this._$Ct = e, this._$AM = s, this._$Ci = r;
555
555
  }
556
- _$AS(t, s) {
557
- return this.update(t, s);
556
+ _$AS(e, s) {
557
+ return this.update(e, s);
558
558
  }
559
- update(t, s) {
559
+ update(e, s) {
560
560
  return this.render(...s);
561
561
  }
562
562
  }
563
- const yt = Tt(class extends Pt {
564
- constructor(e) {
565
- if (super(e), e.type !== Et.ATTRIBUTE || e.name !== "class" || e.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
563
+ const vt = Xt(class extends Qt {
564
+ constructor(t) {
565
+ if (super(t), t.type !== Zt.ATTRIBUTE || t.name !== "class" || t.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
566
566
  }
567
- render(e) {
568
- return " " + Object.keys(e).filter(((t) => e[t])).join(" ") + " ";
567
+ render(t) {
568
+ return " " + Object.keys(t).filter(((e) => t[e])).join(" ") + " ";
569
569
  }
570
- update(e, [t]) {
570
+ update(t, [e]) {
571
571
  if (this.st === void 0) {
572
- this.st = /* @__PURE__ */ new Set(), e.strings !== void 0 && (this.nt = new Set(e.strings.join(" ").split(/\s/).filter(((i) => i !== ""))));
573
- for (const i in t) t[i] && !this.nt?.has(i) && this.st.add(i);
574
- return this.render(t);
572
+ this.st = /* @__PURE__ */ new Set(), t.strings !== void 0 && (this.nt = new Set(t.strings.join(" ").split(/\s/).filter(((r) => r !== ""))));
573
+ for (const r in e) e[r] && !this.nt?.has(r) && this.st.add(r);
574
+ return this.render(e);
575
575
  }
576
- const s = e.element.classList;
577
- for (const i of this.st) i in t || (s.remove(i), this.st.delete(i));
578
- for (const i in t) {
579
- const r = !!t[i];
580
- r === this.st.has(i) || this.nt?.has(i) || (r ? (s.add(i), this.st.add(i)) : (s.remove(i), this.st.delete(i)));
576
+ const s = t.element.classList;
577
+ for (const r of this.st) r in e || (s.remove(r), this.st.delete(r));
578
+ for (const r in e) {
579
+ const i = !!e[r];
580
+ i === this.st.has(r) || this.nt?.has(r) || (i ? (s.add(r), this.st.add(r)) : (s.remove(r), this.st.delete(r)));
581
581
  }
582
- return x;
582
+ return F;
583
583
  }
584
584
  });
585
- const { I: ie } = Jt, wt = () => document.createComment(""), z = (e, t, s) => {
586
- const i = e._$AA.parentNode, r = t === void 0 ? e._$AB : t._$AA;
585
+ const { I: Xs } = Ks, Et = () => document.createComment(""), ce = (t, e, s) => {
586
+ const r = t._$AA.parentNode, i = e === void 0 ? t._$AB : e._$AA;
587
587
  if (s === void 0) {
588
- const o = i.insertBefore(wt(), r), a = i.insertBefore(wt(), r);
589
- s = new ie(o, a, e, e.options);
588
+ const o = r.insertBefore(Et(), i), n = r.insertBefore(Et(), i);
589
+ s = new Xs(o, n, t, t.options);
590
590
  } else {
591
- const o = s._$AB.nextSibling, a = s._$AM, c = a !== e;
592
- if (c) {
593
- let n;
594
- s._$AQ?.(e), s._$AM = e, s._$AP !== void 0 && (n = e._$AU) !== a._$AU && s._$AP(n);
595
- }
596
- if (o !== r || c) {
597
- let n = s._$AA;
598
- for (; n !== o; ) {
599
- const h = n.nextSibling;
600
- i.insertBefore(n, r), n = h;
591
+ const o = s._$AB.nextSibling, n = s._$AM, a = n !== t;
592
+ if (a) {
593
+ let l;
594
+ s._$AQ?.(t), s._$AM = t, s._$AP !== void 0 && (l = t._$AU) !== n._$AU && s._$AP(l);
595
+ }
596
+ if (o !== i || a) {
597
+ let l = s._$AA;
598
+ for (; l !== o; ) {
599
+ const h = l.nextSibling;
600
+ r.insertBefore(l, i), l = h;
601
601
  }
602
602
  }
603
603
  }
604
604
  return s;
605
- }, O = (e, t, s = e) => (e._$AI(t, s), e), re = {}, oe = (e, t = re) => e._$AH = t, ae = (e) => e._$AH, Z = (e) => {
606
- e._$AR(), e._$AA.remove();
605
+ }, V = (t, e, s = t) => (t._$AI(e, s), t), Qs = {}, er = (t, e = Qs) => t._$AH = e, tr = (t) => t._$AH, He = (t) => {
606
+ t._$AR(), t._$AA.remove();
607
607
  };
608
- const bt = (e, t, s) => {
609
- const i = /* @__PURE__ */ new Map();
610
- for (let r = t; r <= s; r++) i.set(e[r], r);
611
- return i;
612
- }, $t = Tt(class extends Pt {
613
- constructor(e) {
614
- if (super(e), e.type !== Et.CHILD) throw Error("repeat() can only be used in text expressions");
608
+ const _t = (t, e, s) => {
609
+ const r = /* @__PURE__ */ new Map();
610
+ for (let i = e; i <= s; i++) r.set(t[i], i);
611
+ return r;
612
+ }, Tt = Xt(class extends Qt {
613
+ constructor(t) {
614
+ if (super(t), t.type !== Zt.CHILD) throw Error("repeat() can only be used in text expressions");
615
615
  }
616
- dt(e, t, s) {
617
- let i;
618
- s === void 0 ? s = t : t !== void 0 && (i = t);
619
- const r = [], o = [];
620
- let a = 0;
621
- for (const c of e) r[a] = i ? i(c, a) : a, o[a] = s(c, a), a++;
622
- return { values: o, keys: r };
623
- }
624
- render(e, t, s) {
625
- return this.dt(e, t, s).values;
626
- }
627
- update(e, [t, s, i]) {
628
- const r = ae(e), { values: o, keys: a } = this.dt(t, s, i);
629
- if (!Array.isArray(r)) return this.ut = a, o;
630
- const c = this.ut ??= [], n = [];
631
- let h, d, l = 0, p = r.length - 1, u = 0, w = o.length - 1;
632
- for (; l <= p && u <= w; ) if (r[l] === null) l++;
633
- else if (r[p] === null) p--;
634
- else if (c[l] === a[u]) n[u] = O(r[l], o[u]), l++, u++;
635
- else if (c[p] === a[w]) n[w] = O(r[p], o[w]), p--, w--;
636
- else if (c[l] === a[w]) n[w] = O(r[l], o[w]), z(e, n[w + 1], r[l]), l++, w--;
637
- else if (c[p] === a[u]) n[u] = O(r[p], o[u]), z(e, r[l], r[p]), p--, u++;
638
- else if (h === void 0 && (h = bt(a, u, w), d = bt(c, l, p)), h.has(c[l])) if (h.has(c[p])) {
639
- const v = d.get(a[u]), _ = v !== void 0 ? r[v] : null;
640
- if (_ === null) {
641
- const b = z(e, r[l]);
642
- O(b, o[u]), n[u] = b;
643
- } else n[u] = O(_, o[u]), z(e, r[l], _), r[v] = null;
644
- u++;
645
- } else Z(r[p]), p--;
646
- else Z(r[l]), l++;
647
- for (; u <= w; ) {
648
- const v = z(e, n[w + 1]);
649
- O(v, o[u]), n[u++] = v;
650
- }
651
- for (; l <= p; ) {
652
- const v = r[l++];
653
- v !== null && Z(v);
654
- }
655
- return this.ut = a, oe(e, n), x;
656
- }
657
- }), ne = ({
658
- baseUrl: e
616
+ dt(t, e, s) {
617
+ let r;
618
+ s === void 0 ? s = e : e !== void 0 && (r = e);
619
+ const i = [], o = [];
620
+ let n = 0;
621
+ for (const a of t) i[n] = r ? r(a, n) : n, o[n] = s(a, n), n++;
622
+ return { values: o, keys: i };
623
+ }
624
+ render(t, e, s) {
625
+ return this.dt(t, e, s).values;
626
+ }
627
+ update(t, [e, s, r]) {
628
+ const i = tr(t), { values: o, keys: n } = this.dt(e, s, r);
629
+ if (!Array.isArray(i)) return this.ut = n, o;
630
+ const a = this.ut ??= [], l = [];
631
+ let h, c, u = 0, f = i.length - 1, y = 0, p = o.length - 1;
632
+ for (; u <= f && y <= p; ) if (i[u] === null) u++;
633
+ else if (i[f] === null) f--;
634
+ else if (a[u] === n[y]) l[y] = V(i[u], o[y]), u++, y++;
635
+ else if (a[f] === n[p]) l[p] = V(i[f], o[p]), f--, p--;
636
+ else if (a[u] === n[p]) l[p] = V(i[u], o[p]), ce(t, l[p + 1], i[u]), u++, p--;
637
+ else if (a[f] === n[y]) l[y] = V(i[f], o[y]), ce(t, i[u], i[f]), f--, y++;
638
+ else if (h === void 0 && (h = _t(n, y, p), c = _t(a, u, f)), h.has(a[u])) if (h.has(a[f])) {
639
+ const g = c.get(n[y]), m = g !== void 0 ? i[g] : null;
640
+ if (m === null) {
641
+ const w = ce(t, i[u]);
642
+ V(w, o[y]), l[y] = w;
643
+ } else l[y] = V(m, o[y]), ce(t, i[u], m), i[g] = null;
644
+ y++;
645
+ } else He(i[f]), f--;
646
+ else He(i[u]), u++;
647
+ for (; y <= p; ) {
648
+ const g = ce(t, l[p + 1]);
649
+ V(g, o[y]), l[y++] = g;
650
+ }
651
+ for (; u <= f; ) {
652
+ const g = i[u++];
653
+ g !== null && He(g);
654
+ }
655
+ return this.ut = n, er(t, l), F;
656
+ }
657
+ }), es = ({
658
+ baseUrl: t
659
659
  }) => {
660
- const t = {
660
+ const e = {
661
661
  login: "auth/login",
662
662
  logout: "auth/logout",
663
663
  refresh: "auth/refresh",
@@ -669,54 +669,54 @@ const bt = (e, t, s) => {
669
669
  return {
670
670
  login: async ({
671
671
  email: h,
672
- password: d,
673
- accessToken: l,
674
- refreshToken: p,
675
- idToken: u
672
+ password: c,
673
+ accessToken: u,
674
+ refreshToken: f,
675
+ idToken: y
676
676
  }) => {
677
- const w = await fetch(`${e}${t.login}`, {
677
+ const p = await fetch(`${t}${e.login}`, {
678
678
  method: "POST",
679
679
  headers: {
680
680
  "Content-Type": "application/json"
681
681
  },
682
682
  body: JSON.stringify({
683
683
  email: h,
684
- password: d,
685
- accessToken: l,
686
- refreshToken: p,
687
- idToken: u
684
+ password: c,
685
+ accessToken: u,
686
+ refreshToken: f,
687
+ idToken: y
688
688
  })
689
689
  });
690
- if (!w.ok) {
691
- const v = await w.json();
692
- throw new Error(v.message || v.error || "Login failed");
690
+ if (!p.ok) {
691
+ const g = await p.json();
692
+ throw new Error(g.message || g.error || "Login failed");
693
693
  }
694
- return w.json();
694
+ return p.json();
695
695
  },
696
696
  logout: async ({
697
697
  accessToken: h,
698
- refreshToken: d,
699
- authToken: l
698
+ refreshToken: c,
699
+ authToken: u
700
700
  }) => {
701
- const p = await fetch(`${e}${t.logout}`, {
701
+ const f = await fetch(`${t}${e.logout}`, {
702
702
  method: "POST",
703
703
  headers: {
704
704
  "Content-Type": "application/json",
705
- Authorization: `Bearer ${l}`
705
+ Authorization: `Bearer ${u}`
706
706
  },
707
707
  body: JSON.stringify({
708
708
  accessToken: h,
709
- refreshToken: d
709
+ refreshToken: c
710
710
  })
711
711
  });
712
- if (!p.ok) {
713
- const u = await p.json();
714
- throw new Error(u.message || u.error || "Logout failed");
712
+ if (!f.ok) {
713
+ const y = await f.json();
714
+ throw new Error(y.message || y.error || "Logout failed");
715
715
  }
716
- return p.json();
716
+ return f.json();
717
717
  },
718
718
  refresh: async ({ refreshToken: h }) => {
719
- const d = await fetch(`${e}${t.refresh}`, {
719
+ const c = await fetch(`${t}${e.refresh}`, {
720
720
  method: "POST",
721
721
  headers: {
722
722
  "Content-Type": "application/json"
@@ -725,14 +725,14 @@ const bt = (e, t, s) => {
725
725
  refreshToken: h
726
726
  })
727
727
  });
728
- if (!d.ok) {
729
- const l = await d.json();
730
- throw new Error(l.message || l.error || "Failed to refresh token");
728
+ if (!c.ok) {
729
+ const u = await c.json();
730
+ throw new Error(u.message || u.error || "Failed to refresh token");
731
731
  }
732
- return d.json();
732
+ return c.json();
733
733
  },
734
734
  requestRegisterOtp: async ({ email: h }) => {
735
- const d = await fetch(`${e}${t.requestRegisterOtp}`, {
735
+ const c = await fetch(`${t}${e.requestRegisterOtp}`, {
736
736
  method: "POST",
737
737
  headers: {
738
738
  "Content-Type": "application/json"
@@ -741,42 +741,42 @@ const bt = (e, t, s) => {
741
741
  email: h
742
742
  })
743
743
  });
744
- if (!d.ok) {
745
- const l = await d.json();
746
- throw new Error(l.message || l.error || "Failed to request OTP");
744
+ if (!c.ok) {
745
+ const u = await c.json();
746
+ throw new Error(u.message || u.error || "Failed to request OTP");
747
747
  }
748
- return d.json();
748
+ return c.json();
749
749
  },
750
750
  register: async ({
751
751
  email: h,
752
- password: d,
753
- phone_number: l,
754
- family_name: p,
755
- given_name: u,
756
- code: w
752
+ password: c,
753
+ phone_number: u,
754
+ family_name: f,
755
+ given_name: y,
756
+ code: p
757
757
  }) => {
758
- const v = await fetch(`${e}${t.register}`, {
758
+ const g = await fetch(`${t}${e.register}`, {
759
759
  method: "POST",
760
760
  headers: {
761
761
  "Content-Type": "application/json"
762
762
  },
763
763
  body: JSON.stringify({
764
764
  email: h,
765
- password: d,
766
- phone_number: l,
767
- family_name: p,
768
- given_name: u,
769
- code: w
765
+ password: c,
766
+ phone_number: u,
767
+ family_name: f,
768
+ given_name: y,
769
+ code: p
770
770
  })
771
771
  });
772
- if (!v.ok) {
773
- const _ = await v.json();
774
- throw new Error(_.message || _.error || "Registration failed");
772
+ if (!g.ok) {
773
+ const m = await g.json();
774
+ throw new Error(m.message || m.error || "Registration failed");
775
775
  }
776
- return v.json();
776
+ return g.json();
777
777
  },
778
778
  requestResetPassword: async ({ email: h }) => {
779
- const d = await fetch(`${e}${t.requestResetPassword}`, {
779
+ const c = await fetch(`${t}${e.requestResetPassword}`, {
780
780
  method: "POST",
781
781
  headers: {
782
782
  "Content-Type": "application/json"
@@ -785,183 +785,183 @@ const bt = (e, t, s) => {
785
785
  email: h
786
786
  })
787
787
  });
788
- if (!d.ok) {
789
- const l = await d.json();
790
- throw new Error(l.message || l.error || "Failed to request password reset");
788
+ if (!c.ok) {
789
+ const u = await c.json();
790
+ throw new Error(u.message || u.error || "Failed to request password reset");
791
791
  }
792
- return d.json();
792
+ return c.json();
793
793
  },
794
794
  resetPassword: async ({
795
795
  email: h,
796
- otp: d,
797
- newPassword: l
796
+ otp: c,
797
+ newPassword: u
798
798
  }) => {
799
- const p = await fetch(`${e}${t.resetPassword}`, {
799
+ const f = await fetch(`${t}${e.resetPassword}`, {
800
800
  method: "POST",
801
801
  headers: {
802
802
  "Content-Type": "application/json"
803
803
  },
804
804
  body: JSON.stringify({
805
805
  email: h,
806
- otp: d,
807
- newPassword: l
806
+ otp: c,
807
+ newPassword: u
808
808
  })
809
809
  });
810
- if (!p.ok) {
811
- const u = await p.json();
812
- throw new Error(u.message || u.error || "Failed to reset password");
810
+ if (!f.ok) {
811
+ const y = await f.json();
812
+ throw new Error(y.message || y.error || "Failed to reset password");
813
813
  }
814
- return p.json();
814
+ return f.json();
815
815
  }
816
816
  };
817
- }, Q = {
817
+ }, Fe = {
818
818
  AUTH_TOKEN: "authToken",
819
819
  ACCESS_TOKEN: "accessToken",
820
820
  REFRESH_TOKEN: "refreshToken"
821
- }, le = {
821
+ }, sr = {
822
822
  maxAge: 3600 * 24 * 7,
823
823
  // 7 days
824
824
  secure: !0,
825
825
  sameSite: "lax",
826
826
  path: "/"
827
- }, he = () => {
828
- const e = (n, h, d = {}) => {
827
+ }, ts = () => {
828
+ const t = (l, h, c = {}) => {
829
829
  const {
830
- maxAge: l,
831
- path: p = "/",
832
- secure: u = window.location.protocol === "https:",
833
- sameSite: w = "lax",
834
- domain: v
835
- } = d;
836
- let _ = `${encodeURIComponent(n)}=${encodeURIComponent(h)}`;
837
- l !== void 0 && (_ += `; Max-Age=${l}`), _ += `; Path=${p}`, u && (_ += "; Secure"), _ += `; SameSite=${w}`, v && (_ += `; Domain=${v}`), document.cookie = _;
838
- }, t = (n) => {
839
- const h = encodeURIComponent(n) + "=", d = document.cookie.split(";");
840
- for (let l = 0; l < d.length; l++) {
841
- let p = d[l];
842
- for (; p.charAt(0) === " "; )
843
- p = p.substring(1);
844
- if (p.indexOf(h) === 0)
845
- return decodeURIComponent(p.substring(h.length));
830
+ maxAge: u,
831
+ path: f = "/",
832
+ secure: y = window.location.protocol === "https:",
833
+ sameSite: p = "lax",
834
+ domain: g
835
+ } = c;
836
+ let m = `${encodeURIComponent(l)}=${encodeURIComponent(h)}`;
837
+ u !== void 0 && (m += `; Max-Age=${u}`), m += `; Path=${f}`, y && (m += "; Secure"), m += `; SameSite=${p}`, g && (m += `; Domain=${g}`), document.cookie = m;
838
+ }, e = (l) => {
839
+ const h = encodeURIComponent(l) + "=", c = document.cookie.split(";");
840
+ for (let u = 0; u < c.length; u++) {
841
+ let f = c[u];
842
+ for (; f.charAt(0) === " "; )
843
+ f = f.substring(1);
844
+ if (f.indexOf(h) === 0)
845
+ return decodeURIComponent(f.substring(h.length));
846
846
  }
847
847
  return null;
848
- }, s = (n, h = {}) => {
849
- e(n, "", {
848
+ }, s = (l, h = {}) => {
849
+ t(l, "", {
850
850
  ...h,
851
851
  maxAge: -1
852
852
  });
853
- }, i = (n) => t(n) !== null, r = (n, h) => {
854
- e(Q[n], h, le);
855
- }, o = (n) => t(Q[n]), a = (n) => {
856
- s(Q[n]);
853
+ }, r = (l) => e(l) !== null, i = (l, h) => {
854
+ t(Fe[l], h, sr);
855
+ }, o = (l) => e(Fe[l]), n = (l) => {
856
+ s(Fe[l]);
857
857
  };
858
858
  return {
859
- setCookie: e,
860
- getCookie: t,
859
+ setCookie: t,
860
+ getCookie: e,
861
861
  removeCookie: s,
862
- hasCookie: i,
863
- setAuthToken: r,
862
+ hasCookie: r,
863
+ setAuthToken: i,
864
864
  getAuthToken: o,
865
- removeAuthToken: a,
865
+ removeAuthToken: n,
866
866
  clearAllAuthTokens: () => {
867
- a("AUTH_TOKEN"), a("ACCESS_TOKEN"), a("REFRESH_TOKEN");
867
+ n("AUTH_TOKEN"), n("ACCESS_TOKEN"), n("REFRESH_TOKEN");
868
868
  }
869
869
  };
870
- }, ce = ["code", "state", "error", "error_description"], de = (e) => {
871
- if (e) return e;
872
- const t = new URL(window.location.href);
873
- return ce.forEach((s) => t.searchParams.delete(s)), t.toString();
874
- }, pe = ({
875
- domain: e,
876
- cognitoRegion: t,
870
+ }, rr = ["code", "state", "error", "error_description"], ir = (t) => {
871
+ if (t) return t;
872
+ const e = new URL(window.location.href);
873
+ return rr.forEach((s) => e.searchParams.delete(s)), e.toString();
874
+ }, or = ({
875
+ domain: t,
876
+ cognitoRegion: e,
877
877
  userPoolId: s,
878
- clientId: i,
879
- redirectUri: r
878
+ clientId: r,
879
+ redirectUri: i
880
880
  }) => {
881
881
  const o = {
882
- domain: e,
883
- clientId: i,
884
- redirectUri: de(r)
885
- }, a = (b) => {
886
- const S = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", k = new Uint8Array(b);
887
- return crypto.getRandomValues(k), Array.from(k).map((T) => S[T % S.length]).join("");
888
- }, c = async (b) => {
889
- const k = new TextEncoder().encode(b), T = await crypto.subtle.digest("SHA-256", k);
890
- return btoa(String.fromCharCode(...new Uint8Array(T))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
891
- }, n = async () => {
892
- const b = a(128), S = await c(b);
893
- return sessionStorage.setItem("pkce_code_verifier", b), { codeVerifier: b, codeChallenge: S };
882
+ domain: t,
883
+ clientId: r,
884
+ redirectUri: ir(i)
885
+ }, n = (w) => {
886
+ const _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", E = new Uint8Array(w);
887
+ return crypto.getRandomValues(E), Array.from(E).map((k) => _[k % _.length]).join("");
888
+ }, a = async (w) => {
889
+ const E = new TextEncoder().encode(w), k = await crypto.subtle.digest("SHA-256", E);
890
+ return btoa(String.fromCharCode(...new Uint8Array(k))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
891
+ }, l = async () => {
892
+ const w = n(128), _ = await a(w);
893
+ return sessionStorage.setItem("pkce_code_verifier", w), { codeVerifier: w, codeChallenge: _ };
894
894
  }, h = () => {
895
- const b = a(32);
896
- return sessionStorage.setItem("oauth_state", b), b;
897
- }, d = async () => {
898
- const { codeChallenge: b } = await n(), S = h(), k = new URLSearchParams({
895
+ const w = n(32);
896
+ return sessionStorage.setItem("oauth_state", w), w;
897
+ }, c = async () => {
898
+ const { codeChallenge: w } = await l(), _ = h(), E = new URLSearchParams({
899
899
  response_type: "code",
900
900
  client_id: o.clientId,
901
901
  redirect_uri: o.redirectUri,
902
902
  identity_provider: "Google",
903
903
  scope: "openid email profile",
904
- state: S,
904
+ state: _,
905
905
  code_challenge_method: "S256",
906
- code_challenge: b,
906
+ code_challenge: w,
907
907
  prompt: "select_account"
908
908
  });
909
- return `${o.domain}/oauth2/authorize?${k.toString()}`;
910
- }, l = async () => {
911
- const b = await d();
912
- window.location.href = b;
913
- }, p = async () => {
914
- const { codeChallenge: b } = await n(), S = h(), k = new URLSearchParams({
909
+ return `${o.domain}/oauth2/authorize?${E.toString()}`;
910
+ }, u = async () => {
911
+ const w = await c();
912
+ window.location.href = w;
913
+ }, f = async () => {
914
+ const { codeChallenge: w } = await l(), _ = h(), E = new URLSearchParams({
915
915
  response_type: "code",
916
916
  client_id: o.clientId,
917
917
  redirect_uri: o.redirectUri,
918
918
  identity_provider: "SignInWithApple",
919
919
  scope: "openid email profile",
920
- state: S,
920
+ state: _,
921
921
  code_challenge_method: "S256",
922
- code_challenge: b
922
+ code_challenge: w
923
923
  });
924
- return `${o.domain}/oauth2/authorize?${k.toString()}`;
925
- }, u = async () => {
926
- const b = await p();
927
- window.location.href = b;
928
- }, w = (b) => {
929
- const S = sessionStorage.getItem("oauth_state");
930
- return sessionStorage.removeItem("oauth_state"), S === b;
931
- }, v = () => {
932
- const b = sessionStorage.getItem("pkce_code_verifier");
933
- return sessionStorage.removeItem("pkce_code_verifier"), b;
924
+ return `${o.domain}/oauth2/authorize?${E.toString()}`;
925
+ }, y = async () => {
926
+ const w = await f();
927
+ window.location.href = w;
928
+ }, p = (w) => {
929
+ const _ = sessionStorage.getItem("oauth_state");
930
+ return sessionStorage.removeItem("oauth_state"), _ === w;
931
+ }, g = () => {
932
+ const w = sessionStorage.getItem("pkce_code_verifier");
933
+ return sessionStorage.removeItem("pkce_code_verifier"), w;
934
934
  };
935
935
  return {
936
- redirectToGoogleAuth: l,
937
- redirectToAppleAuth: u,
938
- validateState: w,
939
- getCodeVerifier: v,
940
- exchangeCodeForTokens: async (b) => {
941
- const S = v();
942
- if (!S)
936
+ redirectToGoogleAuth: u,
937
+ redirectToAppleAuth: y,
938
+ validateState: p,
939
+ getCodeVerifier: g,
940
+ exchangeCodeForTokens: async (w) => {
941
+ const _ = g();
942
+ if (!_)
943
943
  throw new Error("PKCE code verifier not found. Please restart the authentication flow.");
944
- const k = new URLSearchParams({
944
+ const E = new URLSearchParams({
945
945
  grant_type: "authorization_code",
946
946
  client_id: o.clientId,
947
- code: b,
947
+ code: w,
948
948
  redirect_uri: o.redirectUri,
949
- code_verifier: S
950
- }), T = await fetch(`${o.domain}/oauth2/token`, {
949
+ code_verifier: _
950
+ }), k = await fetch(`${o.domain}/oauth2/token`, {
951
951
  method: "POST",
952
952
  headers: {
953
953
  "Content-Type": "application/x-www-form-urlencoded"
954
954
  },
955
- body: k.toString()
955
+ body: E.toString()
956
956
  });
957
- if (!T.ok) {
958
- const at = await T.text();
959
- throw new Error(`Token exchange failed: ${at}`);
957
+ if (!k.ok) {
958
+ const R = await k.text();
959
+ throw new Error(`Token exchange failed: ${R}`);
960
960
  }
961
- return T.json();
961
+ return k.json();
962
962
  }
963
963
  };
964
- }, ue = () => At`
964
+ }, nr = () => Kt`
965
965
  :host {
966
966
  display: inline-block;
967
967
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
@@ -1461,12 +1461,12 @@ const bt = (e, t, s) => {
1461
1461
  transition: none !important;
1462
1462
  }
1463
1463
  }`;
1464
- var ge = Object.defineProperty, me = Object.getOwnPropertyDescriptor, y = (e, t, s, i) => {
1465
- for (var r = i > 1 ? void 0 : i ? me(t, s) : t, o = e.length - 1, a; o >= 0; o--)
1466
- (a = e[o]) && (r = (i ? a(t, s, r) : a(r)) || r);
1467
- return i && r && ge(t, s, r), r;
1464
+ var ar = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, v = (t, e, s, r) => {
1465
+ for (var i = r > 1 ? void 0 : r ? lr(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1466
+ (n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
1467
+ return r && i && ar(e, s, i), i;
1468
1468
  };
1469
- const fe = [
1469
+ const cr = [
1470
1470
  "code",
1471
1471
  "state",
1472
1472
  "error",
@@ -1477,41 +1477,41 @@ const fe = [
1477
1477
  "token_type",
1478
1478
  "expires_in"
1479
1479
  ];
1480
- let f = class extends I {
1480
+ let A = class extends ee {
1481
1481
  constructor() {
1482
- super(...arguments), this.open = !1, this.initialMode = "signin", this.logoUrl = "", this.baseUrl = "", this.oauthDomain = "", this.oauthRegion = "", this.oauthUserPoolId = "", this.oauthClientId = "", this.oauthRedirectUri = "", this.oauthSpaDomain = "", this.size = "sm", this.theme = "light", this.mode = "signin", this.resetStep = "none", this.signupStep = "form", this.isLoading = !1, this.isClosing = !1, this.isVisible = !1, this.isLoggedIn = !1, this.email = "", this.password = "", this.givenName = "", this.familyName = "", this.newPassword = "", this.confirmPassword = "", this.notice = "", this.error = "", this.errors = {}, this.otpDigits = ["", "", "", "", "", ""], this.signupOtpDigits = ["", "", "", "", "", ""], this.isDragging = !1, this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, this.lastDragEndTime = 0, this.cookies = he(), this.scrollPosition = 0, this.transitionDuration = 300, this.hasHandledOAuthCallback = !1, this.boundKeyHandler = (e) => {
1483
- e.key === "Escape" && this.isVisible && this.handleClose();
1482
+ super(...arguments), this.open = !1, this.initialMode = "signin", this.logoUrl = "", this.baseUrl = "", this.oauthDomain = "", this.oauthRegion = "", this.oauthUserPoolId = "", this.oauthClientId = "", this.oauthRedirectUri = "", this.oauthSpaDomain = "", this.size = "sm", this.theme = "light", this.mode = "signin", this.resetStep = "none", this.signupStep = "form", this.isLoading = !1, this.isClosing = !1, this.isVisible = !1, this.isLoggedIn = !1, this.email = "", this.password = "", this.givenName = "", this.familyName = "", this.newPassword = "", this.confirmPassword = "", this.notice = "", this.error = "", this.errors = {}, this.otpDigits = ["", "", "", "", "", ""], this.signupOtpDigits = ["", "", "", "", "", ""], this.isDragging = !1, this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, this.lastDragEndTime = 0, this.cookies = ts(), this.scrollPosition = 0, this.transitionDuration = 300, this.hasHandledOAuthCallback = !1, this.boundKeyHandler = (t) => {
1483
+ t.key === "Escape" && this.isVisible && this.handleClose();
1484
1484
  }, this.baseUrlErrorMessage = "Authentication service is not configured correctly. Please add an API domain or contact support.", this.handleClose = () => {
1485
1485
  this.isClosing || !this.isVisible || (this.cleanupInlineStyles(), this.isDragging = !1, this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, this.isClosing = !0, setTimeout(() => {
1486
1486
  this.isClosing = !1, this.isVisible = !1, this.open = !1;
1487
1487
  }, this.transitionDuration));
1488
1488
  }, this.handleOverlayClick = () => {
1489
1489
  this.handleClose();
1490
- }, this.handleDragStart = (e) => {
1490
+ }, this.handleDragStart = (t) => {
1491
1491
  if (!this.modalContainer || this.modalBody && this.modalBody.scrollTop > 0)
1492
1492
  return;
1493
- const t = e.target;
1494
- !(t.classList.contains("drawer-handle") || t.classList.contains("drawer-handle-bar") || t.closest(".drawer-handle")) && this.modalBody && this.modalBody.scrollTop > 0 || (this.modalContainer.style.transition = "", this.modalContainer.style.transform = "", this.isDragging = !0, this.dragStartTime = Date.now(), e instanceof TouchEvent ? (this.dragStartY = e.touches[0].clientY, this.dragCurrentY = e.touches[0].clientY) : (this.dragStartY = e.clientY, this.dragCurrentY = e.clientY));
1495
- }, this.handleDragMove = (e) => {
1493
+ const e = t.target;
1494
+ !(e.classList.contains("drawer-handle") || e.classList.contains("drawer-handle-bar") || e.closest(".drawer-handle")) && this.modalBody && this.modalBody.scrollTop > 0 || (this.modalContainer.style.transition = "", this.modalContainer.style.transform = "", this.isDragging = !0, this.dragStartTime = Date.now(), t instanceof TouchEvent ? (this.dragStartY = t.touches[0].clientY, this.dragCurrentY = t.touches[0].clientY) : (this.dragStartY = t.clientY, this.dragCurrentY = t.clientY));
1495
+ }, this.handleDragMove = (t) => {
1496
1496
  if (!this.isDragging || !this.modalContainer) return;
1497
- e instanceof TouchEvent ? this.dragCurrentY = e.touches[0].clientY : this.dragCurrentY = e.clientY;
1498
- const t = this.dragCurrentY - this.dragStartY;
1499
- t > 0 && (e.preventDefault(), this.modalContainer.style.transform = `translateY(${t}px)`, this.modalContainer.style.transition = "none");
1497
+ t instanceof TouchEvent ? this.dragCurrentY = t.touches[0].clientY : this.dragCurrentY = t.clientY;
1498
+ const e = this.dragCurrentY - this.dragStartY;
1499
+ e > 0 && (t.preventDefault(), this.modalContainer.style.transform = `translateY(${e}px)`, this.modalContainer.style.transition = "none");
1500
1500
  }, this.handleDragEnd = () => {
1501
1501
  if (!this.isDragging || !this.modalContainer) return;
1502
- const e = Math.max(0, this.dragCurrentY - this.dragStartY);
1503
- e > 5 && (this.lastDragEndTime = Date.now());
1504
- const t = Date.now() - this.dragStartTime, s = e / t, i = this.modalContainer.offsetHeight, r = Math.max(150, i * 0.3), a = e > r || s > 0.5;
1502
+ const t = Math.max(0, this.dragCurrentY - this.dragStartY);
1503
+ t > 5 && (this.lastDragEndTime = Date.now());
1504
+ const e = Date.now() - this.dragStartTime, s = t / e, r = this.modalContainer.offsetHeight, i = Math.max(150, r * 0.3), n = t > i || s > 0.5;
1505
1505
  this.isDragging = !1;
1506
- const c = this.modalContainer, n = a ? i + i * 0.1 : 0;
1507
- c.style.transition = "none", c.style.transform = `translateY(${e}px)`, requestAnimationFrame(() => {
1508
- c.style.transition = `transform ${this.transitionDuration}ms cubic-bezier(0.4, 0, 0.2, 1)`, c.style.transform = `translateY(${n}px)`;
1506
+ const a = this.modalContainer, l = n ? r + r * 0.1 : 0;
1507
+ a.style.transition = "none", a.style.transform = `translateY(${t}px)`, requestAnimationFrame(() => {
1508
+ a.style.transition = `transform ${this.transitionDuration}ms cubic-bezier(0.4, 0, 0.2, 1)`, a.style.transform = `translateY(${l}px)`;
1509
1509
  }), setTimeout(() => {
1510
- this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, a ? (this.isVisible = !1, this.open = !1) : this.modalContainer && (this.modalContainer.style.transition = "", this.modalContainer.style.transform = "");
1510
+ this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, n ? (this.isVisible = !1, this.open = !1) : this.modalContainer && (this.modalContainer.style.transition = "", this.modalContainer.style.transform = "");
1511
1511
  }, this.transitionDuration);
1512
- }, this.handleHandleClick = (e) => {
1512
+ }, this.handleHandleClick = (t) => {
1513
1513
  if (Date.now() - this.lastDragEndTime < 200) {
1514
- e.preventDefault(), e.stopPropagation();
1514
+ t.preventDefault(), t.stopPropagation();
1515
1515
  return;
1516
1516
  }
1517
1517
  this.handleClose();
@@ -1521,22 +1521,22 @@ let f = class extends I {
1521
1521
  return this.baseUrl.trim().length > 0;
1522
1522
  }
1523
1523
  getNormalizedBaseUrl() {
1524
- const e = this.baseUrl.trim();
1525
- if (!e) return "";
1526
- const t = e.endsWith("/") ? e : `${e}/`;
1527
- return t.startsWith("http://") || t.startsWith("https://") ? t : `https://${t}`;
1524
+ const t = this.baseUrl.trim();
1525
+ if (!t) return "";
1526
+ const e = t.endsWith("/") ? t : `${t}/`;
1527
+ return e.startsWith("http://") || e.startsWith("https://") ? e : `https://${e}`;
1528
1528
  }
1529
1529
  getApiService() {
1530
1530
  if (!this.hasApiBaseUrl())
1531
1531
  throw new Error("API domain is not set");
1532
- return this.apiService || (this.apiService = ne({
1532
+ return this.apiService || (this.apiService = es({
1533
1533
  baseUrl: this.getNormalizedBaseUrl()
1534
1534
  })), this.apiService;
1535
1535
  }
1536
1536
  connectedCallback() {
1537
1537
  super.connectedCallback(), window.addEventListener("keyup", this.boundKeyHandler);
1538
- const e = this.cookies.getAuthToken("AUTH_TOKEN"), t = this.cookies.getAuthToken("REFRESH_TOKEN");
1539
- this.isLoggedIn = !!(e && t), this.mode = this.initialMode, this.hasApiBaseUrl() || (this.error = this.baseUrlErrorMessage), this.handleOAuthCallbackIfPresent();
1538
+ const t = this.cookies.getAuthToken("AUTH_TOKEN"), e = this.cookies.getAuthToken("REFRESH_TOKEN");
1539
+ this.isLoggedIn = !!(t && e), this.mode = this.initialMode, this.hasApiBaseUrl() || (this.error = this.baseUrlErrorMessage), this.handleOAuthCallbackIfPresent();
1540
1540
  }
1541
1541
  disconnectedCallback() {
1542
1542
  window.removeEventListener("keyup", this.boundKeyHandler), this.unlockBodyScroll(), super.disconnectedCallback();
@@ -1544,10 +1544,10 @@ let f = class extends I {
1544
1544
  firstUpdated() {
1545
1545
  this.open && (this.isVisible = !0);
1546
1546
  }
1547
- updated(e) {
1548
- e.has("baseUrl") && (this.apiService = void 0, this.hasApiBaseUrl() ? (this.error === this.baseUrlErrorMessage && (this.error = ""), this.hasHandledOAuthCallback || this.handleOAuthCallbackIfPresent()) : this.error = this.baseUrlErrorMessage), (e.has("oauthDomain") || e.has("oauthRegion") || e.has("oauthUserPoolId") || e.has("oauthClientId") || e.has("oauthRedirectUri")) && (this.oauthService = void 0, this.handleOAuthCallbackIfPresent()), e.has("open") && (this.open ? (this.isVisible = !0, this.lockBodyScroll(), setTimeout(() => {
1547
+ updated(t) {
1548
+ t.has("baseUrl") && (this.apiService = void 0, this.hasApiBaseUrl() ? (this.error === this.baseUrlErrorMessage && (this.error = ""), this.hasHandledOAuthCallback || this.handleOAuthCallbackIfPresent()) : this.error = this.baseUrlErrorMessage), (t.has("oauthDomain") || t.has("oauthRegion") || t.has("oauthUserPoolId") || t.has("oauthClientId") || t.has("oauthRedirectUri")) && (this.oauthService = void 0, this.handleOAuthCallbackIfPresent()), t.has("open") && (this.open ? (this.isVisible = !0, this.lockBodyScroll(), setTimeout(() => {
1549
1549
  this.emailInput?.focus();
1550
- }, 100)) : this.isVisible && this.handleClose()), e.has("isVisible") && (this.isVisible ? (this.lockBodyScroll(), this.cleanupInlineStyles()) : (this.unlockBodyScroll(), this.resetState()));
1550
+ }, 100)) : this.isVisible && this.handleClose()), t.has("isVisible") && (this.isVisible ? (this.lockBodyScroll(), this.cleanupInlineStyles()) : (this.unlockBodyScroll(), this.resetState()));
1551
1551
  }
1552
1552
  lockBodyScroll() {
1553
1553
  this.scrollPosition = window.scrollY, document.body.classList.add("modal-open"), document.body.style.top = `-${this.scrollPosition}px`;
@@ -1580,40 +1580,40 @@ let f = class extends I {
1580
1580
  }
1581
1581
  // Validation
1582
1582
  validate() {
1583
- const e = {};
1584
- if (this.email.trim() ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(this.email) || (e.email = "Enter a valid email") : e.email = "Email is required", this.resetStep === "none" && this.signupStep === "form") {
1583
+ const t = {};
1584
+ if (this.email.trim() ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(this.email) || (t.email = "Enter a valid email") : t.email = "Email is required", this.resetStep === "none" && this.signupStep === "form") {
1585
1585
  if (!this.password)
1586
- e.password = "Password is required";
1586
+ t.password = "Password is required";
1587
1587
  else if (this.password.length < 8)
1588
- e.password = "Password must be at least 8 characters";
1588
+ t.password = "Password must be at least 8 characters";
1589
1589
  else if (this.mode === "signup") {
1590
- const t = /[A-Z]/.test(this.password), s = /[a-z]/.test(this.password), i = /[0-9]/.test(this.password);
1591
- (!t || !s || !i) && (e.password = "Password must contain uppercase, lowercase, and number");
1590
+ const e = /[A-Z]/.test(this.password), s = /[a-z]/.test(this.password), r = /[0-9]/.test(this.password);
1591
+ (!e || !s || !r) && (t.password = "Password must contain uppercase, lowercase, and number");
1592
1592
  }
1593
1593
  }
1594
- if (this.mode === "signup" && this.resetStep === "none" && this.signupStep === "form" && (this.givenName.trim() ? /^[a-zA-Z\s-']+$/.test(this.givenName.trim()) || (e.givenName = "Invalid first name") : e.givenName = "First name is required", this.familyName.trim() ? /^[a-zA-Z\s-']+$/.test(this.familyName.trim()) || (e.familyName = "Invalid last name") : e.familyName = "Last name is required", this.confirmPassword ? this.password !== this.confirmPassword && (e.confirm_password = "Passwords must match") : e.confirm_password = "Please confirm your password"), this.signupStep === "otp") {
1595
- const t = this.signupOtpDigits.join("");
1596
- (t.length !== 6 || !/^\d{6}$/.test(t)) && (e.signup_otp = "Enter the 6-digit code");
1594
+ if (this.mode === "signup" && this.resetStep === "none" && this.signupStep === "form" && (this.givenName.trim() ? /^[a-zA-Z\s-']+$/.test(this.givenName.trim()) || (t.givenName = "Invalid first name") : t.givenName = "First name is required", this.familyName.trim() ? /^[a-zA-Z\s-']+$/.test(this.familyName.trim()) || (t.familyName = "Invalid last name") : t.familyName = "Last name is required", this.confirmPassword ? this.password !== this.confirmPassword && (t.confirm_password = "Passwords must match") : t.confirm_password = "Please confirm your password"), this.signupStep === "otp") {
1595
+ const e = this.signupOtpDigits.join("");
1596
+ (e.length !== 6 || !/^\d{6}$/.test(e)) && (t.signup_otp = "Enter the 6-digit code");
1597
1597
  }
1598
1598
  if (this.resetStep === "confirm") {
1599
- const t = this.otpDigits.join("");
1600
- if ((t.length !== 6 || !/^\d{6}$/.test(t)) && (e.otp = "Enter the 6-digit code"), t.length === 6) {
1599
+ const e = this.otpDigits.join("");
1600
+ if ((e.length !== 6 || !/^\d{6}$/.test(e)) && (t.otp = "Enter the 6-digit code"), e.length === 6) {
1601
1601
  if (!this.newPassword)
1602
- e.new_password = "New password is required";
1602
+ t.new_password = "New password is required";
1603
1603
  else if (this.newPassword.length < 8)
1604
- e.new_password = "Password must be at least 8 characters";
1604
+ t.new_password = "Password must be at least 8 characters";
1605
1605
  else {
1606
- const s = /[A-Z]/.test(this.newPassword), i = /[a-z]/.test(this.newPassword), r = /[0-9]/.test(this.newPassword);
1607
- (!s || !i || !r) && (e.new_password = "Password must contain uppercase, lowercase, and number");
1606
+ const s = /[A-Z]/.test(this.newPassword), r = /[a-z]/.test(this.newPassword), i = /[0-9]/.test(this.newPassword);
1607
+ (!s || !r || !i) && (t.new_password = "Password must contain uppercase, lowercase, and number");
1608
1608
  }
1609
- this.confirmPassword ? this.newPassword !== this.confirmPassword && (e.confirm_password = "Passwords must match") : e.confirm_password = "Please confirm your password";
1609
+ this.confirmPassword ? this.newPassword !== this.confirmPassword && (t.confirm_password = "Passwords must match") : t.confirm_password = "Please confirm your password";
1610
1610
  }
1611
1611
  }
1612
- return this.errors = e, Object.keys(e).length === 0;
1612
+ return this.errors = t, Object.keys(t).length === 0;
1613
1613
  }
1614
1614
  // Form submission
1615
- async handleSubmit(e) {
1616
- if (e.preventDefault(), this.notice = "", this.error = "", !this.hasApiBaseUrl()) {
1615
+ async handleSubmit(t) {
1616
+ if (t.preventDefault(), this.notice = "", this.error = "", !this.hasApiBaseUrl()) {
1617
1617
  this.error = this.baseUrlErrorMessage;
1618
1618
  return;
1619
1619
  }
@@ -1662,65 +1662,65 @@ let f = class extends I {
1662
1662
  }
1663
1663
  }
1664
1664
  }
1665
- setAuthTokens(e, t, s) {
1666
- this.cookies.setAuthToken("ACCESS_TOKEN", e), this.cookies.setAuthToken("AUTH_TOKEN", t), this.cookies.setAuthToken("REFRESH_TOKEN", s), this.isLoggedIn = !0;
1665
+ setAuthTokens(t, e, s) {
1666
+ this.cookies.setAuthToken("ACCESS_TOKEN", t), this.cookies.setAuthToken("AUTH_TOKEN", e), this.cookies.setAuthToken("REFRESH_TOKEN", s), this.isLoggedIn = !0;
1667
1667
  }
1668
1668
  async handleSignIn() {
1669
- const e = {
1669
+ const t = {
1670
1670
  email: this.email.trim(),
1671
1671
  password: this.password
1672
- }, { accessToken: t, idToken: s, refreshToken: i } = await this.getApiService().login(e);
1673
- this.setAuthTokens(t, s, i), this.handleClose();
1672
+ }, { accessToken: e, idToken: s, refreshToken: r } = await this.getApiService().login(t);
1673
+ this.setAuthTokens(e, s, r), this.handleClose();
1674
1674
  }
1675
1675
  isOAuthConfigured() {
1676
1676
  return [this.oauthDomain, this.oauthRegion, this.oauthUserPoolId, this.oauthClientId].every(
1677
- (e) => !!e?.trim()
1677
+ (t) => !!t?.trim()
1678
1678
  );
1679
1679
  }
1680
1680
  getOAuthService() {
1681
1681
  if (!this.isOAuthConfigured())
1682
1682
  return null;
1683
1683
  if (!this.oauthService) {
1684
- const e = this.oauthRedirectUri?.trim() ? this.oauthRedirectUri.trim() : void 0;
1685
- this.oauthService = pe({
1684
+ const t = this.oauthRedirectUri?.trim() ? this.oauthRedirectUri.trim() : void 0;
1685
+ this.oauthService = or({
1686
1686
  domain: this.oauthDomain.trim(),
1687
1687
  cognitoRegion: this.oauthRegion.trim(),
1688
1688
  userPoolId: this.oauthUserPoolId.trim(),
1689
1689
  clientId: this.oauthClientId.trim(),
1690
- redirectUri: e
1690
+ redirectUri: t
1691
1691
  });
1692
1692
  }
1693
1693
  return this.oauthService;
1694
1694
  }
1695
1695
  stripOAuthParamsFromUrl() {
1696
- const e = new URL(window.location.href);
1697
- let t = !1;
1698
- for (const s of fe)
1699
- e.searchParams.has(s) && (e.searchParams.delete(s), t = !0);
1700
- if (t) {
1701
- const s = e.searchParams.toString(), i = `${e.pathname}${s ? `?${s}` : ""}${e.hash}`;
1702
- window.history.replaceState({}, document.title, i);
1696
+ const t = new URL(window.location.href);
1697
+ let e = !1;
1698
+ for (const s of cr)
1699
+ t.searchParams.has(s) && (t.searchParams.delete(s), e = !0);
1700
+ if (e) {
1701
+ const s = t.searchParams.toString(), r = `${t.pathname}${s ? `?${s}` : ""}${t.hash}`;
1702
+ window.history.replaceState({}, document.title, r);
1703
1703
  }
1704
1704
  }
1705
1705
  async handleOAuthCallbackIfPresent() {
1706
- const e = new URLSearchParams(window.location.search), t = e.get("access_token"), s = e.get("id_token"), i = e.get("refresh_token"), r = e.get("code"), o = e.get("state"), a = e.get("error"), c = e.get("error_description");
1707
- if ((t || s || r || a) && !this.hasHandledOAuthCallback) {
1706
+ const t = new URLSearchParams(window.location.search), e = t.get("access_token"), s = t.get("id_token"), r = t.get("refresh_token"), i = t.get("code"), o = t.get("state"), n = t.get("error"), a = t.get("error_description");
1707
+ if ((e || s || i || n) && !this.hasHandledOAuthCallback) {
1708
1708
  if (!this.hasApiBaseUrl()) {
1709
1709
  this.error = this.baseUrlErrorMessage;
1710
1710
  return;
1711
1711
  }
1712
1712
  this.hasHandledOAuthCallback = !0, this.isLoading = !0, this.error = "";
1713
1713
  try {
1714
- if (a)
1715
- throw new Error(c || `OAuth error: ${a}`);
1716
- if (t && s && i) {
1717
- const { accessToken: h, idToken: d, refreshToken: l } = await this.getApiService().login({
1718
- accessToken: t,
1719
- refreshToken: i,
1714
+ if (n)
1715
+ throw new Error(a || `OAuth error: ${n}`);
1716
+ if (e && s && r) {
1717
+ const { accessToken: h, idToken: c, refreshToken: u } = await this.getApiService().login({
1718
+ accessToken: e,
1719
+ refreshToken: r,
1720
1720
  idToken: s
1721
1721
  });
1722
- this.setAuthTokens(h, d, l ?? i);
1723
- } else if (r && o) {
1722
+ this.setAuthTokens(h, c, u ?? r);
1723
+ } else if (i && o) {
1724
1724
  if (!this.isOAuthConfigured())
1725
1725
  throw new Error("OAuth is not configured correctly. Please try again later.");
1726
1726
  const h = this.getOAuthService();
@@ -1728,12 +1728,12 @@ let f = class extends I {
1728
1728
  throw new Error("OAuth is not configured correctly. Please try again later.");
1729
1729
  if (!h.validateState(o))
1730
1730
  throw new Error("Invalid state parameter. Please try signing in again.");
1731
- const d = await h.exchangeCodeForTokens(r), { accessToken: l, idToken: p, refreshToken: u } = await this.getApiService().login({
1732
- accessToken: d.access_token,
1733
- refreshToken: d.refresh_token,
1734
- idToken: d.id_token
1731
+ const c = await h.exchangeCodeForTokens(i), { accessToken: u, idToken: f, refreshToken: y } = await this.getApiService().login({
1732
+ accessToken: c.access_token,
1733
+ refreshToken: c.refresh_token,
1734
+ idToken: c.id_token
1735
1735
  });
1736
- this.setAuthTokens(l, p, u ?? d.refresh_token);
1736
+ this.setAuthTokens(u, f, y ?? c.refresh_token);
1737
1737
  } else
1738
1738
  throw new Error("Missing required OAuth parameters");
1739
1739
  } catch (h) {
@@ -1749,7 +1749,7 @@ let f = class extends I {
1749
1749
  }, 200);
1750
1750
  }
1751
1751
  async handleSignupWithOtp() {
1752
- const e = {
1752
+ const t = {
1753
1753
  email: this.email.trim(),
1754
1754
  password: this.password,
1755
1755
  givenName: this.givenName.trim(),
@@ -1757,36 +1757,36 @@ let f = class extends I {
1757
1757
  code: this.signupOtpDigits.join("")
1758
1758
  };
1759
1759
  await this.getApiService().register({
1760
- email: e.email,
1761
- password: e.password,
1762
- given_name: e.givenName,
1763
- family_name: e.familyName,
1764
- code: e.code
1760
+ email: t.email,
1761
+ password: t.password,
1762
+ given_name: t.givenName,
1763
+ family_name: t.familyName,
1764
+ code: t.code
1765
1765
  }), await this.handleSignIn();
1766
1766
  }
1767
1767
  async handleRequestReset() {
1768
- const e = {
1768
+ const t = {
1769
1769
  email: this.email.trim()
1770
1770
  };
1771
- this.resetStep = "confirm", this.notice = "If an account exists, a 6-digit code has been sent", this.otpDigits = ["", "", "", "", "", ""], await this.getApiService().requestResetPassword(e), setTimeout(() => {
1771
+ this.resetStep = "confirm", this.notice = "If an account exists, a 6-digit code has been sent", this.otpDigits = ["", "", "", "", "", ""], await this.getApiService().requestResetPassword(t), setTimeout(() => {
1772
1772
  this.shadowRoot?.querySelector(".reset-otp-input")?.focus();
1773
1773
  }, 100);
1774
1774
  }
1775
1775
  async handleConfirmReset() {
1776
- const e = {
1776
+ const t = {
1777
1777
  email: this.email.trim(),
1778
1778
  newPassword: this.newPassword,
1779
1779
  otp: this.otpDigits.join("")
1780
1780
  };
1781
1781
  await this.getApiService().resetPassword({
1782
- email: e.email,
1783
- newPassword: e.newPassword,
1784
- otp: e.otp
1782
+ email: t.email,
1783
+ newPassword: t.newPassword,
1784
+ otp: t.otp
1785
1785
  }), await this.handleSignIn();
1786
1786
  }
1787
1787
  async logout() {
1788
- const e = this.cookies.getAuthToken("ACCESS_TOKEN"), t = this.cookies.getAuthToken("AUTH_TOKEN"), s = this.cookies.getAuthToken("REFRESH_TOKEN");
1789
- if (e == null || s == null || t == null) {
1788
+ const t = this.cookies.getAuthToken("ACCESS_TOKEN"), e = this.cookies.getAuthToken("AUTH_TOKEN"), s = this.cookies.getAuthToken("REFRESH_TOKEN");
1789
+ if (t == null || s == null || e == null) {
1790
1790
  this.cookies.clearAllAuthTokens(), this.isLoggedIn = !1;
1791
1791
  return;
1792
1792
  }
@@ -1794,17 +1794,17 @@ let f = class extends I {
1794
1794
  this.error = this.baseUrlErrorMessage;
1795
1795
  return;
1796
1796
  }
1797
- const i = this.getApiService(), {
1798
- redirectUrl: r,
1797
+ const r = this.getApiService(), {
1798
+ redirectUrl: i,
1799
1799
  requiresRedirect: o
1800
- } = await i.logout({
1801
- accessToken: e,
1800
+ } = await r.logout({
1801
+ accessToken: t,
1802
1802
  refreshToken: s,
1803
- authToken: t
1803
+ authToken: e
1804
1804
  });
1805
- if (this.cookies.clearAllAuthTokens(), this.isLoggedIn = !1, o && r) {
1806
- const a = window.location.host;
1807
- new URL(r).host !== a ? window.open(r, "newWindow", "width=400,height=400,resizable=yes,scrollbars=yes,status=yes") : window.location.href = r;
1805
+ if (this.cookies.clearAllAuthTokens(), this.isLoggedIn = !1, o && i) {
1806
+ const n = window.location.host;
1807
+ new URL(i).host !== n ? window.open(i, "newWindow", "width=400,height=400,resizable=yes,scrollbars=yes,status=yes") : window.location.href = i;
1808
1808
  }
1809
1809
  }
1810
1810
  // OAuth handlers
@@ -1814,94 +1814,94 @@ let f = class extends I {
1814
1814
  handleAppleSignIn() {
1815
1815
  this.handleOAuthSignIn("apple");
1816
1816
  }
1817
- handleOAuthSignIn(e) {
1817
+ handleOAuthSignIn(t) {
1818
1818
  if (this.oauthSpaDomain?.trim()) {
1819
- const t = this.oauthSpaDomain.trim(), s = t.startsWith("http://") || t.startsWith("https://") ? t : `https://${t}`, i = s.endsWith("/") ? s.slice(0, -1) : s, r = window.location.href, o = `${i}?return_url=${encodeURIComponent(r)}&provider=${e}`;
1819
+ const e = this.oauthSpaDomain.trim(), s = e.startsWith("http://") || e.startsWith("https://") ? e : `https://${e}`, r = s.endsWith("/") ? s.slice(0, -1) : s, i = window.location.href, o = `${r}?return_url=${encodeURIComponent(i)}&provider=${t}`;
1820
1820
  window.location.href = o;
1821
1821
  return;
1822
1822
  }
1823
- e === "google" ? this.getOAuthService()?.redirectToGoogleAuth() : this.getOAuthService()?.redirectToAppleAuth();
1823
+ t === "google" ? this.getOAuthService()?.redirectToGoogleAuth() : this.getOAuthService()?.redirectToAppleAuth();
1824
1824
  }
1825
1825
  // OTP input handlers
1826
- handleOtpInput(e, t, s) {
1827
- const i = t.target, r = i.value.replace(/\D/g, "");
1828
- if (!r) {
1829
- s ? (this.signupOtpDigits[e] = "", this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[e] = "", this.otpDigits = [...this.otpDigits]);
1826
+ handleOtpInput(t, e, s) {
1827
+ const r = e.target, i = r.value.replace(/\D/g, "");
1828
+ if (!i) {
1829
+ s ? (this.signupOtpDigits[t] = "", this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[t] = "", this.otpDigits = [...this.otpDigits]);
1830
1830
  return;
1831
1831
  }
1832
- const o = r[r.length - 1];
1833
- if (s ? (this.signupOtpDigits[e] = o, this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[e] = o, this.otpDigits = [...this.otpDigits]), e < 5) {
1834
- const a = this.shadowRoot?.querySelector(
1835
- `${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${e + 1}"]`
1832
+ const o = i[i.length - 1];
1833
+ if (s ? (this.signupOtpDigits[t] = o, this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[t] = o, this.otpDigits = [...this.otpDigits]), t < 5) {
1834
+ const n = this.shadowRoot?.querySelector(
1835
+ `${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${t + 1}"]`
1836
1836
  );
1837
- a?.focus(), a?.select();
1837
+ n?.focus(), n?.select();
1838
1838
  } else
1839
- i.blur();
1839
+ r.blur();
1840
1840
  }
1841
- handleOtpKeydown(e, t, s) {
1842
- const i = s ? this.signupOtpDigits : this.otpDigits;
1843
- if (t.key === "Backspace") {
1844
- if (i[e]) {
1845
- s ? (this.signupOtpDigits[e] = "", this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[e] = "", this.otpDigits = [...this.otpDigits]);
1841
+ handleOtpKeydown(t, e, s) {
1842
+ const r = s ? this.signupOtpDigits : this.otpDigits;
1843
+ if (e.key === "Backspace") {
1844
+ if (r[t]) {
1845
+ s ? (this.signupOtpDigits[t] = "", this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[t] = "", this.otpDigits = [...this.otpDigits]);
1846
1846
  return;
1847
1847
  }
1848
- if (e > 0) {
1849
- const r = this.shadowRoot?.querySelector(
1850
- `${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${e - 1}"]`
1848
+ if (t > 0) {
1849
+ const i = this.shadowRoot?.querySelector(
1850
+ `${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${t - 1}"]`
1851
1851
  );
1852
- r?.focus(), r?.select(), s ? (this.signupOtpDigits[e - 1] = "", this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[e - 1] = "", this.otpDigits = [...this.otpDigits]);
1852
+ i?.focus(), i?.select(), s ? (this.signupOtpDigits[t - 1] = "", this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[t - 1] = "", this.otpDigits = [...this.otpDigits]);
1853
1853
  }
1854
1854
  }
1855
- if (t.key === "ArrowLeft" && e > 0) {
1856
- const r = this.shadowRoot?.querySelector(
1857
- `${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${e - 1}"]`
1855
+ if (e.key === "ArrowLeft" && t > 0) {
1856
+ const i = this.shadowRoot?.querySelector(
1857
+ `${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${t - 1}"]`
1858
1858
  );
1859
- r?.focus(), r?.select(), t.preventDefault();
1859
+ i?.focus(), i?.select(), e.preventDefault();
1860
1860
  }
1861
- if (t.key === "ArrowRight" && e < 5) {
1862
- const r = this.shadowRoot?.querySelector(
1863
- `${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${e + 1}"]`
1861
+ if (e.key === "ArrowRight" && t < 5) {
1862
+ const i = this.shadowRoot?.querySelector(
1863
+ `${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${t + 1}"]`
1864
1864
  );
1865
- r?.focus(), r?.select(), t.preventDefault();
1865
+ i?.focus(), i?.select(), e.preventDefault();
1866
1866
  }
1867
- t.key.length === 1 && /\D/.test(t.key) && t.preventDefault();
1867
+ e.key.length === 1 && /\D/.test(e.key) && e.preventDefault();
1868
1868
  }
1869
- handleOtpPaste(e, t) {
1870
- const i = (e.clipboardData?.getData("text") || "").replace(/\D/g, "").slice(0, 6).split("");
1871
- if (i.length === 0) return;
1872
- e.preventDefault();
1869
+ handleOtpPaste(t, e) {
1870
+ const r = (t.clipboardData?.getData("text") || "").replace(/\D/g, "").slice(0, 6).split("");
1871
+ if (r.length === 0) return;
1872
+ t.preventDefault();
1873
1873
  for (let o = 0; o < 6; o++)
1874
- t ? this.signupOtpDigits[o] = i[o] || "" : this.otpDigits[o] = i[o] || "";
1875
- t ? this.signupOtpDigits = [...this.signupOtpDigits] : this.otpDigits = [...this.otpDigits];
1876
- const r = (t ? this.signupOtpDigits : this.otpDigits).findIndex((o) => !o);
1877
- if (r === -1)
1874
+ e ? this.signupOtpDigits[o] = r[o] || "" : this.otpDigits[o] = r[o] || "";
1875
+ e ? this.signupOtpDigits = [...this.signupOtpDigits] : this.otpDigits = [...this.otpDigits];
1876
+ const i = (e ? this.signupOtpDigits : this.otpDigits).findIndex((o) => !o);
1877
+ if (i === -1)
1878
1878
  this.shadowRoot?.querySelector(
1879
- `${t ? ".signup-otp-input" : ".reset-otp-input"}[data-index="5"]`
1879
+ `${e ? ".signup-otp-input" : ".reset-otp-input"}[data-index="5"]`
1880
1880
  )?.blur();
1881
1881
  else {
1882
1882
  const o = this.shadowRoot?.querySelector(
1883
- `${t ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${r}"]`
1883
+ `${e ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${i}"]`
1884
1884
  );
1885
1885
  o?.focus(), o?.select();
1886
1886
  }
1887
1887
  }
1888
1888
  render() {
1889
1889
  if (!this.isVisible)
1890
- return m;
1891
- const e = {
1890
+ return $;
1891
+ const t = {
1892
1892
  "modal-overlay": !0,
1893
1893
  "modal-overlay--closing": this.isClosing
1894
- }, t = {
1894
+ }, e = {
1895
1895
  "modal-container": !0,
1896
1896
  "modal-container--drawer": !0,
1897
1897
  "modal-container--closing": this.isClosing,
1898
1898
  "modal-container--dragging": this.isDragging,
1899
1899
  [`modal-container--${this.size}`]: !0
1900
1900
  };
1901
- return g`
1901
+ return b`
1902
1902
  <!-- Modal/Drawer -->
1903
1903
  <div
1904
- class=${yt(e)}
1904
+ class=${vt(t)}
1905
1905
  @click=${this.handleOverlayClick}
1906
1906
  @touchstart=${this.handleDragStart}
1907
1907
  @touchmove=${this.handleDragMove}
@@ -1909,7 +1909,7 @@ let f = class extends I {
1909
1909
  @mousedown=${this.handleDragStart}
1910
1910
  >
1911
1911
  <div
1912
- class=${yt(t)}
1912
+ class=${vt(e)}
1913
1913
  @click=${(s) => s.stopPropagation()}
1914
1914
  role="dialog"
1915
1915
  aria-modal="true"
@@ -1937,9 +1937,9 @@ let f = class extends I {
1937
1937
  }
1938
1938
  renderContent() {
1939
1939
  if (!this.hasApiBaseUrl()) {
1940
- const e = this.baseUrlErrorMessage;
1941
- return g`
1942
- ${this.logoUrl.length > 0 ? g`
1940
+ const t = this.baseUrlErrorMessage;
1941
+ return b`
1942
+ ${this.logoUrl.length > 0 ? b`
1943
1943
  <header class="modal-header">
1944
1944
  <div class="auth-header">
1945
1945
  <img
@@ -1951,20 +1951,20 @@ let f = class extends I {
1951
1951
  />
1952
1952
  </div>
1953
1953
  </header>
1954
- ` : m}
1954
+ ` : $}
1955
1955
 
1956
1956
  <div class="modal-body">
1957
1957
  <div class="auth-form">
1958
1958
  <div class="alert alert--error">
1959
- ${e}
1959
+ ${t}
1960
1960
  </div>
1961
1961
  </div>
1962
1962
  </div>
1963
1963
  `;
1964
1964
  }
1965
- return this.isLoggedIn ? g`
1965
+ return this.isLoggedIn ? b`
1966
1966
  <!-- Header -->
1967
- ${this.logoUrl.length > 0 ? g`
1967
+ ${this.logoUrl.length > 0 ? b`
1968
1968
  <header class="modal-header">
1969
1969
  <div class="auth-header">
1970
1970
  <img
@@ -1976,7 +1976,7 @@ let f = class extends I {
1976
1976
  />
1977
1977
  </div>
1978
1978
  </header>
1979
- ` : m}
1979
+ ` : $}
1980
1980
 
1981
1981
  <!-- Body -->
1982
1982
  <div class="modal-body">
@@ -1987,9 +1987,9 @@ let f = class extends I {
1987
1987
  ${this.renderAlerts()}
1988
1988
  </div>
1989
1989
  </div>
1990
- ` : g`
1990
+ ` : b`
1991
1991
  <!-- Header -->
1992
- ${(!this.mode || this.resetStep === "none") && this.logoUrl.length > 0 && this.mode === "signin" ? g`
1992
+ ${(!this.mode || this.resetStep === "none") && this.logoUrl.length > 0 && this.mode === "signin" ? b`
1993
1993
  <header class="modal-header">
1994
1994
 
1995
1995
  <div class="auth-header">
@@ -2002,7 +2002,7 @@ let f = class extends I {
2002
2002
  />
2003
2003
  </div>
2004
2004
  </header>
2005
- ` : m}
2005
+ ` : $}
2006
2006
 
2007
2007
  <!-- Body -->
2008
2008
  <div class="modal-body">
@@ -2023,7 +2023,7 @@ let f = class extends I {
2023
2023
  }
2024
2024
  renderFormContent() {
2025
2025
  if (this.resetStep === "none" && (!this.mode || this.mode === "signin" || this.signupStep === "form"))
2026
- return g`
2026
+ return b`
2027
2027
  <!-- Email -->
2028
2028
  <label class="field">
2029
2029
  <span class="field-label">Email Address</span>
@@ -2033,11 +2033,11 @@ let f = class extends I {
2033
2033
  class="field-input ${this.errors.email ? "field-input--error" : ""}"
2034
2034
  placeholder="Enter your email"
2035
2035
  .value=${this.email}
2036
- @input=${(e) => this.email = e.target.value}
2036
+ @input=${(t) => this.email = t.target.value}
2037
2037
  required
2038
2038
  autocomplete="email"
2039
2039
  />
2040
- ${this.errors.email ? g`<span class="field-error">${this.errors.email}</span>` : m}
2040
+ ${this.errors.email ? b`<span class="field-error">${this.errors.email}</span>` : $}
2041
2041
  </label>
2042
2042
 
2043
2043
  <!-- Password -->
@@ -2048,22 +2048,22 @@ let f = class extends I {
2048
2048
  class="field-input ${this.errors.password ? "field-input--error" : ""}"
2049
2049
  placeholder="Enter your password"
2050
2050
  .value=${this.password}
2051
- @input=${(e) => this.password = e.target.value}
2051
+ @input=${(t) => this.password = t.target.value}
2052
2052
  required
2053
2053
  autocomplete=${this.mode === "signup" ? "new-password" : "current-password"}
2054
2054
  />
2055
- ${this.errors.password ? g`<span class="field-error">${this.errors.password}</span>` : m}
2055
+ ${this.errors.password ? b`<span class="field-error">${this.errors.password}</span>` : $}
2056
2056
  </label>
2057
2057
 
2058
- ${this.mode === "signin" && this.error ? g`
2058
+ ${this.mode === "signin" && this.error ? b`
2059
2059
  <div class="forgot-row">
2060
2060
  <button type="button" class="text-btn" @click=${this.startReset}>
2061
2061
  Forgot your password?
2062
2062
  </button>
2063
2063
  </div>
2064
- ` : m}
2064
+ ` : $}
2065
2065
 
2066
- ${this.mode === "signup" ? g`
2066
+ ${this.mode === "signup" ? b`
2067
2067
  <!-- Confirm Password -->
2068
2068
  <label class="field">
2069
2069
  <span class="field-label">Confirm Password</span>
@@ -2072,11 +2072,11 @@ let f = class extends I {
2072
2072
  class="field-input ${this.errors.confirm_password ? "field-input--error" : ""}"
2073
2073
  placeholder="Re-enter your password"
2074
2074
  .value=${this.confirmPassword}
2075
- @input=${(e) => this.confirmPassword = e.target.value}
2075
+ @input=${(t) => this.confirmPassword = t.target.value}
2076
2076
  required
2077
2077
  autocomplete="new-password"
2078
2078
  />
2079
- ${this.errors.confirm_password ? g`<span class="field-error">${this.errors.confirm_password}</span>` : m}
2079
+ ${this.errors.confirm_password ? b`<span class="field-error">${this.errors.confirm_password}</span>` : $}
2080
2080
  </label>
2081
2081
 
2082
2082
  <!-- First Name -->
@@ -2087,11 +2087,11 @@ let f = class extends I {
2087
2087
  class="field-input ${this.errors.givenName ? "field-input--error" : ""}"
2088
2088
  placeholder="Enter your first name"
2089
2089
  .value=${this.givenName}
2090
- @input=${(e) => this.givenName = e.target.value}
2090
+ @input=${(t) => this.givenName = t.target.value}
2091
2091
  required
2092
2092
  autocomplete="given-name"
2093
2093
  />
2094
- ${this.errors.givenName ? g`<span class="field-error">${this.errors.givenName}</span>` : m}
2094
+ ${this.errors.givenName ? b`<span class="field-error">${this.errors.givenName}</span>` : $}
2095
2095
  </label>
2096
2096
 
2097
2097
  <!-- Last Name -->
@@ -2102,40 +2102,40 @@ let f = class extends I {
2102
2102
  class="field-input ${this.errors.familyName ? "field-input--error" : ""}"
2103
2103
  placeholder="Enter your last name"
2104
2104
  .value=${this.familyName}
2105
- @input=${(e) => this.familyName = e.target.value}
2105
+ @input=${(t) => this.familyName = t.target.value}
2106
2106
  required
2107
2107
  autocomplete="family-name"
2108
2108
  />
2109
- ${this.errors.familyName ? g`<span class="field-error">${this.errors.familyName}</span>` : m}
2109
+ ${this.errors.familyName ? b`<span class="field-error">${this.errors.familyName}</span>` : $}
2110
2110
  </label>
2111
- ` : m}
2111
+ ` : $}
2112
2112
  `;
2113
2113
  if (this.mode === "signup" && this.signupStep === "otp")
2114
- return g`
2114
+ return b`
2115
2115
  <div class="otp-section">
2116
2116
  <label class="otp-label">Enter 6-digit code</label>
2117
2117
  <div class="otp-inputs" role="group" aria-label="One time code">
2118
- ${$t(
2119
- Array.from({ length: 6 }, (e, t) => t),
2120
- (e) => e,
2121
- (e) => g`
2118
+ ${Tt(
2119
+ Array.from({ length: 6 }, (t, e) => e),
2120
+ (t) => t,
2121
+ (t) => b`
2122
2122
  <input
2123
2123
  class="otp-input signup-otp-input ${this.errors.signup_otp ? "otp-input--error" : ""}"
2124
2124
  type="text"
2125
2125
  inputmode="numeric"
2126
2126
  pattern="[0-9]*"
2127
2127
  maxlength="1"
2128
- data-index="${e}"
2129
- .value=${this.signupOtpDigits[e]}
2130
- @input=${(t) => this.handleOtpInput(e, t, !0)}
2131
- @keydown=${(t) => this.handleOtpKeydown(e, t, !0)}
2132
- @paste=${(t) => this.handleOtpPaste(t, !0)}
2133
- aria-label="Digit ${e + 1}"
2128
+ data-index="${t}"
2129
+ .value=${this.signupOtpDigits[t]}
2130
+ @input=${(e) => this.handleOtpInput(t, e, !0)}
2131
+ @keydown=${(e) => this.handleOtpKeydown(t, e, !0)}
2132
+ @paste=${(e) => this.handleOtpPaste(e, !0)}
2133
+ aria-label="Digit ${t + 1}"
2134
2134
  />
2135
2135
  `
2136
2136
  )}
2137
2137
  </div>
2138
- ${this.errors.signup_otp ? g`<p class="otp-error">${this.errors.signup_otp}</p>` : m}
2138
+ ${this.errors.signup_otp ? b`<p class="otp-error">${this.errors.signup_otp}</p>` : $}
2139
2139
  </div>
2140
2140
  <div class="forgot-row">
2141
2141
  <button type="button" class="text-btn" @click=${this.backToSignupForm}>
@@ -2144,7 +2144,7 @@ let f = class extends I {
2144
2144
  </div>
2145
2145
  `;
2146
2146
  if (this.resetStep === "request")
2147
- return g`
2147
+ return b`
2148
2148
  <label class="field">
2149
2149
  <span class="field-label">Email Address</span>
2150
2150
  <input
@@ -2153,11 +2153,11 @@ let f = class extends I {
2153
2153
  class="field-input ${this.errors.email ? "field-input--error" : ""}"
2154
2154
  placeholder="Enter your email"
2155
2155
  .value=${this.email}
2156
- @input=${(e) => this.email = e.target.value}
2156
+ @input=${(t) => this.email = t.target.value}
2157
2157
  required
2158
2158
  autocomplete="email"
2159
2159
  />
2160
- ${this.errors.email ? g`<span class="field-error">${this.errors.email}</span>` : m}
2160
+ ${this.errors.email ? b`<span class="field-error">${this.errors.email}</span>` : $}
2161
2161
  </label>
2162
2162
  <div class="forgot-row">
2163
2163
  <button type="button" class="text-btn" @click=${this.cancelReset}>
@@ -2166,8 +2166,8 @@ let f = class extends I {
2166
2166
  </div>
2167
2167
  `;
2168
2168
  if (this.resetStep === "confirm") {
2169
- const e = this.otpDigits.every((t) => /^\d$/.test(t));
2170
- return g`
2169
+ const t = this.otpDigits.every((e) => /^\d$/.test(e));
2170
+ return b`
2171
2171
  <label class="field">
2172
2172
  <span class="field-label">Email Address</span>
2173
2173
  <input
@@ -2175,40 +2175,40 @@ let f = class extends I {
2175
2175
  class="field-input ${this.errors.email ? "field-input--error" : ""}"
2176
2176
  placeholder="Enter your email"
2177
2177
  .value=${this.email}
2178
- @input=${(t) => this.email = t.target.value}
2178
+ @input=${(e) => this.email = e.target.value}
2179
2179
  required
2180
2180
  autocomplete="email"
2181
2181
  />
2182
- ${this.errors.email ? g`<span class="field-error">${this.errors.email}</span>` : m}
2182
+ ${this.errors.email ? b`<span class="field-error">${this.errors.email}</span>` : $}
2183
2183
  </label>
2184
2184
 
2185
2185
  <div class="otp-section">
2186
2186
  <label class="otp-label">Enter 6-digit code</label>
2187
2187
  <div class="otp-inputs" role="group" aria-label="One time code">
2188
- ${$t(
2189
- Array.from({ length: 6 }, (t, s) => s),
2190
- (t) => t,
2191
- (t) => g`
2188
+ ${Tt(
2189
+ Array.from({ length: 6 }, (e, s) => s),
2190
+ (e) => e,
2191
+ (e) => b`
2192
2192
  <input
2193
2193
  class="otp-input reset-otp-input ${this.errors.otp ? "otp-input--error" : ""}"
2194
2194
  type="text"
2195
2195
  inputmode="numeric"
2196
2196
  pattern="[0-9]*"
2197
2197
  maxlength="1"
2198
- data-index="${t}"
2199
- .value=${this.otpDigits[t]}
2200
- @input=${(s) => this.handleOtpInput(t, s, !1)}
2201
- @keydown=${(s) => this.handleOtpKeydown(t, s, !1)}
2198
+ data-index="${e}"
2199
+ .value=${this.otpDigits[e]}
2200
+ @input=${(s) => this.handleOtpInput(e, s, !1)}
2201
+ @keydown=${(s) => this.handleOtpKeydown(e, s, !1)}
2202
2202
  @paste=${(s) => this.handleOtpPaste(s, !1)}
2203
- aria-label="Digit ${t + 1}"
2203
+ aria-label="Digit ${e + 1}"
2204
2204
  />
2205
2205
  `
2206
2206
  )}
2207
2207
  </div>
2208
- ${this.errors.otp ? g`<p class="otp-error">${this.errors.otp}</p>` : m}
2208
+ ${this.errors.otp ? b`<p class="otp-error">${this.errors.otp}</p>` : $}
2209
2209
  </div>
2210
2210
 
2211
- ${e ? g`
2211
+ ${t ? b`
2212
2212
  <div class="new-password-fields">
2213
2213
  <label class="field">
2214
2214
  <span class="field-label">New Password</span>
@@ -2217,11 +2217,11 @@ let f = class extends I {
2217
2217
  class="field-input ${this.errors.new_password ? "field-input--error" : ""}"
2218
2218
  placeholder="Enter your new password"
2219
2219
  .value=${this.newPassword}
2220
- @input=${(t) => this.newPassword = t.target.value}
2220
+ @input=${(e) => this.newPassword = e.target.value}
2221
2221
  required
2222
2222
  autocomplete="new-password"
2223
2223
  />
2224
- ${this.errors.new_password ? g`<span class="field-error">${this.errors.new_password}</span>` : m}
2224
+ ${this.errors.new_password ? b`<span class="field-error">${this.errors.new_password}</span>` : $}
2225
2225
  </label>
2226
2226
 
2227
2227
  <label class="field">
@@ -2231,14 +2231,14 @@ let f = class extends I {
2231
2231
  class="field-input ${this.errors.confirm_password ? "field-input--error" : ""}"
2232
2232
  placeholder="Re-enter your new password"
2233
2233
  .value=${this.confirmPassword}
2234
- @input=${(t) => this.confirmPassword = t.target.value}
2234
+ @input=${(e) => this.confirmPassword = e.target.value}
2235
2235
  required
2236
2236
  autocomplete="new-password"
2237
2237
  />
2238
- ${this.errors.confirm_password ? g`<span class="field-error">${this.errors.confirm_password}</span>` : m}
2238
+ ${this.errors.confirm_password ? b`<span class="field-error">${this.errors.confirm_password}</span>` : $}
2239
2239
  </label>
2240
2240
  </div>
2241
- ` : m}
2241
+ ` : $}
2242
2242
 
2243
2243
  <div class="forgot-row">
2244
2244
  <button type="button" class="text-btn" @click=${this.backToRequest}>
@@ -2247,35 +2247,35 @@ let f = class extends I {
2247
2247
  </div>
2248
2248
  `;
2249
2249
  }
2250
- return m;
2250
+ return $;
2251
2251
  }
2252
2252
  renderActions() {
2253
2253
  if (this.resetStep === "request")
2254
- return g`
2254
+ return b`
2255
2255
  <button type="submit" class="cta" ?disabled=${this.isLoading}>
2256
2256
  ${this.isLoading ? "Sending..." : "Send Reset Code"}
2257
2257
  </button>
2258
2258
  `;
2259
2259
  if (this.resetStep === "confirm")
2260
- return this.otpDigits.every((t) => /^\d$/.test(t)) ? g`
2260
+ return this.otpDigits.every((e) => /^\d$/.test(e)) ? b`
2261
2261
  <button type="submit" class="cta" ?disabled=${this.isLoading}>
2262
2262
  ${this.isLoading ? "Resetting..." : "Reset Password"}
2263
2263
  </button>
2264
- ` : m;
2264
+ ` : $;
2265
2265
  if (this.mode === "signup" && this.signupStep === "otp") {
2266
- const e = this.signupOtpDigits.every((t) => /^\d$/.test(t));
2267
- return g`
2268
- <button type="submit" class="cta" ?disabled=${!e || this.isLoading}>
2266
+ const t = this.signupOtpDigits.every((e) => /^\d$/.test(e));
2267
+ return b`
2268
+ <button type="submit" class="cta" ?disabled=${!t || this.isLoading}>
2269
2269
  ${this.isLoading ? "Completing..." : "Complete Registration"}
2270
2270
  </button>
2271
2271
  `;
2272
2272
  }
2273
- return g`
2273
+ return b`
2274
2274
  <button type="submit" class="cta" ?disabled=${this.isLoading}>
2275
2275
  ${this.isLoading ? "Loading..." : this.mode === "signup" ? "Continue" : "Sign In"}
2276
2276
  </button>
2277
2277
 
2278
- ${this.isOAuthConfigured() && this.mode === "signin" ? g`
2278
+ ${this.isOAuthConfigured() && this.mode === "signin" ? b`
2279
2279
  <div class="button-row">
2280
2280
  <button
2281
2281
  type="button"
@@ -2295,31 +2295,31 @@ let f = class extends I {
2295
2295
  ${this.renderAppleIcon()}
2296
2296
  </button>
2297
2297
  </div>
2298
- ` : m}
2298
+ ` : $}
2299
2299
  `;
2300
2300
  }
2301
2301
  renderAlerts() {
2302
- return g`
2303
- ${this.notice ? g`
2302
+ return b`
2303
+ ${this.notice ? b`
2304
2304
  <div class="alert alert--success">
2305
2305
  ${this.notice}
2306
2306
  <button class="alert-close" @click=${() => this.notice = ""} aria-label="Dismiss">
2307
2307
  ×
2308
2308
  </button>
2309
2309
  </div>
2310
- ` : m}
2311
- ${this.error ? g`
2310
+ ` : $}
2311
+ ${this.error ? b`
2312
2312
  <div class="alert alert--error">
2313
2313
  ${this.error}
2314
2314
  <button class="alert-close" @click=${() => this.error = ""} aria-label="Dismiss">
2315
2315
  ×
2316
2316
  </button>
2317
2317
  </div>
2318
- ` : m}
2318
+ ` : $}
2319
2319
  `;
2320
2320
  }
2321
2321
  renderFooter() {
2322
- return this.isLoggedIn ? m : this.resetStep === "none" && (!this.mode || this.mode === "signin" || this.signupStep === "form") ? g`
2322
+ return this.isLoggedIn ? $ : this.resetStep === "none" && (!this.mode || this.mode === "signin" || this.signupStep === "form") ? b`
2323
2323
  <div class="auth-footer">
2324
2324
  <p class="toggle-text">
2325
2325
  ${this.mode === "signup" ? "Already have an account?" : "Don't have an account?"}
@@ -2328,7 +2328,7 @@ let f = class extends I {
2328
2328
  ${this.mode === "signup" ? "Sign In" : "Sign Up"}
2329
2329
  </button>
2330
2330
  </div>
2331
- ` : g`
2331
+ ` : b`
2332
2332
  <div class="auth-footer">
2333
2333
  <p class="toggle-text">
2334
2334
  Having trouble? Email
@@ -2338,7 +2338,7 @@ let f = class extends I {
2338
2338
  `;
2339
2339
  }
2340
2340
  renderGoogleIcon() {
2341
- return g`
2341
+ return b`
2342
2342
  <svg viewBox="-0.5 0 48 48" width="18" height="18" fill="none">
2343
2343
  <path d="M9.82727273,24 C9.82727273,22.4757333 10.0804318,21.0144 10.5322727,19.6437333 L2.62345455,13.6042667 C1.08206818,16.7338667 0.213636364,20.2602667 0.213636364,24 C0.213636364,27.7365333 1.081,31.2608 2.62025,34.3882667 L10.5247955,28.3370667 C10.0772273,26.9728 9.82727273,25.5168 9.82727273,24" fill="#FBBC05"></path>
2344
2344
  <path d="M23.7136364,10.1333333 C27.025,10.1333333 30.0159091,11.3066667 32.3659091,13.2266667 L39.2022727,6.4 C35.0363636,2.77333333 29.6954545,0.533333333 23.7136364,0.533333333 C14.4268636,0.533333333 6.44540909,5.84426667 2.62345455,13.6042667 L10.5322727,19.6437333 C12.3545909,14.112 17.5491591,10.1333333 23.7136364,10.1333333" fill="#EB4335"></path>
@@ -2348,18 +2348,18 @@ let f = class extends I {
2348
2348
  `;
2349
2349
  }
2350
2350
  renderAppleIcon() {
2351
- return g`
2351
+ return b`
2352
2352
  <svg viewBox="-3.5 0 48 48" width="18" height="18" class="apple-icon">
2353
2353
  <path d="M231.174735,567.792499 C232.740177,565.771699 233.926883,562.915484 233.497649,560 C230.939077,560.177808 227.948466,561.814769 226.203475,563.948463 C224.612784,565.88177 223.305444,568.757742 223.816036,571.549042 C226.613071,571.636535 229.499881,569.960061 231.174735,567.792499 L231.174735,567.792499 Z M245,595.217241 C243.880625,597.712195 243.341978,598.827022 241.899976,601.03692 C239.888467,604.121745 237.052156,607.962958 233.53412,607.991182 C230.411652,608.02505 229.606488,605.94498 225.367451,605.970382 C221.128414,605.99296 220.244696,608.030695 217.116618,607.999649 C213.601387,607.968603 210.913765,604.502761 208.902256,601.417937 C203.27452,592.79849 202.68257,582.680377 206.152914,577.298162 C208.621711,573.476705 212.515678,571.241407 216.173986,571.241407 C219.89682,571.241407 222.239372,573.296075 225.322563,573.296075 C228.313175,573.296075 230.133913,571.235762 234.440281,571.235762 C237.700215,571.235762 241.153726,573.022307 243.611302,576.10431 C235.554045,580.546683 236.85858,592.121127 245,595.217241 L245,595.217241 Z" transform="translate(-204.000000, -560.000000)" fill="#0b0b0a"></path>
2354
2354
  </svg>
2355
2355
  `;
2356
2356
  }
2357
2357
  // Public methods for external control
2358
- setError(e) {
2359
- this.error = e;
2358
+ setError(t) {
2359
+ this.error = t;
2360
2360
  }
2361
- setNotice(e) {
2362
- this.notice = e;
2361
+ setNotice(t) {
2362
+ this.notice = t;
2363
2363
  }
2364
2364
  closeModal() {
2365
2365
  this.handleClose();
@@ -2373,151 +2373,151 @@ let f = class extends I {
2373
2373
  this.error = this.baseUrlErrorMessage;
2374
2374
  return;
2375
2375
  }
2376
- const e = this.cookies.getAuthToken("REFRESH_TOKEN"), t = this.cookies.getAuthToken("ACCESS_TOKEN"), s = this.cookies.getAuthToken("AUTH_TOKEN");
2377
- if (!e || !t || !s) {
2376
+ const t = this.cookies.getAuthToken("REFRESH_TOKEN"), e = this.cookies.getAuthToken("ACCESS_TOKEN"), s = this.cookies.getAuthToken("AUTH_TOKEN");
2377
+ if (!t || !e || !s) {
2378
2378
  this.cookies.clearAllAuthTokens(), this.isLoggedIn = !1;
2379
2379
  return;
2380
2380
  }
2381
- const { accessToken: i, idToken: r, refreshToken: o } = await this.getApiService().refresh({
2382
- refreshToken: e
2381
+ const { accessToken: r, idToken: i, refreshToken: o } = await this.getApiService().refresh({
2382
+ refreshToken: t
2383
2383
  });
2384
- this.cookies.setAuthToken("ACCESS_TOKEN", i), this.cookies.setAuthToken("AUTH_TOKEN", r), this.cookies.setAuthToken("REFRESH_TOKEN", o ?? e);
2384
+ this.cookies.setAuthToken("ACCESS_TOKEN", r), this.cookies.setAuthToken("AUTH_TOKEN", i), this.cookies.setAuthToken("REFRESH_TOKEN", o ?? t);
2385
2385
  } catch {
2386
2386
  this.cookies.clearAllAuthTokens(), this.isLoggedIn = !1;
2387
2387
  }
2388
2388
  }
2389
2389
  };
2390
- f.styles = ue();
2391
- y([
2392
- A({ type: Boolean, reflect: !0 })
2393
- ], f.prototype, "open", 2);
2394
- y([
2395
- A({ type: String, attribute: "initial-mode" })
2396
- ], f.prototype, "initialMode", 2);
2397
- y([
2398
- A({ type: String, attribute: "logo-url" })
2399
- ], f.prototype, "logoUrl", 2);
2400
- y([
2401
- A({ type: String, attribute: "api-domain" })
2402
- ], f.prototype, "baseUrl", 2);
2403
- y([
2404
- A({ type: String, attribute: "oauth-domain" })
2405
- ], f.prototype, "oauthDomain", 2);
2406
- y([
2407
- A({ type: String, attribute: "oauth-region" })
2408
- ], f.prototype, "oauthRegion", 2);
2409
- y([
2410
- A({ type: String, attribute: "oauth-user-pool-id" })
2411
- ], f.prototype, "oauthUserPoolId", 2);
2412
- y([
2413
- A({ type: String, attribute: "oauth-client-id" })
2414
- ], f.prototype, "oauthClientId", 2);
2415
- y([
2416
- A({ type: String, attribute: "oauth-redirect-uri" })
2417
- ], f.prototype, "oauthRedirectUri", 2);
2418
- y([
2419
- A({ type: String, attribute: "oauth-spa-domain" })
2420
- ], f.prototype, "oauthSpaDomain", 2);
2421
- y([
2422
- A({ type: String, attribute: "size" })
2423
- ], f.prototype, "size", 2);
2424
- y([
2425
- A({ type: String, attribute: "data-theme", reflect: !0 })
2426
- ], f.prototype, "theme", 2);
2427
- y([
2428
- $()
2429
- ], f.prototype, "mode", 2);
2430
- y([
2431
- $()
2432
- ], f.prototype, "resetStep", 2);
2433
- y([
2434
- $()
2435
- ], f.prototype, "signupStep", 2);
2436
- y([
2437
- $()
2438
- ], f.prototype, "isLoading", 2);
2439
- y([
2440
- $()
2441
- ], f.prototype, "isClosing", 2);
2442
- y([
2443
- $()
2444
- ], f.prototype, "isVisible", 2);
2445
- y([
2446
- $()
2447
- ], f.prototype, "isLoggedIn", 2);
2448
- y([
2449
- $()
2450
- ], f.prototype, "email", 2);
2451
- y([
2452
- $()
2453
- ], f.prototype, "password", 2);
2454
- y([
2455
- $()
2456
- ], f.prototype, "givenName", 2);
2457
- y([
2458
- $()
2459
- ], f.prototype, "familyName", 2);
2460
- y([
2461
- $()
2462
- ], f.prototype, "newPassword", 2);
2463
- y([
2464
- $()
2465
- ], f.prototype, "confirmPassword", 2);
2466
- y([
2467
- $()
2468
- ], f.prototype, "notice", 2);
2469
- y([
2470
- $()
2471
- ], f.prototype, "error", 2);
2472
- y([
2473
- $()
2474
- ], f.prototype, "errors", 2);
2475
- y([
2476
- $()
2477
- ], f.prototype, "otpDigits", 2);
2478
- y([
2479
- $()
2480
- ], f.prototype, "signupOtpDigits", 2);
2481
- y([
2482
- $()
2483
- ], f.prototype, "isDragging", 2);
2484
- y([
2485
- $()
2486
- ], f.prototype, "dragStartY", 2);
2487
- y([
2488
- $()
2489
- ], f.prototype, "dragCurrentY", 2);
2490
- y([
2491
- $()
2492
- ], f.prototype, "dragStartTime", 2);
2493
- y([
2494
- $()
2495
- ], f.prototype, "lastDragEndTime", 2);
2496
- y([
2497
- ot(".modal-container")
2498
- ], f.prototype, "modalContainer", 2);
2499
- y([
2500
- ot("#email-input")
2501
- ], f.prototype, "emailInput", 2);
2502
- y([
2503
- ot(".modal-body")
2504
- ], f.prototype, "modalBody", 2);
2505
- f = y([
2506
- xt("auth")
2507
- ], f);
2508
- var ye = Object.defineProperty, we = Object.getOwnPropertyDescriptor, M = (e, t, s, i) => {
2509
- for (var r = i > 1 ? void 0 : i ? we(t, s) : t, o = e.length - 1, a; o >= 0; o--)
2510
- (a = e[o]) && (r = (i ? a(t, s, r) : a(r)) || r);
2511
- return i && r && ye(t, s, r), r;
2390
+ A.styles = nr();
2391
+ v([
2392
+ O({ type: Boolean, reflect: !0 })
2393
+ ], A.prototype, "open", 2);
2394
+ v([
2395
+ O({ type: String, attribute: "initial-mode" })
2396
+ ], A.prototype, "initialMode", 2);
2397
+ v([
2398
+ O({ type: String, attribute: "logo-url" })
2399
+ ], A.prototype, "logoUrl", 2);
2400
+ v([
2401
+ O({ type: String, attribute: "api-domain" })
2402
+ ], A.prototype, "baseUrl", 2);
2403
+ v([
2404
+ O({ type: String, attribute: "oauth-domain" })
2405
+ ], A.prototype, "oauthDomain", 2);
2406
+ v([
2407
+ O({ type: String, attribute: "oauth-region" })
2408
+ ], A.prototype, "oauthRegion", 2);
2409
+ v([
2410
+ O({ type: String, attribute: "oauth-user-pool-id" })
2411
+ ], A.prototype, "oauthUserPoolId", 2);
2412
+ v([
2413
+ O({ type: String, attribute: "oauth-client-id" })
2414
+ ], A.prototype, "oauthClientId", 2);
2415
+ v([
2416
+ O({ type: String, attribute: "oauth-redirect-uri" })
2417
+ ], A.prototype, "oauthRedirectUri", 2);
2418
+ v([
2419
+ O({ type: String, attribute: "oauth-spa-domain" })
2420
+ ], A.prototype, "oauthSpaDomain", 2);
2421
+ v([
2422
+ O({ type: String, attribute: "size" })
2423
+ ], A.prototype, "size", 2);
2424
+ v([
2425
+ O({ type: String, attribute: "data-theme", reflect: !0 })
2426
+ ], A.prototype, "theme", 2);
2427
+ v([
2428
+ T()
2429
+ ], A.prototype, "mode", 2);
2430
+ v([
2431
+ T()
2432
+ ], A.prototype, "resetStep", 2);
2433
+ v([
2434
+ T()
2435
+ ], A.prototype, "signupStep", 2);
2436
+ v([
2437
+ T()
2438
+ ], A.prototype, "isLoading", 2);
2439
+ v([
2440
+ T()
2441
+ ], A.prototype, "isClosing", 2);
2442
+ v([
2443
+ T()
2444
+ ], A.prototype, "isVisible", 2);
2445
+ v([
2446
+ T()
2447
+ ], A.prototype, "isLoggedIn", 2);
2448
+ v([
2449
+ T()
2450
+ ], A.prototype, "email", 2);
2451
+ v([
2452
+ T()
2453
+ ], A.prototype, "password", 2);
2454
+ v([
2455
+ T()
2456
+ ], A.prototype, "givenName", 2);
2457
+ v([
2458
+ T()
2459
+ ], A.prototype, "familyName", 2);
2460
+ v([
2461
+ T()
2462
+ ], A.prototype, "newPassword", 2);
2463
+ v([
2464
+ T()
2465
+ ], A.prototype, "confirmPassword", 2);
2466
+ v([
2467
+ T()
2468
+ ], A.prototype, "notice", 2);
2469
+ v([
2470
+ T()
2471
+ ], A.prototype, "error", 2);
2472
+ v([
2473
+ T()
2474
+ ], A.prototype, "errors", 2);
2475
+ v([
2476
+ T()
2477
+ ], A.prototype, "otpDigits", 2);
2478
+ v([
2479
+ T()
2480
+ ], A.prototype, "signupOtpDigits", 2);
2481
+ v([
2482
+ T()
2483
+ ], A.prototype, "isDragging", 2);
2484
+ v([
2485
+ T()
2486
+ ], A.prototype, "dragStartY", 2);
2487
+ v([
2488
+ T()
2489
+ ], A.prototype, "dragCurrentY", 2);
2490
+ v([
2491
+ T()
2492
+ ], A.prototype, "dragStartTime", 2);
2493
+ v([
2494
+ T()
2495
+ ], A.prototype, "lastDragEndTime", 2);
2496
+ v([
2497
+ tt(".modal-container")
2498
+ ], A.prototype, "modalContainer", 2);
2499
+ v([
2500
+ tt("#email-input")
2501
+ ], A.prototype, "emailInput", 2);
2502
+ v([
2503
+ tt(".modal-body")
2504
+ ], A.prototype, "modalBody", 2);
2505
+ A = v([
2506
+ Gt("auth")
2507
+ ], A);
2508
+ var hr = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, ie = (t, e, s, r) => {
2509
+ for (var i = r > 1 ? void 0 : r ? dr(e, s) : e, o = t.length - 1, n; o >= 0; o--)
2510
+ (n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
2511
+ return r && i && hr(e, s, i), i;
2512
2512
  };
2513
- let E = class extends I {
2513
+ let M = class extends ee {
2514
2514
  constructor() {
2515
2515
  super(...arguments), this.theme = "light", this.storageKey = "theme-preference", this.size = "sm", this.variant = "ghost", this.isDark = !1;
2516
2516
  }
2517
2517
  connectedCallback() {
2518
2518
  super.connectedCallback();
2519
- const e = localStorage.getItem(this.storageKey), t = window.matchMedia("(prefers-color-scheme: dark)").matches;
2520
- e ? this.theme = e : this.theme === "light" && t && (this.theme = "dark"), this.isDark = this.theme === "dark", this.applyTheme();
2519
+ const t = localStorage.getItem(this.storageKey), e = window.matchMedia("(prefers-color-scheme: dark)").matches;
2520
+ t ? this.theme = t : this.theme === "light" && e && (this.theme = "dark"), this.isDark = this.theme === "dark", this.applyTheme();
2521
2521
  }
2522
2522
  applyTheme() {
2523
2523
  document.documentElement.setAttribute("data-theme", this.theme), localStorage.setItem(this.storageKey, this.theme), this.dispatchEvent(
@@ -2532,31 +2532,31 @@ let E = class extends I {
2532
2532
  this.theme = this.isDark ? "light" : "dark", this.isDark = !this.isDark, this.applyTheme();
2533
2533
  }
2534
2534
  getSizeClass() {
2535
- const e = {
2535
+ const t = {
2536
2536
  sm: "btn--sm",
2537
2537
  md: "btn--md",
2538
2538
  lg: "btn--lg"
2539
2539
  };
2540
- return e[this.size] || e.sm;
2540
+ return t[this.size] || t.sm;
2541
2541
  }
2542
2542
  getVariantClass() {
2543
- const e = {
2543
+ const t = {
2544
2544
  ghost: "btn--ghost",
2545
2545
  outline: "btn--outline",
2546
2546
  solid: "btn--solid"
2547
2547
  };
2548
- return e[this.variant] || e.ghost;
2548
+ return t[this.variant] || t.ghost;
2549
2549
  }
2550
2550
  render() {
2551
- const e = this.isDark ? "Switch to light mode" : "Switch to dark mode";
2552
- return g`
2551
+ const t = this.isDark ? "Switch to light mode" : "Switch to dark mode";
2552
+ return b`
2553
2553
  <button
2554
2554
  class="theme-toggle ${this.getSizeClass()} ${this.getVariantClass()}"
2555
2555
  @click=${this.toggleTheme}
2556
- aria-label=${e}
2556
+ aria-label=${t}
2557
2557
  type="button"
2558
2558
  >
2559
- ${this.isDark ? g`
2559
+ ${this.isDark ? b`
2560
2560
  <svg
2561
2561
  viewBox="0 0 20 20"
2562
2562
  fill="currentColor"
@@ -2569,7 +2569,7 @@ let E = class extends I {
2569
2569
  clip-rule="evenodd"
2570
2570
  />
2571
2571
  </svg>
2572
- ` : g`
2572
+ ` : b`
2573
2573
  <svg
2574
2574
  viewBox="0 0 20 20"
2575
2575
  fill="currentColor"
@@ -2580,12 +2580,12 @@ let E = class extends I {
2580
2580
  </svg>
2581
2581
  `}
2582
2582
 
2583
- <span class="sr-only">${e}</span>
2583
+ <span class="sr-only">${t}</span>
2584
2584
  </button>
2585
2585
  `;
2586
2586
  }
2587
2587
  };
2588
- E.styles = At`
2588
+ M.styles = Kt`
2589
2589
  :host {
2590
2590
  display: inline-block;
2591
2591
  }
@@ -2704,25 +2704,1833 @@ E.styles = At`
2704
2704
  }
2705
2705
  }
2706
2706
  `;
2707
- M([
2708
- A({ type: String, reflect: !0 })
2709
- ], E.prototype, "theme", 2);
2710
- M([
2711
- A({ type: String, attribute: "storage-key" })
2712
- ], E.prototype, "storageKey", 2);
2713
- M([
2714
- A({ type: String, attribute: "size" })
2715
- ], E.prototype, "size", 2);
2716
- M([
2717
- A({ type: String, attribute: "variant" })
2718
- ], E.prototype, "variant", 2);
2719
- M([
2720
- $()
2721
- ], E.prototype, "isDark", 2);
2722
- E = M([
2723
- xt("cals-theme-toggle")
2724
- ], E);
2707
+ ie([
2708
+ O({ type: String, reflect: !0 })
2709
+ ], M.prototype, "theme", 2);
2710
+ ie([
2711
+ O({ type: String, attribute: "storage-key" })
2712
+ ], M.prototype, "storageKey", 2);
2713
+ ie([
2714
+ O({ type: String, attribute: "size" })
2715
+ ], M.prototype, "size", 2);
2716
+ ie([
2717
+ O({ type: String, attribute: "variant" })
2718
+ ], M.prototype, "variant", 2);
2719
+ ie([
2720
+ T()
2721
+ ], M.prototype, "isDark", 2);
2722
+ M = ie([
2723
+ Gt("cals-theme-toggle")
2724
+ ], M);
2725
+ function ss(t, e) {
2726
+ return function() {
2727
+ return t.apply(e, arguments);
2728
+ };
2729
+ }
2730
+ const { toString: ur } = Object.prototype, { getPrototypeOf: st } = Object, { iterator: Pe, toStringTag: rs } = Symbol, De = /* @__PURE__ */ ((t) => (e) => {
2731
+ const s = ur.call(e);
2732
+ return t[s] || (t[s] = s.slice(8, -1).toLowerCase());
2733
+ })(/* @__PURE__ */ Object.create(null)), N = (t) => (t = t.toLowerCase(), (e) => De(e) === t), Ue = (t) => (e) => typeof e === t, { isArray: oe } = Array, se = Ue("undefined");
2734
+ function me(t) {
2735
+ return t !== null && !se(t) && t.constructor !== null && !se(t.constructor) && P(t.constructor.isBuffer) && t.constructor.isBuffer(t);
2736
+ }
2737
+ const is = N("ArrayBuffer");
2738
+ function pr(t) {
2739
+ let e;
2740
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && is(t.buffer), e;
2741
+ }
2742
+ const fr = Ue("string"), P = Ue("function"), os = Ue("number"), ge = (t) => t !== null && typeof t == "object", mr = (t) => t === !0 || t === !1, Ee = (t) => {
2743
+ if (De(t) !== "object")
2744
+ return !1;
2745
+ const e = st(t);
2746
+ return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(rs in t) && !(Pe in t);
2747
+ }, gr = (t) => {
2748
+ if (!ge(t) || me(t))
2749
+ return !1;
2750
+ try {
2751
+ return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype;
2752
+ } catch {
2753
+ return !1;
2754
+ }
2755
+ }, yr = N("Date"), wr = N("File"), br = N("Blob"), $r = N("FileList"), Sr = (t) => ge(t) && P(t.pipe), Ar = (t) => {
2756
+ let e;
2757
+ return t && (typeof FormData == "function" && t instanceof FormData || P(t.append) && ((e = De(t)) === "formdata" || // detect form-data instance
2758
+ e === "object" && P(t.toString) && t.toString() === "[object FormData]"));
2759
+ }, vr = N("URLSearchParams"), [Er, _r, Tr, kr] = ["ReadableStream", "Request", "Response", "Headers"].map(N), Cr = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
2760
+ function ye(t, e, { allOwnKeys: s = !1 } = {}) {
2761
+ if (t === null || typeof t > "u")
2762
+ return;
2763
+ let r, i;
2764
+ if (typeof t != "object" && (t = [t]), oe(t))
2765
+ for (r = 0, i = t.length; r < i; r++)
2766
+ e.call(null, t[r], r, t);
2767
+ else {
2768
+ if (me(t))
2769
+ return;
2770
+ const o = s ? Object.getOwnPropertyNames(t) : Object.keys(t), n = o.length;
2771
+ let a;
2772
+ for (r = 0; r < n; r++)
2773
+ a = o[r], e.call(null, t[a], a, t);
2774
+ }
2775
+ }
2776
+ function ns(t, e) {
2777
+ if (me(t))
2778
+ return null;
2779
+ e = e.toLowerCase();
2780
+ const s = Object.keys(t);
2781
+ let r = s.length, i;
2782
+ for (; r-- > 0; )
2783
+ if (i = s[r], e === i.toLowerCase())
2784
+ return i;
2785
+ return null;
2786
+ }
2787
+ const Y = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, as = (t) => !se(t) && t !== Y;
2788
+ function Ke() {
2789
+ const { caseless: t, skipUndefined: e } = as(this) && this || {}, s = {}, r = (i, o) => {
2790
+ const n = t && ns(s, o) || o;
2791
+ Ee(s[n]) && Ee(i) ? s[n] = Ke(s[n], i) : Ee(i) ? s[n] = Ke({}, i) : oe(i) ? s[n] = i.slice() : (!e || !se(i)) && (s[n] = i);
2792
+ };
2793
+ for (let i = 0, o = arguments.length; i < o; i++)
2794
+ arguments[i] && ye(arguments[i], r);
2795
+ return s;
2796
+ }
2797
+ const Or = (t, e, s, { allOwnKeys: r } = {}) => (ye(e, (i, o) => {
2798
+ s && P(i) ? t[o] = ss(i, s) : t[o] = i;
2799
+ }, { allOwnKeys: r }), t), xr = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Rr = (t, e, s, r) => {
2800
+ t.prototype = Object.create(e.prototype, r), t.prototype.constructor = t, Object.defineProperty(t, "super", {
2801
+ value: e.prototype
2802
+ }), s && Object.assign(t.prototype, s);
2803
+ }, Pr = (t, e, s, r) => {
2804
+ let i, o, n;
2805
+ const a = {};
2806
+ if (e = e || {}, t == null) return e;
2807
+ do {
2808
+ for (i = Object.getOwnPropertyNames(t), o = i.length; o-- > 0; )
2809
+ n = i[o], (!r || r(n, t, e)) && !a[n] && (e[n] = t[n], a[n] = !0);
2810
+ t = s !== !1 && st(t);
2811
+ } while (t && (!s || s(t, e)) && t !== Object.prototype);
2812
+ return e;
2813
+ }, Dr = (t, e, s) => {
2814
+ t = String(t), (s === void 0 || s > t.length) && (s = t.length), s -= e.length;
2815
+ const r = t.indexOf(e, s);
2816
+ return r !== -1 && r === s;
2817
+ }, Ur = (t) => {
2818
+ if (!t) return null;
2819
+ if (oe(t)) return t;
2820
+ let e = t.length;
2821
+ if (!os(e)) return null;
2822
+ const s = new Array(e);
2823
+ for (; e-- > 0; )
2824
+ s[e] = t[e];
2825
+ return s;
2826
+ }, Nr = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && st(Uint8Array)), Lr = (t, e) => {
2827
+ const r = (t && t[Pe]).call(t);
2828
+ let i;
2829
+ for (; (i = r.next()) && !i.done; ) {
2830
+ const o = i.value;
2831
+ e.call(t, o[0], o[1]);
2832
+ }
2833
+ }, Ir = (t, e) => {
2834
+ let s;
2835
+ const r = [];
2836
+ for (; (s = t.exec(e)) !== null; )
2837
+ r.push(s);
2838
+ return r;
2839
+ }, Br = N("HTMLFormElement"), jr = (t) => t.toLowerCase().replace(
2840
+ /[-_\s]([a-z\d])(\w*)/g,
2841
+ function(s, r, i) {
2842
+ return r.toUpperCase() + i;
2843
+ }
2844
+ ), kt = (({ hasOwnProperty: t }) => (e, s) => t.call(e, s))(Object.prototype), Hr = N("RegExp"), ls = (t, e) => {
2845
+ const s = Object.getOwnPropertyDescriptors(t), r = {};
2846
+ ye(s, (i, o) => {
2847
+ let n;
2848
+ (n = e(i, o, t)) !== !1 && (r[o] = n || i);
2849
+ }), Object.defineProperties(t, r);
2850
+ }, Fr = (t) => {
2851
+ ls(t, (e, s) => {
2852
+ if (P(t) && ["arguments", "caller", "callee"].indexOf(s) !== -1)
2853
+ return !1;
2854
+ const r = t[s];
2855
+ if (P(r)) {
2856
+ if (e.enumerable = !1, "writable" in e) {
2857
+ e.writable = !1;
2858
+ return;
2859
+ }
2860
+ e.set || (e.set = () => {
2861
+ throw Error("Can not rewrite read-only method '" + s + "'");
2862
+ });
2863
+ }
2864
+ });
2865
+ }, Mr = (t, e) => {
2866
+ const s = {}, r = (i) => {
2867
+ i.forEach((o) => {
2868
+ s[o] = !0;
2869
+ });
2870
+ };
2871
+ return oe(t) ? r(t) : r(String(t).split(e)), s;
2872
+ }, qr = () => {
2873
+ }, zr = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
2874
+ function Kr(t) {
2875
+ return !!(t && P(t.append) && t[rs] === "FormData" && t[Pe]);
2876
+ }
2877
+ const Vr = (t) => {
2878
+ const e = new Array(10), s = (r, i) => {
2879
+ if (ge(r)) {
2880
+ if (e.indexOf(r) >= 0)
2881
+ return;
2882
+ if (me(r))
2883
+ return r;
2884
+ if (!("toJSON" in r)) {
2885
+ e[i] = r;
2886
+ const o = oe(r) ? [] : {};
2887
+ return ye(r, (n, a) => {
2888
+ const l = s(n, i + 1);
2889
+ !se(l) && (o[a] = l);
2890
+ }), e[i] = void 0, o;
2891
+ }
2892
+ }
2893
+ return r;
2894
+ };
2895
+ return s(t, 0);
2896
+ }, Wr = N("AsyncFunction"), Yr = (t) => t && (ge(t) || P(t)) && P(t.then) && P(t.catch), cs = ((t, e) => t ? setImmediate : e ? ((s, r) => (Y.addEventListener("message", ({ source: i, data: o }) => {
2897
+ i === Y && o === s && r.length && r.shift()();
2898
+ }, !1), (i) => {
2899
+ r.push(i), Y.postMessage(s, "*");
2900
+ }))(`axios@${Math.random()}`, []) : (s) => setTimeout(s))(
2901
+ typeof setImmediate == "function",
2902
+ P(Y.postMessage)
2903
+ ), Jr = typeof queueMicrotask < "u" ? queueMicrotask.bind(Y) : typeof process < "u" && process.nextTick || cs, Gr = (t) => t != null && P(t[Pe]), d = {
2904
+ isArray: oe,
2905
+ isArrayBuffer: is,
2906
+ isBuffer: me,
2907
+ isFormData: Ar,
2908
+ isArrayBufferView: pr,
2909
+ isString: fr,
2910
+ isNumber: os,
2911
+ isBoolean: mr,
2912
+ isObject: ge,
2913
+ isPlainObject: Ee,
2914
+ isEmptyObject: gr,
2915
+ isReadableStream: Er,
2916
+ isRequest: _r,
2917
+ isResponse: Tr,
2918
+ isHeaders: kr,
2919
+ isUndefined: se,
2920
+ isDate: yr,
2921
+ isFile: wr,
2922
+ isBlob: br,
2923
+ isRegExp: Hr,
2924
+ isFunction: P,
2925
+ isStream: Sr,
2926
+ isURLSearchParams: vr,
2927
+ isTypedArray: Nr,
2928
+ isFileList: $r,
2929
+ forEach: ye,
2930
+ merge: Ke,
2931
+ extend: Or,
2932
+ trim: Cr,
2933
+ stripBOM: xr,
2934
+ inherits: Rr,
2935
+ toFlatObject: Pr,
2936
+ kindOf: De,
2937
+ kindOfTest: N,
2938
+ endsWith: Dr,
2939
+ toArray: Ur,
2940
+ forEachEntry: Lr,
2941
+ matchAll: Ir,
2942
+ isHTMLForm: Br,
2943
+ hasOwnProperty: kt,
2944
+ hasOwnProp: kt,
2945
+ // an alias to avoid ESLint no-prototype-builtins detection
2946
+ reduceDescriptors: ls,
2947
+ freezeMethods: Fr,
2948
+ toObjectSet: Mr,
2949
+ toCamelCase: jr,
2950
+ noop: qr,
2951
+ toFiniteNumber: zr,
2952
+ findKey: ns,
2953
+ global: Y,
2954
+ isContextDefined: as,
2955
+ isSpecCompliantForm: Kr,
2956
+ toJSONObject: Vr,
2957
+ isAsyncFn: Wr,
2958
+ isThenable: Yr,
2959
+ setImmediate: cs,
2960
+ asap: Jr,
2961
+ isIterable: Gr
2962
+ };
2963
+ function S(t, e, s, r, i) {
2964
+ Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), s && (this.config = s), r && (this.request = r), i && (this.response = i, this.status = i.status ? i.status : null);
2965
+ }
2966
+ d.inherits(S, Error, {
2967
+ toJSON: function() {
2968
+ return {
2969
+ // Standard
2970
+ message: this.message,
2971
+ name: this.name,
2972
+ // Microsoft
2973
+ description: this.description,
2974
+ number: this.number,
2975
+ // Mozilla
2976
+ fileName: this.fileName,
2977
+ lineNumber: this.lineNumber,
2978
+ columnNumber: this.columnNumber,
2979
+ stack: this.stack,
2980
+ // Axios
2981
+ config: d.toJSONObject(this.config),
2982
+ code: this.code,
2983
+ status: this.status
2984
+ };
2985
+ }
2986
+ });
2987
+ const hs = S.prototype, ds = {};
2988
+ [
2989
+ "ERR_BAD_OPTION_VALUE",
2990
+ "ERR_BAD_OPTION",
2991
+ "ECONNABORTED",
2992
+ "ETIMEDOUT",
2993
+ "ERR_NETWORK",
2994
+ "ERR_FR_TOO_MANY_REDIRECTS",
2995
+ "ERR_DEPRECATED",
2996
+ "ERR_BAD_RESPONSE",
2997
+ "ERR_BAD_REQUEST",
2998
+ "ERR_CANCELED",
2999
+ "ERR_NOT_SUPPORT",
3000
+ "ERR_INVALID_URL"
3001
+ // eslint-disable-next-line func-names
3002
+ ].forEach((t) => {
3003
+ ds[t] = { value: t };
3004
+ });
3005
+ Object.defineProperties(S, ds);
3006
+ Object.defineProperty(hs, "isAxiosError", { value: !0 });
3007
+ S.from = (t, e, s, r, i, o) => {
3008
+ const n = Object.create(hs);
3009
+ d.toFlatObject(t, n, function(c) {
3010
+ return c !== Error.prototype;
3011
+ }, (h) => h !== "isAxiosError");
3012
+ const a = t && t.message ? t.message : "Error", l = e == null && t ? t.code : e;
3013
+ return S.call(n, a, l, s, r, i), t && n.cause == null && Object.defineProperty(n, "cause", { value: t, configurable: !0 }), n.name = t && t.name || "Error", o && Object.assign(n, o), n;
3014
+ };
3015
+ const Zr = null;
3016
+ function Ve(t) {
3017
+ return d.isPlainObject(t) || d.isArray(t);
3018
+ }
3019
+ function us(t) {
3020
+ return d.endsWith(t, "[]") ? t.slice(0, -2) : t;
3021
+ }
3022
+ function Ct(t, e, s) {
3023
+ return t ? t.concat(e).map(function(i, o) {
3024
+ return i = us(i), !s && o ? "[" + i + "]" : i;
3025
+ }).join(s ? "." : "") : e;
3026
+ }
3027
+ function Xr(t) {
3028
+ return d.isArray(t) && !t.some(Ve);
3029
+ }
3030
+ const Qr = d.toFlatObject(d, {}, null, function(e) {
3031
+ return /^is[A-Z]/.test(e);
3032
+ });
3033
+ function Ne(t, e, s) {
3034
+ if (!d.isObject(t))
3035
+ throw new TypeError("target must be an object");
3036
+ e = e || new FormData(), s = d.toFlatObject(s, {
3037
+ metaTokens: !0,
3038
+ dots: !1,
3039
+ indexes: !1
3040
+ }, !1, function(g, m) {
3041
+ return !d.isUndefined(m[g]);
3042
+ });
3043
+ const r = s.metaTokens, i = s.visitor || c, o = s.dots, n = s.indexes, l = (s.Blob || typeof Blob < "u" && Blob) && d.isSpecCompliantForm(e);
3044
+ if (!d.isFunction(i))
3045
+ throw new TypeError("visitor must be a function");
3046
+ function h(p) {
3047
+ if (p === null) return "";
3048
+ if (d.isDate(p))
3049
+ return p.toISOString();
3050
+ if (d.isBoolean(p))
3051
+ return p.toString();
3052
+ if (!l && d.isBlob(p))
3053
+ throw new S("Blob is not supported. Use a Buffer instead.");
3054
+ return d.isArrayBuffer(p) || d.isTypedArray(p) ? l && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
3055
+ }
3056
+ function c(p, g, m) {
3057
+ let w = p;
3058
+ if (p && !m && typeof p == "object") {
3059
+ if (d.endsWith(g, "{}"))
3060
+ g = r ? g : g.slice(0, -2), p = JSON.stringify(p);
3061
+ else if (d.isArray(p) && Xr(p) || (d.isFileList(p) || d.endsWith(g, "[]")) && (w = d.toArray(p)))
3062
+ return g = us(g), w.forEach(function(E, k) {
3063
+ !(d.isUndefined(E) || E === null) && e.append(
3064
+ // eslint-disable-next-line no-nested-ternary
3065
+ n === !0 ? Ct([g], k, o) : n === null ? g : g + "[]",
3066
+ h(E)
3067
+ );
3068
+ }), !1;
3069
+ }
3070
+ return Ve(p) ? !0 : (e.append(Ct(m, g, o), h(p)), !1);
3071
+ }
3072
+ const u = [], f = Object.assign(Qr, {
3073
+ defaultVisitor: c,
3074
+ convertValue: h,
3075
+ isVisitable: Ve
3076
+ });
3077
+ function y(p, g) {
3078
+ if (!d.isUndefined(p)) {
3079
+ if (u.indexOf(p) !== -1)
3080
+ throw Error("Circular reference detected in " + g.join("."));
3081
+ u.push(p), d.forEach(p, function(w, _) {
3082
+ (!(d.isUndefined(w) || w === null) && i.call(
3083
+ e,
3084
+ w,
3085
+ d.isString(_) ? _.trim() : _,
3086
+ g,
3087
+ f
3088
+ )) === !0 && y(w, g ? g.concat(_) : [_]);
3089
+ }), u.pop();
3090
+ }
3091
+ }
3092
+ if (!d.isObject(t))
3093
+ throw new TypeError("data must be an object");
3094
+ return y(t), e;
3095
+ }
3096
+ function Ot(t) {
3097
+ const e = {
3098
+ "!": "%21",
3099
+ "'": "%27",
3100
+ "(": "%28",
3101
+ ")": "%29",
3102
+ "~": "%7E",
3103
+ "%20": "+",
3104
+ "%00": "\0"
3105
+ };
3106
+ return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(r) {
3107
+ return e[r];
3108
+ });
3109
+ }
3110
+ function rt(t, e) {
3111
+ this._pairs = [], t && Ne(t, this, e);
3112
+ }
3113
+ const ps = rt.prototype;
3114
+ ps.append = function(e, s) {
3115
+ this._pairs.push([e, s]);
3116
+ };
3117
+ ps.toString = function(e) {
3118
+ const s = e ? function(r) {
3119
+ return e.call(this, r, Ot);
3120
+ } : Ot;
3121
+ return this._pairs.map(function(i) {
3122
+ return s(i[0]) + "=" + s(i[1]);
3123
+ }, "").join("&");
3124
+ };
3125
+ function ei(t) {
3126
+ return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
3127
+ }
3128
+ function fs(t, e, s) {
3129
+ if (!e)
3130
+ return t;
3131
+ const r = s && s.encode || ei;
3132
+ d.isFunction(s) && (s = {
3133
+ serialize: s
3134
+ });
3135
+ const i = s && s.serialize;
3136
+ let o;
3137
+ if (i ? o = i(e, s) : o = d.isURLSearchParams(e) ? e.toString() : new rt(e, s).toString(r), o) {
3138
+ const n = t.indexOf("#");
3139
+ n !== -1 && (t = t.slice(0, n)), t += (t.indexOf("?") === -1 ? "?" : "&") + o;
3140
+ }
3141
+ return t;
3142
+ }
3143
+ class xt {
3144
+ constructor() {
3145
+ this.handlers = [];
3146
+ }
3147
+ /**
3148
+ * Add a new interceptor to the stack
3149
+ *
3150
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
3151
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
3152
+ *
3153
+ * @return {Number} An ID used to remove interceptor later
3154
+ */
3155
+ use(e, s, r) {
3156
+ return this.handlers.push({
3157
+ fulfilled: e,
3158
+ rejected: s,
3159
+ synchronous: r ? r.synchronous : !1,
3160
+ runWhen: r ? r.runWhen : null
3161
+ }), this.handlers.length - 1;
3162
+ }
3163
+ /**
3164
+ * Remove an interceptor from the stack
3165
+ *
3166
+ * @param {Number} id The ID that was returned by `use`
3167
+ *
3168
+ * @returns {void}
3169
+ */
3170
+ eject(e) {
3171
+ this.handlers[e] && (this.handlers[e] = null);
3172
+ }
3173
+ /**
3174
+ * Clear all interceptors from the stack
3175
+ *
3176
+ * @returns {void}
3177
+ */
3178
+ clear() {
3179
+ this.handlers && (this.handlers = []);
3180
+ }
3181
+ /**
3182
+ * Iterate over all the registered interceptors
3183
+ *
3184
+ * This method is particularly useful for skipping over any
3185
+ * interceptors that may have become `null` calling `eject`.
3186
+ *
3187
+ * @param {Function} fn The function to call for each interceptor
3188
+ *
3189
+ * @returns {void}
3190
+ */
3191
+ forEach(e) {
3192
+ d.forEach(this.handlers, function(r) {
3193
+ r !== null && e(r);
3194
+ });
3195
+ }
3196
+ }
3197
+ const ms = {
3198
+ silentJSONParsing: !0,
3199
+ forcedJSONParsing: !0,
3200
+ clarifyTimeoutError: !1
3201
+ }, ti = typeof URLSearchParams < "u" ? URLSearchParams : rt, si = typeof FormData < "u" ? FormData : null, ri = typeof Blob < "u" ? Blob : null, ii = {
3202
+ isBrowser: !0,
3203
+ classes: {
3204
+ URLSearchParams: ti,
3205
+ FormData: si,
3206
+ Blob: ri
3207
+ },
3208
+ protocols: ["http", "https", "file", "blob", "url", "data"]
3209
+ }, it = typeof window < "u" && typeof document < "u", We = typeof navigator == "object" && navigator || void 0, oi = it && (!We || ["ReactNative", "NativeScript", "NS"].indexOf(We.product) < 0), ni = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
3210
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", ai = it && window.location.href || "http://localhost", li = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3211
+ __proto__: null,
3212
+ hasBrowserEnv: it,
3213
+ hasStandardBrowserEnv: oi,
3214
+ hasStandardBrowserWebWorkerEnv: ni,
3215
+ navigator: We,
3216
+ origin: ai
3217
+ }, Symbol.toStringTag, { value: "Module" })), x = {
3218
+ ...li,
3219
+ ...ii
3220
+ };
3221
+ function ci(t, e) {
3222
+ return Ne(t, new x.classes.URLSearchParams(), {
3223
+ visitor: function(s, r, i, o) {
3224
+ return x.isNode && d.isBuffer(s) ? (this.append(r, s.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
3225
+ },
3226
+ ...e
3227
+ });
3228
+ }
3229
+ function hi(t) {
3230
+ return d.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
3231
+ }
3232
+ function di(t) {
3233
+ const e = {}, s = Object.keys(t);
3234
+ let r;
3235
+ const i = s.length;
3236
+ let o;
3237
+ for (r = 0; r < i; r++)
3238
+ o = s[r], e[o] = t[o];
3239
+ return e;
3240
+ }
3241
+ function gs(t) {
3242
+ function e(s, r, i, o) {
3243
+ let n = s[o++];
3244
+ if (n === "__proto__") return !0;
3245
+ const a = Number.isFinite(+n), l = o >= s.length;
3246
+ return n = !n && d.isArray(i) ? i.length : n, l ? (d.hasOwnProp(i, n) ? i[n] = [i[n], r] : i[n] = r, !a) : ((!i[n] || !d.isObject(i[n])) && (i[n] = []), e(s, r, i[n], o) && d.isArray(i[n]) && (i[n] = di(i[n])), !a);
3247
+ }
3248
+ if (d.isFormData(t) && d.isFunction(t.entries)) {
3249
+ const s = {};
3250
+ return d.forEachEntry(t, (r, i) => {
3251
+ e(hi(r), i, s, 0);
3252
+ }), s;
3253
+ }
3254
+ return null;
3255
+ }
3256
+ function ui(t, e, s) {
3257
+ if (d.isString(t))
3258
+ try {
3259
+ return (0, JSON.parse)(t), d.trim(t);
3260
+ } catch (r) {
3261
+ if (r.name !== "SyntaxError")
3262
+ throw r;
3263
+ }
3264
+ return (s || JSON.stringify)(t);
3265
+ }
3266
+ const we = {
3267
+ transitional: ms,
3268
+ adapter: ["xhr", "http", "fetch"],
3269
+ transformRequest: [function(e, s) {
3270
+ const r = s.getContentType() || "", i = r.indexOf("application/json") > -1, o = d.isObject(e);
3271
+ if (o && d.isHTMLForm(e) && (e = new FormData(e)), d.isFormData(e))
3272
+ return i ? JSON.stringify(gs(e)) : e;
3273
+ if (d.isArrayBuffer(e) || d.isBuffer(e) || d.isStream(e) || d.isFile(e) || d.isBlob(e) || d.isReadableStream(e))
3274
+ return e;
3275
+ if (d.isArrayBufferView(e))
3276
+ return e.buffer;
3277
+ if (d.isURLSearchParams(e))
3278
+ return s.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
3279
+ let a;
3280
+ if (o) {
3281
+ if (r.indexOf("application/x-www-form-urlencoded") > -1)
3282
+ return ci(e, this.formSerializer).toString();
3283
+ if ((a = d.isFileList(e)) || r.indexOf("multipart/form-data") > -1) {
3284
+ const l = this.env && this.env.FormData;
3285
+ return Ne(
3286
+ a ? { "files[]": e } : e,
3287
+ l && new l(),
3288
+ this.formSerializer
3289
+ );
3290
+ }
3291
+ }
3292
+ return o || i ? (s.setContentType("application/json", !1), ui(e)) : e;
3293
+ }],
3294
+ transformResponse: [function(e) {
3295
+ const s = this.transitional || we.transitional, r = s && s.forcedJSONParsing, i = this.responseType === "json";
3296
+ if (d.isResponse(e) || d.isReadableStream(e))
3297
+ return e;
3298
+ if (e && d.isString(e) && (r && !this.responseType || i)) {
3299
+ const n = !(s && s.silentJSONParsing) && i;
3300
+ try {
3301
+ return JSON.parse(e, this.parseReviver);
3302
+ } catch (a) {
3303
+ if (n)
3304
+ throw a.name === "SyntaxError" ? S.from(a, S.ERR_BAD_RESPONSE, this, null, this.response) : a;
3305
+ }
3306
+ }
3307
+ return e;
3308
+ }],
3309
+ /**
3310
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
3311
+ * timeout is not created.
3312
+ */
3313
+ timeout: 0,
3314
+ xsrfCookieName: "XSRF-TOKEN",
3315
+ xsrfHeaderName: "X-XSRF-TOKEN",
3316
+ maxContentLength: -1,
3317
+ maxBodyLength: -1,
3318
+ env: {
3319
+ FormData: x.classes.FormData,
3320
+ Blob: x.classes.Blob
3321
+ },
3322
+ validateStatus: function(e) {
3323
+ return e >= 200 && e < 300;
3324
+ },
3325
+ headers: {
3326
+ common: {
3327
+ Accept: "application/json, text/plain, */*",
3328
+ "Content-Type": void 0
3329
+ }
3330
+ }
3331
+ };
3332
+ d.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
3333
+ we.headers[t] = {};
3334
+ });
3335
+ const pi = d.toObjectSet([
3336
+ "age",
3337
+ "authorization",
3338
+ "content-length",
3339
+ "content-type",
3340
+ "etag",
3341
+ "expires",
3342
+ "from",
3343
+ "host",
3344
+ "if-modified-since",
3345
+ "if-unmodified-since",
3346
+ "last-modified",
3347
+ "location",
3348
+ "max-forwards",
3349
+ "proxy-authorization",
3350
+ "referer",
3351
+ "retry-after",
3352
+ "user-agent"
3353
+ ]), fi = (t) => {
3354
+ const e = {};
3355
+ let s, r, i;
3356
+ return t && t.split(`
3357
+ `).forEach(function(n) {
3358
+ i = n.indexOf(":"), s = n.substring(0, i).trim().toLowerCase(), r = n.substring(i + 1).trim(), !(!s || e[s] && pi[s]) && (s === "set-cookie" ? e[s] ? e[s].push(r) : e[s] = [r] : e[s] = e[s] ? e[s] + ", " + r : r);
3359
+ }), e;
3360
+ }, Rt = Symbol("internals");
3361
+ function he(t) {
3362
+ return t && String(t).trim().toLowerCase();
3363
+ }
3364
+ function _e(t) {
3365
+ return t === !1 || t == null ? t : d.isArray(t) ? t.map(_e) : String(t);
3366
+ }
3367
+ function mi(t) {
3368
+ const e = /* @__PURE__ */ Object.create(null), s = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
3369
+ let r;
3370
+ for (; r = s.exec(t); )
3371
+ e[r[1]] = r[2];
3372
+ return e;
3373
+ }
3374
+ const gi = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
3375
+ function Me(t, e, s, r, i) {
3376
+ if (d.isFunction(r))
3377
+ return r.call(this, e, s);
3378
+ if (i && (e = s), !!d.isString(e)) {
3379
+ if (d.isString(r))
3380
+ return e.indexOf(r) !== -1;
3381
+ if (d.isRegExp(r))
3382
+ return r.test(e);
3383
+ }
3384
+ }
3385
+ function yi(t) {
3386
+ return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, s, r) => s.toUpperCase() + r);
3387
+ }
3388
+ function wi(t, e) {
3389
+ const s = d.toCamelCase(" " + e);
3390
+ ["get", "set", "has"].forEach((r) => {
3391
+ Object.defineProperty(t, r + s, {
3392
+ value: function(i, o, n) {
3393
+ return this[r].call(this, e, i, o, n);
3394
+ },
3395
+ configurable: !0
3396
+ });
3397
+ });
3398
+ }
3399
+ class D {
3400
+ constructor(e) {
3401
+ e && this.set(e);
3402
+ }
3403
+ set(e, s, r) {
3404
+ const i = this;
3405
+ function o(a, l, h) {
3406
+ const c = he(l);
3407
+ if (!c)
3408
+ throw new Error("header name must be a non-empty string");
3409
+ const u = d.findKey(i, c);
3410
+ (!u || i[u] === void 0 || h === !0 || h === void 0 && i[u] !== !1) && (i[u || l] = _e(a));
3411
+ }
3412
+ const n = (a, l) => d.forEach(a, (h, c) => o(h, c, l));
3413
+ if (d.isPlainObject(e) || e instanceof this.constructor)
3414
+ n(e, s);
3415
+ else if (d.isString(e) && (e = e.trim()) && !gi(e))
3416
+ n(fi(e), s);
3417
+ else if (d.isObject(e) && d.isIterable(e)) {
3418
+ let a = {}, l, h;
3419
+ for (const c of e) {
3420
+ if (!d.isArray(c))
3421
+ throw TypeError("Object iterator must return a key-value pair");
3422
+ a[h = c[0]] = (l = a[h]) ? d.isArray(l) ? [...l, c[1]] : [l, c[1]] : c[1];
3423
+ }
3424
+ n(a, s);
3425
+ } else
3426
+ e != null && o(s, e, r);
3427
+ return this;
3428
+ }
3429
+ get(e, s) {
3430
+ if (e = he(e), e) {
3431
+ const r = d.findKey(this, e);
3432
+ if (r) {
3433
+ const i = this[r];
3434
+ if (!s)
3435
+ return i;
3436
+ if (s === !0)
3437
+ return mi(i);
3438
+ if (d.isFunction(s))
3439
+ return s.call(this, i, r);
3440
+ if (d.isRegExp(s))
3441
+ return s.exec(i);
3442
+ throw new TypeError("parser must be boolean|regexp|function");
3443
+ }
3444
+ }
3445
+ }
3446
+ has(e, s) {
3447
+ if (e = he(e), e) {
3448
+ const r = d.findKey(this, e);
3449
+ return !!(r && this[r] !== void 0 && (!s || Me(this, this[r], r, s)));
3450
+ }
3451
+ return !1;
3452
+ }
3453
+ delete(e, s) {
3454
+ const r = this;
3455
+ let i = !1;
3456
+ function o(n) {
3457
+ if (n = he(n), n) {
3458
+ const a = d.findKey(r, n);
3459
+ a && (!s || Me(r, r[a], a, s)) && (delete r[a], i = !0);
3460
+ }
3461
+ }
3462
+ return d.isArray(e) ? e.forEach(o) : o(e), i;
3463
+ }
3464
+ clear(e) {
3465
+ const s = Object.keys(this);
3466
+ let r = s.length, i = !1;
3467
+ for (; r--; ) {
3468
+ const o = s[r];
3469
+ (!e || Me(this, this[o], o, e, !0)) && (delete this[o], i = !0);
3470
+ }
3471
+ return i;
3472
+ }
3473
+ normalize(e) {
3474
+ const s = this, r = {};
3475
+ return d.forEach(this, (i, o) => {
3476
+ const n = d.findKey(r, o);
3477
+ if (n) {
3478
+ s[n] = _e(i), delete s[o];
3479
+ return;
3480
+ }
3481
+ const a = e ? yi(o) : String(o).trim();
3482
+ a !== o && delete s[o], s[a] = _e(i), r[a] = !0;
3483
+ }), this;
3484
+ }
3485
+ concat(...e) {
3486
+ return this.constructor.concat(this, ...e);
3487
+ }
3488
+ toJSON(e) {
3489
+ const s = /* @__PURE__ */ Object.create(null);
3490
+ return d.forEach(this, (r, i) => {
3491
+ r != null && r !== !1 && (s[i] = e && d.isArray(r) ? r.join(", ") : r);
3492
+ }), s;
3493
+ }
3494
+ [Symbol.iterator]() {
3495
+ return Object.entries(this.toJSON())[Symbol.iterator]();
3496
+ }
3497
+ toString() {
3498
+ return Object.entries(this.toJSON()).map(([e, s]) => e + ": " + s).join(`
3499
+ `);
3500
+ }
3501
+ getSetCookie() {
3502
+ return this.get("set-cookie") || [];
3503
+ }
3504
+ get [Symbol.toStringTag]() {
3505
+ return "AxiosHeaders";
3506
+ }
3507
+ static from(e) {
3508
+ return e instanceof this ? e : new this(e);
3509
+ }
3510
+ static concat(e, ...s) {
3511
+ const r = new this(e);
3512
+ return s.forEach((i) => r.set(i)), r;
3513
+ }
3514
+ static accessor(e) {
3515
+ const r = (this[Rt] = this[Rt] = {
3516
+ accessors: {}
3517
+ }).accessors, i = this.prototype;
3518
+ function o(n) {
3519
+ const a = he(n);
3520
+ r[a] || (wi(i, n), r[a] = !0);
3521
+ }
3522
+ return d.isArray(e) ? e.forEach(o) : o(e), this;
3523
+ }
3524
+ }
3525
+ D.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
3526
+ d.reduceDescriptors(D.prototype, ({ value: t }, e) => {
3527
+ let s = e[0].toUpperCase() + e.slice(1);
3528
+ return {
3529
+ get: () => t,
3530
+ set(r) {
3531
+ this[s] = r;
3532
+ }
3533
+ };
3534
+ });
3535
+ d.freezeMethods(D);
3536
+ function qe(t, e) {
3537
+ const s = this || we, r = e || s, i = D.from(r.headers);
3538
+ let o = r.data;
3539
+ return d.forEach(t, function(a) {
3540
+ o = a.call(s, o, i.normalize(), e ? e.status : void 0);
3541
+ }), i.normalize(), o;
3542
+ }
3543
+ function ys(t) {
3544
+ return !!(t && t.__CANCEL__);
3545
+ }
3546
+ function ne(t, e, s) {
3547
+ S.call(this, t ?? "canceled", S.ERR_CANCELED, e, s), this.name = "CanceledError";
3548
+ }
3549
+ d.inherits(ne, S, {
3550
+ __CANCEL__: !0
3551
+ });
3552
+ function ws(t, e, s) {
3553
+ const r = s.config.validateStatus;
3554
+ !s.status || !r || r(s.status) ? t(s) : e(new S(
3555
+ "Request failed with status code " + s.status,
3556
+ [S.ERR_BAD_REQUEST, S.ERR_BAD_RESPONSE][Math.floor(s.status / 100) - 4],
3557
+ s.config,
3558
+ s.request,
3559
+ s
3560
+ ));
3561
+ }
3562
+ function bi(t) {
3563
+ const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
3564
+ return e && e[1] || "";
3565
+ }
3566
+ function $i(t, e) {
3567
+ t = t || 10;
3568
+ const s = new Array(t), r = new Array(t);
3569
+ let i = 0, o = 0, n;
3570
+ return e = e !== void 0 ? e : 1e3, function(l) {
3571
+ const h = Date.now(), c = r[o];
3572
+ n || (n = h), s[i] = l, r[i] = h;
3573
+ let u = o, f = 0;
3574
+ for (; u !== i; )
3575
+ f += s[u++], u = u % t;
3576
+ if (i = (i + 1) % t, i === o && (o = (o + 1) % t), h - n < e)
3577
+ return;
3578
+ const y = c && h - c;
3579
+ return y ? Math.round(f * 1e3 / y) : void 0;
3580
+ };
3581
+ }
3582
+ function Si(t, e) {
3583
+ let s = 0, r = 1e3 / e, i, o;
3584
+ const n = (h, c = Date.now()) => {
3585
+ s = c, i = null, o && (clearTimeout(o), o = null), t(...h);
3586
+ };
3587
+ return [(...h) => {
3588
+ const c = Date.now(), u = c - s;
3589
+ u >= r ? n(h, c) : (i = h, o || (o = setTimeout(() => {
3590
+ o = null, n(i);
3591
+ }, r - u)));
3592
+ }, () => i && n(i)];
3593
+ }
3594
+ const Oe = (t, e, s = 3) => {
3595
+ let r = 0;
3596
+ const i = $i(50, 250);
3597
+ return Si((o) => {
3598
+ const n = o.loaded, a = o.lengthComputable ? o.total : void 0, l = n - r, h = i(l), c = n <= a;
3599
+ r = n;
3600
+ const u = {
3601
+ loaded: n,
3602
+ total: a,
3603
+ progress: a ? n / a : void 0,
3604
+ bytes: l,
3605
+ rate: h || void 0,
3606
+ estimated: h && a && c ? (a - n) / h : void 0,
3607
+ event: o,
3608
+ lengthComputable: a != null,
3609
+ [e ? "download" : "upload"]: !0
3610
+ };
3611
+ t(u);
3612
+ }, s);
3613
+ }, Pt = (t, e) => {
3614
+ const s = t != null;
3615
+ return [(r) => e[0]({
3616
+ lengthComputable: s,
3617
+ total: t,
3618
+ loaded: r
3619
+ }), e[1]];
3620
+ }, Dt = (t) => (...e) => d.asap(() => t(...e)), Ai = x.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (s) => (s = new URL(s, x.origin), t.protocol === s.protocol && t.host === s.host && (e || t.port === s.port)))(
3621
+ new URL(x.origin),
3622
+ x.navigator && /(msie|trident)/i.test(x.navigator.userAgent)
3623
+ ) : () => !0, vi = x.hasStandardBrowserEnv ? (
3624
+ // Standard browser envs support document.cookie
3625
+ {
3626
+ write(t, e, s, r, i, o, n) {
3627
+ if (typeof document > "u") return;
3628
+ const a = [`${t}=${encodeURIComponent(e)}`];
3629
+ d.isNumber(s) && a.push(`expires=${new Date(s).toUTCString()}`), d.isString(r) && a.push(`path=${r}`), d.isString(i) && a.push(`domain=${i}`), o === !0 && a.push("secure"), d.isString(n) && a.push(`SameSite=${n}`), document.cookie = a.join("; ");
3630
+ },
3631
+ read(t) {
3632
+ if (typeof document > "u") return null;
3633
+ const e = document.cookie.match(new RegExp("(?:^|; )" + t + "=([^;]*)"));
3634
+ return e ? decodeURIComponent(e[1]) : null;
3635
+ },
3636
+ remove(t) {
3637
+ this.write(t, "", Date.now() - 864e5, "/");
3638
+ }
3639
+ }
3640
+ ) : (
3641
+ // Non-standard browser env (web workers, react-native) lack needed support.
3642
+ {
3643
+ write() {
3644
+ },
3645
+ read() {
3646
+ return null;
3647
+ },
3648
+ remove() {
3649
+ }
3650
+ }
3651
+ );
3652
+ function Ei(t) {
3653
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
3654
+ }
3655
+ function _i(t, e) {
3656
+ return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
3657
+ }
3658
+ function bs(t, e, s) {
3659
+ let r = !Ei(e);
3660
+ return t && (r || s == !1) ? _i(t, e) : e;
3661
+ }
3662
+ const Ut = (t) => t instanceof D ? { ...t } : t;
3663
+ function Z(t, e) {
3664
+ e = e || {};
3665
+ const s = {};
3666
+ function r(h, c, u, f) {
3667
+ return d.isPlainObject(h) && d.isPlainObject(c) ? d.merge.call({ caseless: f }, h, c) : d.isPlainObject(c) ? d.merge({}, c) : d.isArray(c) ? c.slice() : c;
3668
+ }
3669
+ function i(h, c, u, f) {
3670
+ if (d.isUndefined(c)) {
3671
+ if (!d.isUndefined(h))
3672
+ return r(void 0, h, u, f);
3673
+ } else return r(h, c, u, f);
3674
+ }
3675
+ function o(h, c) {
3676
+ if (!d.isUndefined(c))
3677
+ return r(void 0, c);
3678
+ }
3679
+ function n(h, c) {
3680
+ if (d.isUndefined(c)) {
3681
+ if (!d.isUndefined(h))
3682
+ return r(void 0, h);
3683
+ } else return r(void 0, c);
3684
+ }
3685
+ function a(h, c, u) {
3686
+ if (u in e)
3687
+ return r(h, c);
3688
+ if (u in t)
3689
+ return r(void 0, h);
3690
+ }
3691
+ const l = {
3692
+ url: o,
3693
+ method: o,
3694
+ data: o,
3695
+ baseURL: n,
3696
+ transformRequest: n,
3697
+ transformResponse: n,
3698
+ paramsSerializer: n,
3699
+ timeout: n,
3700
+ timeoutMessage: n,
3701
+ withCredentials: n,
3702
+ withXSRFToken: n,
3703
+ adapter: n,
3704
+ responseType: n,
3705
+ xsrfCookieName: n,
3706
+ xsrfHeaderName: n,
3707
+ onUploadProgress: n,
3708
+ onDownloadProgress: n,
3709
+ decompress: n,
3710
+ maxContentLength: n,
3711
+ maxBodyLength: n,
3712
+ beforeRedirect: n,
3713
+ transport: n,
3714
+ httpAgent: n,
3715
+ httpsAgent: n,
3716
+ cancelToken: n,
3717
+ socketPath: n,
3718
+ responseEncoding: n,
3719
+ validateStatus: a,
3720
+ headers: (h, c, u) => i(Ut(h), Ut(c), u, !0)
3721
+ };
3722
+ return d.forEach(Object.keys({ ...t, ...e }), function(c) {
3723
+ const u = l[c] || i, f = u(t[c], e[c], c);
3724
+ d.isUndefined(f) && u !== a || (s[c] = f);
3725
+ }), s;
3726
+ }
3727
+ const $s = (t) => {
3728
+ const e = Z({}, t);
3729
+ let { data: s, withXSRFToken: r, xsrfHeaderName: i, xsrfCookieName: o, headers: n, auth: a } = e;
3730
+ if (e.headers = n = D.from(n), e.url = fs(bs(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), a && n.set(
3731
+ "Authorization",
3732
+ "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
3733
+ ), d.isFormData(s)) {
3734
+ if (x.hasStandardBrowserEnv || x.hasStandardBrowserWebWorkerEnv)
3735
+ n.setContentType(void 0);
3736
+ else if (d.isFunction(s.getHeaders)) {
3737
+ const l = s.getHeaders(), h = ["content-type", "content-length"];
3738
+ Object.entries(l).forEach(([c, u]) => {
3739
+ h.includes(c.toLowerCase()) && n.set(c, u);
3740
+ });
3741
+ }
3742
+ }
3743
+ if (x.hasStandardBrowserEnv && (r && d.isFunction(r) && (r = r(e)), r || r !== !1 && Ai(e.url))) {
3744
+ const l = i && o && vi.read(o);
3745
+ l && n.set(i, l);
3746
+ }
3747
+ return e;
3748
+ }, Ti = typeof XMLHttpRequest < "u", ki = Ti && function(t) {
3749
+ return new Promise(function(s, r) {
3750
+ const i = $s(t);
3751
+ let o = i.data;
3752
+ const n = D.from(i.headers).normalize();
3753
+ let { responseType: a, onUploadProgress: l, onDownloadProgress: h } = i, c, u, f, y, p;
3754
+ function g() {
3755
+ y && y(), p && p(), i.cancelToken && i.cancelToken.unsubscribe(c), i.signal && i.signal.removeEventListener("abort", c);
3756
+ }
3757
+ let m = new XMLHttpRequest();
3758
+ m.open(i.method.toUpperCase(), i.url, !0), m.timeout = i.timeout;
3759
+ function w() {
3760
+ if (!m)
3761
+ return;
3762
+ const E = D.from(
3763
+ "getAllResponseHeaders" in m && m.getAllResponseHeaders()
3764
+ ), R = {
3765
+ data: !a || a === "text" || a === "json" ? m.responseText : m.response,
3766
+ status: m.status,
3767
+ statusText: m.statusText,
3768
+ headers: E,
3769
+ config: t,
3770
+ request: m
3771
+ };
3772
+ ws(function(U) {
3773
+ s(U), g();
3774
+ }, function(U) {
3775
+ r(U), g();
3776
+ }, R), m = null;
3777
+ }
3778
+ "onloadend" in m ? m.onloadend = w : m.onreadystatechange = function() {
3779
+ !m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(w);
3780
+ }, m.onabort = function() {
3781
+ m && (r(new S("Request aborted", S.ECONNABORTED, t, m)), m = null);
3782
+ }, m.onerror = function(k) {
3783
+ const R = k && k.message ? k.message : "Network Error", q = new S(R, S.ERR_NETWORK, t, m);
3784
+ q.event = k || null, r(q), m = null;
3785
+ }, m.ontimeout = function() {
3786
+ let k = i.timeout ? "timeout of " + i.timeout + "ms exceeded" : "timeout exceeded";
3787
+ const R = i.transitional || ms;
3788
+ i.timeoutErrorMessage && (k = i.timeoutErrorMessage), r(new S(
3789
+ k,
3790
+ R.clarifyTimeoutError ? S.ETIMEDOUT : S.ECONNABORTED,
3791
+ t,
3792
+ m
3793
+ )), m = null;
3794
+ }, o === void 0 && n.setContentType(null), "setRequestHeader" in m && d.forEach(n.toJSON(), function(k, R) {
3795
+ m.setRequestHeader(R, k);
3796
+ }), d.isUndefined(i.withCredentials) || (m.withCredentials = !!i.withCredentials), a && a !== "json" && (m.responseType = i.responseType), h && ([f, p] = Oe(h, !0), m.addEventListener("progress", f)), l && m.upload && ([u, y] = Oe(l), m.upload.addEventListener("progress", u), m.upload.addEventListener("loadend", y)), (i.cancelToken || i.signal) && (c = (E) => {
3797
+ m && (r(!E || E.type ? new ne(null, t, m) : E), m.abort(), m = null);
3798
+ }, i.cancelToken && i.cancelToken.subscribe(c), i.signal && (i.signal.aborted ? c() : i.signal.addEventListener("abort", c)));
3799
+ const _ = bi(i.url);
3800
+ if (_ && x.protocols.indexOf(_) === -1) {
3801
+ r(new S("Unsupported protocol " + _ + ":", S.ERR_BAD_REQUEST, t));
3802
+ return;
3803
+ }
3804
+ m.send(o || null);
3805
+ });
3806
+ }, Ci = (t, e) => {
3807
+ const { length: s } = t = t ? t.filter(Boolean) : [];
3808
+ if (e || s) {
3809
+ let r = new AbortController(), i;
3810
+ const o = function(h) {
3811
+ if (!i) {
3812
+ i = !0, a();
3813
+ const c = h instanceof Error ? h : this.reason;
3814
+ r.abort(c instanceof S ? c : new ne(c instanceof Error ? c.message : c));
3815
+ }
3816
+ };
3817
+ let n = e && setTimeout(() => {
3818
+ n = null, o(new S(`timeout ${e} of ms exceeded`, S.ETIMEDOUT));
3819
+ }, e);
3820
+ const a = () => {
3821
+ t && (n && clearTimeout(n), n = null, t.forEach((h) => {
3822
+ h.unsubscribe ? h.unsubscribe(o) : h.removeEventListener("abort", o);
3823
+ }), t = null);
3824
+ };
3825
+ t.forEach((h) => h.addEventListener("abort", o));
3826
+ const { signal: l } = r;
3827
+ return l.unsubscribe = () => d.asap(a), l;
3828
+ }
3829
+ }, Oi = function* (t, e) {
3830
+ let s = t.byteLength;
3831
+ if (s < e) {
3832
+ yield t;
3833
+ return;
3834
+ }
3835
+ let r = 0, i;
3836
+ for (; r < s; )
3837
+ i = r + e, yield t.slice(r, i), r = i;
3838
+ }, xi = async function* (t, e) {
3839
+ for await (const s of Ri(t))
3840
+ yield* Oi(s, e);
3841
+ }, Ri = async function* (t) {
3842
+ if (t[Symbol.asyncIterator]) {
3843
+ yield* t;
3844
+ return;
3845
+ }
3846
+ const e = t.getReader();
3847
+ try {
3848
+ for (; ; ) {
3849
+ const { done: s, value: r } = await e.read();
3850
+ if (s)
3851
+ break;
3852
+ yield r;
3853
+ }
3854
+ } finally {
3855
+ await e.cancel();
3856
+ }
3857
+ }, Nt = (t, e, s, r) => {
3858
+ const i = xi(t, e);
3859
+ let o = 0, n, a = (l) => {
3860
+ n || (n = !0, r && r(l));
3861
+ };
3862
+ return new ReadableStream({
3863
+ async pull(l) {
3864
+ try {
3865
+ const { done: h, value: c } = await i.next();
3866
+ if (h) {
3867
+ a(), l.close();
3868
+ return;
3869
+ }
3870
+ let u = c.byteLength;
3871
+ if (s) {
3872
+ let f = o += u;
3873
+ s(f);
3874
+ }
3875
+ l.enqueue(new Uint8Array(c));
3876
+ } catch (h) {
3877
+ throw a(h), h;
3878
+ }
3879
+ },
3880
+ cancel(l) {
3881
+ return a(l), i.return();
3882
+ }
3883
+ }, {
3884
+ highWaterMark: 2
3885
+ });
3886
+ }, Lt = 64 * 1024, { isFunction: Ae } = d, Pi = (({ Request: t, Response: e }) => ({
3887
+ Request: t,
3888
+ Response: e
3889
+ }))(d.global), {
3890
+ ReadableStream: It,
3891
+ TextEncoder: Bt
3892
+ } = d.global, jt = (t, ...e) => {
3893
+ try {
3894
+ return !!t(...e);
3895
+ } catch {
3896
+ return !1;
3897
+ }
3898
+ }, Di = (t) => {
3899
+ t = d.merge.call({
3900
+ skipUndefined: !0
3901
+ }, Pi, t);
3902
+ const { fetch: e, Request: s, Response: r } = t, i = e ? Ae(e) : typeof fetch == "function", o = Ae(s), n = Ae(r);
3903
+ if (!i)
3904
+ return !1;
3905
+ const a = i && Ae(It), l = i && (typeof Bt == "function" ? /* @__PURE__ */ ((p) => (g) => p.encode(g))(new Bt()) : async (p) => new Uint8Array(await new s(p).arrayBuffer())), h = o && a && jt(() => {
3906
+ let p = !1;
3907
+ const g = new s(x.origin, {
3908
+ body: new It(),
3909
+ method: "POST",
3910
+ get duplex() {
3911
+ return p = !0, "half";
3912
+ }
3913
+ }).headers.has("Content-Type");
3914
+ return p && !g;
3915
+ }), c = n && a && jt(() => d.isReadableStream(new r("").body)), u = {
3916
+ stream: c && ((p) => p.body)
3917
+ };
3918
+ i && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((p) => {
3919
+ !u[p] && (u[p] = (g, m) => {
3920
+ let w = g && g[p];
3921
+ if (w)
3922
+ return w.call(g);
3923
+ throw new S(`Response type '${p}' is not supported`, S.ERR_NOT_SUPPORT, m);
3924
+ });
3925
+ });
3926
+ const f = async (p) => {
3927
+ if (p == null)
3928
+ return 0;
3929
+ if (d.isBlob(p))
3930
+ return p.size;
3931
+ if (d.isSpecCompliantForm(p))
3932
+ return (await new s(x.origin, {
3933
+ method: "POST",
3934
+ body: p
3935
+ }).arrayBuffer()).byteLength;
3936
+ if (d.isArrayBufferView(p) || d.isArrayBuffer(p))
3937
+ return p.byteLength;
3938
+ if (d.isURLSearchParams(p) && (p = p + ""), d.isString(p))
3939
+ return (await l(p)).byteLength;
3940
+ }, y = async (p, g) => {
3941
+ const m = d.toFiniteNumber(p.getContentLength());
3942
+ return m ?? f(g);
3943
+ };
3944
+ return async (p) => {
3945
+ let {
3946
+ url: g,
3947
+ method: m,
3948
+ data: w,
3949
+ signal: _,
3950
+ cancelToken: E,
3951
+ timeout: k,
3952
+ onDownloadProgress: R,
3953
+ onUploadProgress: q,
3954
+ responseType: U,
3955
+ headers: Ie,
3956
+ withCredentials: be = "same-origin",
3957
+ fetchOptions: at
3958
+ } = $s(p), lt = e || fetch;
3959
+ U = U ? (U + "").toLowerCase() : "text";
3960
+ let $e = Ci([_, E && E.toAbortSignal()], k), ae = null;
3961
+ const z = $e && $e.unsubscribe && (() => {
3962
+ $e.unsubscribe();
3963
+ });
3964
+ let ct;
3965
+ try {
3966
+ if (q && h && m !== "get" && m !== "head" && (ct = await y(Ie, w)) !== 0) {
3967
+ let j = new s(g, {
3968
+ method: "POST",
3969
+ body: w,
3970
+ duplex: "half"
3971
+ }), X;
3972
+ if (d.isFormData(w) && (X = j.headers.get("content-type")) && Ie.setContentType(X), j.body) {
3973
+ const [Be, Se] = Pt(
3974
+ ct,
3975
+ Oe(Dt(q))
3976
+ );
3977
+ w = Nt(j.body, Lt, Be, Se);
3978
+ }
3979
+ }
3980
+ d.isString(be) || (be = be ? "include" : "omit");
3981
+ const L = o && "credentials" in s.prototype, ht = {
3982
+ ...at,
3983
+ signal: $e,
3984
+ method: m.toUpperCase(),
3985
+ headers: Ie.normalize().toJSON(),
3986
+ body: w,
3987
+ duplex: "half",
3988
+ credentials: L ? be : void 0
3989
+ };
3990
+ ae = o && new s(g, ht);
3991
+ let B = await (o ? lt(ae, at) : lt(g, ht));
3992
+ const dt = c && (U === "stream" || U === "response");
3993
+ if (c && (R || dt && z)) {
3994
+ const j = {};
3995
+ ["status", "statusText", "headers"].forEach((ut) => {
3996
+ j[ut] = B[ut];
3997
+ });
3998
+ const X = d.toFiniteNumber(B.headers.get("content-length")), [Be, Se] = R && Pt(
3999
+ X,
4000
+ Oe(Dt(R), !0)
4001
+ ) || [];
4002
+ B = new r(
4003
+ Nt(B.body, Lt, Be, () => {
4004
+ Se && Se(), z && z();
4005
+ }),
4006
+ j
4007
+ );
4008
+ }
4009
+ U = U || "text";
4010
+ let _s = await u[d.findKey(u, U) || "text"](B, p);
4011
+ return !dt && z && z(), await new Promise((j, X) => {
4012
+ ws(j, X, {
4013
+ data: _s,
4014
+ headers: D.from(B.headers),
4015
+ status: B.status,
4016
+ statusText: B.statusText,
4017
+ config: p,
4018
+ request: ae
4019
+ });
4020
+ });
4021
+ } catch (L) {
4022
+ throw z && z(), L && L.name === "TypeError" && /Load failed|fetch/i.test(L.message) ? Object.assign(
4023
+ new S("Network Error", S.ERR_NETWORK, p, ae),
4024
+ {
4025
+ cause: L.cause || L
4026
+ }
4027
+ ) : S.from(L, L && L.code, p, ae);
4028
+ }
4029
+ };
4030
+ }, Ui = /* @__PURE__ */ new Map(), Ss = (t) => {
4031
+ let e = t && t.env || {};
4032
+ const { fetch: s, Request: r, Response: i } = e, o = [
4033
+ r,
4034
+ i,
4035
+ s
4036
+ ];
4037
+ let n = o.length, a = n, l, h, c = Ui;
4038
+ for (; a--; )
4039
+ l = o[a], h = c.get(l), h === void 0 && c.set(l, h = a ? /* @__PURE__ */ new Map() : Di(e)), c = h;
4040
+ return h;
4041
+ };
4042
+ Ss();
4043
+ const ot = {
4044
+ http: Zr,
4045
+ xhr: ki,
4046
+ fetch: {
4047
+ get: Ss
4048
+ }
4049
+ };
4050
+ d.forEach(ot, (t, e) => {
4051
+ if (t) {
4052
+ try {
4053
+ Object.defineProperty(t, "name", { value: e });
4054
+ } catch {
4055
+ }
4056
+ Object.defineProperty(t, "adapterName", { value: e });
4057
+ }
4058
+ });
4059
+ const Ht = (t) => `- ${t}`, Ni = (t) => d.isFunction(t) || t === null || t === !1;
4060
+ function Li(t, e) {
4061
+ t = d.isArray(t) ? t : [t];
4062
+ const { length: s } = t;
4063
+ let r, i;
4064
+ const o = {};
4065
+ for (let n = 0; n < s; n++) {
4066
+ r = t[n];
4067
+ let a;
4068
+ if (i = r, !Ni(r) && (i = ot[(a = String(r)).toLowerCase()], i === void 0))
4069
+ throw new S(`Unknown adapter '${a}'`);
4070
+ if (i && (d.isFunction(i) || (i = i.get(e))))
4071
+ break;
4072
+ o[a || "#" + n] = i;
4073
+ }
4074
+ if (!i) {
4075
+ const n = Object.entries(o).map(
4076
+ ([l, h]) => `adapter ${l} ` + (h === !1 ? "is not supported by the environment" : "is not available in the build")
4077
+ );
4078
+ let a = s ? n.length > 1 ? `since :
4079
+ ` + n.map(Ht).join(`
4080
+ `) : " " + Ht(n[0]) : "as no adapter specified";
4081
+ throw new S(
4082
+ "There is no suitable adapter to dispatch the request " + a,
4083
+ "ERR_NOT_SUPPORT"
4084
+ );
4085
+ }
4086
+ return i;
4087
+ }
4088
+ const As = {
4089
+ /**
4090
+ * Resolve an adapter from a list of adapter names or functions.
4091
+ * @type {Function}
4092
+ */
4093
+ getAdapter: Li,
4094
+ /**
4095
+ * Exposes all known adapters
4096
+ * @type {Object<string, Function|Object>}
4097
+ */
4098
+ adapters: ot
4099
+ };
4100
+ function ze(t) {
4101
+ if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
4102
+ throw new ne(null, t);
4103
+ }
4104
+ function Ft(t) {
4105
+ return ze(t), t.headers = D.from(t.headers), t.data = qe.call(
4106
+ t,
4107
+ t.transformRequest
4108
+ ), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), As.getAdapter(t.adapter || we.adapter, t)(t).then(function(r) {
4109
+ return ze(t), r.data = qe.call(
4110
+ t,
4111
+ t.transformResponse,
4112
+ r
4113
+ ), r.headers = D.from(r.headers), r;
4114
+ }, function(r) {
4115
+ return ys(r) || (ze(t), r && r.response && (r.response.data = qe.call(
4116
+ t,
4117
+ t.transformResponse,
4118
+ r.response
4119
+ ), r.response.headers = D.from(r.response.headers))), Promise.reject(r);
4120
+ });
4121
+ }
4122
+ const vs = "1.13.2", Le = {};
4123
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
4124
+ Le[t] = function(r) {
4125
+ return typeof r === t || "a" + (e < 1 ? "n " : " ") + t;
4126
+ };
4127
+ });
4128
+ const Mt = {};
4129
+ Le.transitional = function(e, s, r) {
4130
+ function i(o, n) {
4131
+ return "[Axios v" + vs + "] Transitional option '" + o + "'" + n + (r ? ". " + r : "");
4132
+ }
4133
+ return (o, n, a) => {
4134
+ if (e === !1)
4135
+ throw new S(
4136
+ i(n, " has been removed" + (s ? " in " + s : "")),
4137
+ S.ERR_DEPRECATED
4138
+ );
4139
+ return s && !Mt[n] && (Mt[n] = !0), e ? e(o, n, a) : !0;
4140
+ };
4141
+ };
4142
+ Le.spelling = function(e) {
4143
+ return (s, r) => !0;
4144
+ };
4145
+ function Ii(t, e, s) {
4146
+ if (typeof t != "object")
4147
+ throw new S("options must be an object", S.ERR_BAD_OPTION_VALUE);
4148
+ const r = Object.keys(t);
4149
+ let i = r.length;
4150
+ for (; i-- > 0; ) {
4151
+ const o = r[i], n = e[o];
4152
+ if (n) {
4153
+ const a = t[o], l = a === void 0 || n(a, o, t);
4154
+ if (l !== !0)
4155
+ throw new S("option " + o + " must be " + l, S.ERR_BAD_OPTION_VALUE);
4156
+ continue;
4157
+ }
4158
+ if (s !== !0)
4159
+ throw new S("Unknown option " + o, S.ERR_BAD_OPTION);
4160
+ }
4161
+ }
4162
+ const Te = {
4163
+ assertOptions: Ii,
4164
+ validators: Le
4165
+ }, I = Te.validators;
4166
+ class J {
4167
+ constructor(e) {
4168
+ this.defaults = e || {}, this.interceptors = {
4169
+ request: new xt(),
4170
+ response: new xt()
4171
+ };
4172
+ }
4173
+ /**
4174
+ * Dispatch a request
4175
+ *
4176
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
4177
+ * @param {?Object} config
4178
+ *
4179
+ * @returns {Promise} The Promise to be fulfilled
4180
+ */
4181
+ async request(e, s) {
4182
+ try {
4183
+ return await this._request(e, s);
4184
+ } catch (r) {
4185
+ if (r instanceof Error) {
4186
+ let i = {};
4187
+ Error.captureStackTrace ? Error.captureStackTrace(i) : i = new Error();
4188
+ const o = i.stack ? i.stack.replace(/^.+\n/, "") : "";
4189
+ try {
4190
+ r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
4191
+ ` + o) : r.stack = o;
4192
+ } catch {
4193
+ }
4194
+ }
4195
+ throw r;
4196
+ }
4197
+ }
4198
+ _request(e, s) {
4199
+ typeof e == "string" ? (s = s || {}, s.url = e) : s = e || {}, s = Z(this.defaults, s);
4200
+ const { transitional: r, paramsSerializer: i, headers: o } = s;
4201
+ r !== void 0 && Te.assertOptions(r, {
4202
+ silentJSONParsing: I.transitional(I.boolean),
4203
+ forcedJSONParsing: I.transitional(I.boolean),
4204
+ clarifyTimeoutError: I.transitional(I.boolean)
4205
+ }, !1), i != null && (d.isFunction(i) ? s.paramsSerializer = {
4206
+ serialize: i
4207
+ } : Te.assertOptions(i, {
4208
+ encode: I.function,
4209
+ serialize: I.function
4210
+ }, !0)), s.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? s.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : s.allowAbsoluteUrls = !0), Te.assertOptions(s, {
4211
+ baseUrl: I.spelling("baseURL"),
4212
+ withXsrfToken: I.spelling("withXSRFToken")
4213
+ }, !0), s.method = (s.method || this.defaults.method || "get").toLowerCase();
4214
+ let n = o && d.merge(
4215
+ o.common,
4216
+ o[s.method]
4217
+ );
4218
+ o && d.forEach(
4219
+ ["delete", "get", "head", "post", "put", "patch", "common"],
4220
+ (p) => {
4221
+ delete o[p];
4222
+ }
4223
+ ), s.headers = D.concat(n, o);
4224
+ const a = [];
4225
+ let l = !0;
4226
+ this.interceptors.request.forEach(function(g) {
4227
+ typeof g.runWhen == "function" && g.runWhen(s) === !1 || (l = l && g.synchronous, a.unshift(g.fulfilled, g.rejected));
4228
+ });
4229
+ const h = [];
4230
+ this.interceptors.response.forEach(function(g) {
4231
+ h.push(g.fulfilled, g.rejected);
4232
+ });
4233
+ let c, u = 0, f;
4234
+ if (!l) {
4235
+ const p = [Ft.bind(this), void 0];
4236
+ for (p.unshift(...a), p.push(...h), f = p.length, c = Promise.resolve(s); u < f; )
4237
+ c = c.then(p[u++], p[u++]);
4238
+ return c;
4239
+ }
4240
+ f = a.length;
4241
+ let y = s;
4242
+ for (; u < f; ) {
4243
+ const p = a[u++], g = a[u++];
4244
+ try {
4245
+ y = p(y);
4246
+ } catch (m) {
4247
+ g.call(this, m);
4248
+ break;
4249
+ }
4250
+ }
4251
+ try {
4252
+ c = Ft.call(this, y);
4253
+ } catch (p) {
4254
+ return Promise.reject(p);
4255
+ }
4256
+ for (u = 0, f = h.length; u < f; )
4257
+ c = c.then(h[u++], h[u++]);
4258
+ return c;
4259
+ }
4260
+ getUri(e) {
4261
+ e = Z(this.defaults, e);
4262
+ const s = bs(e.baseURL, e.url, e.allowAbsoluteUrls);
4263
+ return fs(s, e.params, e.paramsSerializer);
4264
+ }
4265
+ }
4266
+ d.forEach(["delete", "get", "head", "options"], function(e) {
4267
+ J.prototype[e] = function(s, r) {
4268
+ return this.request(Z(r || {}, {
4269
+ method: e,
4270
+ url: s,
4271
+ data: (r || {}).data
4272
+ }));
4273
+ };
4274
+ });
4275
+ d.forEach(["post", "put", "patch"], function(e) {
4276
+ function s(r) {
4277
+ return function(o, n, a) {
4278
+ return this.request(Z(a || {}, {
4279
+ method: e,
4280
+ headers: r ? {
4281
+ "Content-Type": "multipart/form-data"
4282
+ } : {},
4283
+ url: o,
4284
+ data: n
4285
+ }));
4286
+ };
4287
+ }
4288
+ J.prototype[e] = s(), J.prototype[e + "Form"] = s(!0);
4289
+ });
4290
+ class nt {
4291
+ constructor(e) {
4292
+ if (typeof e != "function")
4293
+ throw new TypeError("executor must be a function.");
4294
+ let s;
4295
+ this.promise = new Promise(function(o) {
4296
+ s = o;
4297
+ });
4298
+ const r = this;
4299
+ this.promise.then((i) => {
4300
+ if (!r._listeners) return;
4301
+ let o = r._listeners.length;
4302
+ for (; o-- > 0; )
4303
+ r._listeners[o](i);
4304
+ r._listeners = null;
4305
+ }), this.promise.then = (i) => {
4306
+ let o;
4307
+ const n = new Promise((a) => {
4308
+ r.subscribe(a), o = a;
4309
+ }).then(i);
4310
+ return n.cancel = function() {
4311
+ r.unsubscribe(o);
4312
+ }, n;
4313
+ }, e(function(o, n, a) {
4314
+ r.reason || (r.reason = new ne(o, n, a), s(r.reason));
4315
+ });
4316
+ }
4317
+ /**
4318
+ * Throws a `CanceledError` if cancellation has been requested.
4319
+ */
4320
+ throwIfRequested() {
4321
+ if (this.reason)
4322
+ throw this.reason;
4323
+ }
4324
+ /**
4325
+ * Subscribe to the cancel signal
4326
+ */
4327
+ subscribe(e) {
4328
+ if (this.reason) {
4329
+ e(this.reason);
4330
+ return;
4331
+ }
4332
+ this._listeners ? this._listeners.push(e) : this._listeners = [e];
4333
+ }
4334
+ /**
4335
+ * Unsubscribe from the cancel signal
4336
+ */
4337
+ unsubscribe(e) {
4338
+ if (!this._listeners)
4339
+ return;
4340
+ const s = this._listeners.indexOf(e);
4341
+ s !== -1 && this._listeners.splice(s, 1);
4342
+ }
4343
+ toAbortSignal() {
4344
+ const e = new AbortController(), s = (r) => {
4345
+ e.abort(r);
4346
+ };
4347
+ return this.subscribe(s), e.signal.unsubscribe = () => this.unsubscribe(s), e.signal;
4348
+ }
4349
+ /**
4350
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
4351
+ * cancels the `CancelToken`.
4352
+ */
4353
+ static source() {
4354
+ let e;
4355
+ return {
4356
+ token: new nt(function(i) {
4357
+ e = i;
4358
+ }),
4359
+ cancel: e
4360
+ };
4361
+ }
4362
+ }
4363
+ function Bi(t) {
4364
+ return function(s) {
4365
+ return t.apply(null, s);
4366
+ };
4367
+ }
4368
+ function ji(t) {
4369
+ return d.isObject(t) && t.isAxiosError === !0;
4370
+ }
4371
+ const Ye = {
4372
+ Continue: 100,
4373
+ SwitchingProtocols: 101,
4374
+ Processing: 102,
4375
+ EarlyHints: 103,
4376
+ Ok: 200,
4377
+ Created: 201,
4378
+ Accepted: 202,
4379
+ NonAuthoritativeInformation: 203,
4380
+ NoContent: 204,
4381
+ ResetContent: 205,
4382
+ PartialContent: 206,
4383
+ MultiStatus: 207,
4384
+ AlreadyReported: 208,
4385
+ ImUsed: 226,
4386
+ MultipleChoices: 300,
4387
+ MovedPermanently: 301,
4388
+ Found: 302,
4389
+ SeeOther: 303,
4390
+ NotModified: 304,
4391
+ UseProxy: 305,
4392
+ Unused: 306,
4393
+ TemporaryRedirect: 307,
4394
+ PermanentRedirect: 308,
4395
+ BadRequest: 400,
4396
+ Unauthorized: 401,
4397
+ PaymentRequired: 402,
4398
+ Forbidden: 403,
4399
+ NotFound: 404,
4400
+ MethodNotAllowed: 405,
4401
+ NotAcceptable: 406,
4402
+ ProxyAuthenticationRequired: 407,
4403
+ RequestTimeout: 408,
4404
+ Conflict: 409,
4405
+ Gone: 410,
4406
+ LengthRequired: 411,
4407
+ PreconditionFailed: 412,
4408
+ PayloadTooLarge: 413,
4409
+ UriTooLong: 414,
4410
+ UnsupportedMediaType: 415,
4411
+ RangeNotSatisfiable: 416,
4412
+ ExpectationFailed: 417,
4413
+ ImATeapot: 418,
4414
+ MisdirectedRequest: 421,
4415
+ UnprocessableEntity: 422,
4416
+ Locked: 423,
4417
+ FailedDependency: 424,
4418
+ TooEarly: 425,
4419
+ UpgradeRequired: 426,
4420
+ PreconditionRequired: 428,
4421
+ TooManyRequests: 429,
4422
+ RequestHeaderFieldsTooLarge: 431,
4423
+ UnavailableForLegalReasons: 451,
4424
+ InternalServerError: 500,
4425
+ NotImplemented: 501,
4426
+ BadGateway: 502,
4427
+ ServiceUnavailable: 503,
4428
+ GatewayTimeout: 504,
4429
+ HttpVersionNotSupported: 505,
4430
+ VariantAlsoNegotiates: 506,
4431
+ InsufficientStorage: 507,
4432
+ LoopDetected: 508,
4433
+ NotExtended: 510,
4434
+ NetworkAuthenticationRequired: 511,
4435
+ WebServerIsDown: 521,
4436
+ ConnectionTimedOut: 522,
4437
+ OriginIsUnreachable: 523,
4438
+ TimeoutOccurred: 524,
4439
+ SslHandshakeFailed: 525,
4440
+ InvalidSslCertificate: 526
4441
+ };
4442
+ Object.entries(Ye).forEach(([t, e]) => {
4443
+ Ye[e] = t;
4444
+ });
4445
+ function Es(t) {
4446
+ const e = new J(t), s = ss(J.prototype.request, e);
4447
+ return d.extend(s, J.prototype, e, { allOwnKeys: !0 }), d.extend(s, e, null, { allOwnKeys: !0 }), s.create = function(i) {
4448
+ return Es(Z(t, i));
4449
+ }, s;
4450
+ }
4451
+ const C = Es(we);
4452
+ C.Axios = J;
4453
+ C.CanceledError = ne;
4454
+ C.CancelToken = nt;
4455
+ C.isCancel = ys;
4456
+ C.VERSION = vs;
4457
+ C.toFormData = Ne;
4458
+ C.AxiosError = S;
4459
+ C.Cancel = C.CanceledError;
4460
+ C.all = function(e) {
4461
+ return Promise.all(e);
4462
+ };
4463
+ C.spread = Bi;
4464
+ C.isAxiosError = ji;
4465
+ C.mergeConfig = Z;
4466
+ C.AxiosHeaders = D;
4467
+ C.formToJSON = (t) => gs(d.isHTMLForm(t) ? new FormData(t) : t);
4468
+ C.getAdapter = As.getAdapter;
4469
+ C.HttpStatusCode = Ye;
4470
+ C.default = C;
4471
+ class qt extends Error {
4472
+ constructor(e = "Authentication refresh failed") {
4473
+ super(e), this.name = "AuthRefreshError";
4474
+ }
4475
+ }
4476
+ const Hi = ({ baseUrl: t, apiBaseUrl: e }) => {
4477
+ const s = ts(), r = e || t, i = C.create({
4478
+ baseURL: t,
4479
+ headers: {
4480
+ "Content-Type": "application/json"
4481
+ }
4482
+ });
4483
+ let o = !1, n = null;
4484
+ return i.interceptors.request.use(
4485
+ (a) => {
4486
+ const l = s.getAuthToken("AUTH_TOKEN");
4487
+ return l && a.headers && (a.headers.Authorization = `Bearer ${l}`), a;
4488
+ },
4489
+ (a) => Promise.reject(a)
4490
+ ), i.interceptors.response.use(
4491
+ (a) => a,
4492
+ async (a) => {
4493
+ const l = a.config;
4494
+ if (a.response?.status === 401 && !l._retry) {
4495
+ l._retry = !0;
4496
+ try {
4497
+ if (o && n) {
4498
+ const c = await n;
4499
+ return l.headers && (l.headers.Authorization = `Bearer ${c}`), i(l);
4500
+ }
4501
+ o = !0, n = (async () => {
4502
+ try {
4503
+ const c = s.getAuthToken("REFRESH_TOKEN"), u = s.getAuthToken("ACCESS_TOKEN"), f = s.getAuthToken("AUTH_TOKEN");
4504
+ if (!c || !u || !f)
4505
+ throw s.clearAllAuthTokens(), new qt("No refresh token available");
4506
+ const y = es({ baseUrl: r }), {
4507
+ accessToken: p,
4508
+ idToken: g,
4509
+ refreshToken: m
4510
+ } = await y.refresh({ refreshToken: c });
4511
+ return s.setAuthToken("ACCESS_TOKEN", p), s.setAuthToken("AUTH_TOKEN", g), s.setAuthToken("REFRESH_TOKEN", m ?? c), g;
4512
+ } catch (c) {
4513
+ throw s.clearAllAuthTokens(), new qt(
4514
+ c.message || "Failed to refresh authentication"
4515
+ );
4516
+ } finally {
4517
+ o = !1, n = null;
4518
+ }
4519
+ })();
4520
+ const h = await n;
4521
+ return l.headers && (l.headers.Authorization = `Bearer ${h}`), i(l);
4522
+ } catch (h) {
4523
+ return Promise.reject(h);
4524
+ }
4525
+ }
4526
+ return Promise.reject(a);
4527
+ }
4528
+ ), i;
4529
+ }, Ki = Hi;
2725
4530
  export {
2726
- f as CalsAuth,
2727
- E as CalsThemeToggle
4531
+ A as Auth,
4532
+ qt as AuthRefreshError,
4533
+ M as ThemeToggle,
4534
+ Ki as apiClient,
4535
+ Hi as createApiClient
2728
4536
  };