@salla.sa/ui-address-autocomplete-widget 1.0.5 → 1.0.6
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 +339 -432
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
const D = globalThis, G = D.ShadowRoot && (D.ShadyCSS === void 0 || D.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Z = Symbol(), X = /* @__PURE__ */ new WeakMap();
|
|
7
|
-
let pe = class {
|
|
8
|
-
constructor(e, t, r) {
|
|
9
|
-
if (this._$cssResult$ = !0, r !== Z) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
1
|
+
const U = globalThis, q = U.ShadowRoot && (U.ShadyCSS === void 0 || U.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, H = /* @__PURE__ */ Symbol(), Z = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let le = class {
|
|
3
|
+
constructor(e, t, s) {
|
|
4
|
+
if (this._$cssResult$ = !0, s !== H) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
10
5
|
this.cssText = e, this.t = t;
|
|
11
6
|
}
|
|
12
7
|
get styleSheet() {
|
|
13
8
|
let e = this.o;
|
|
14
9
|
const t = this.t;
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
|
|
10
|
+
if (q && e === void 0) {
|
|
11
|
+
const s = t !== void 0 && t.length === 1;
|
|
12
|
+
s && (e = Z.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && Z.set(t, e));
|
|
18
13
|
}
|
|
19
14
|
return e;
|
|
20
15
|
}
|
|
@@ -22,33 +17,28 @@ let pe = class {
|
|
|
22
17
|
return this.cssText;
|
|
23
18
|
}
|
|
24
19
|
};
|
|
25
|
-
const
|
|
26
|
-
const t = i.length === 1 ? i[0] : e.reduce((
|
|
20
|
+
const ue = (i) => new le(typeof i == "string" ? i : i + "", void 0, H), me = (i, ...e) => {
|
|
21
|
+
const t = i.length === 1 ? i[0] : e.reduce((s, r, o) => s + ((a) => {
|
|
27
22
|
if (a._$cssResult$ === !0) return a.cssText;
|
|
28
23
|
if (typeof a == "number") return a;
|
|
29
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.");
|
|
30
|
-
})(
|
|
31
|
-
return new
|
|
32
|
-
},
|
|
33
|
-
if (
|
|
25
|
+
})(r) + i[o + 1], i[0]);
|
|
26
|
+
return new le(t, i, H);
|
|
27
|
+
}, fe = (i, e) => {
|
|
28
|
+
if (q) i.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
34
29
|
else for (const t of e) {
|
|
35
|
-
const
|
|
36
|
-
|
|
30
|
+
const s = document.createElement("style"), r = U.litNonce;
|
|
31
|
+
r !== void 0 && s.setAttribute("nonce", r), s.textContent = t.cssText, i.appendChild(s);
|
|
37
32
|
}
|
|
38
|
-
},
|
|
33
|
+
}, Y = q ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((e) => {
|
|
39
34
|
let t = "";
|
|
40
|
-
for (const
|
|
41
|
-
return
|
|
35
|
+
for (const s of e.cssRules) t += s.cssText;
|
|
36
|
+
return ue(t);
|
|
42
37
|
})(i) : i;
|
|
43
|
-
|
|
44
|
-
* @license
|
|
45
|
-
* Copyright 2017 Google LLC
|
|
46
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
-
*/
|
|
48
|
-
const { is: $e, defineProperty: Ae, getOwnPropertyDescriptor: we, getOwnPropertyNames: _e, getOwnPropertySymbols: xe, getPrototypeOf: Se } = Object, A = globalThis, ee = A.trustedTypes, Ee = ee ? ee.emptyScript : "", H = A.reactiveElementPolyfillSupport, C = (i, e) => i, M = { toAttribute(i, e) {
|
|
38
|
+
const { is: ge, defineProperty: ve, getOwnPropertyDescriptor: be, getOwnPropertyNames: ye, getOwnPropertySymbols: $e, getPrototypeOf: Ae } = Object, D = globalThis, J = D.trustedTypes, we = J ? J.emptyScript : "", _e = D.reactiveElementPolyfillSupport, P = (i, e) => i, V = { toAttribute(i, e) {
|
|
49
39
|
switch (e) {
|
|
50
40
|
case Boolean:
|
|
51
|
-
i = i ?
|
|
41
|
+
i = i ? we : null;
|
|
52
42
|
break;
|
|
53
43
|
case Object:
|
|
54
44
|
case Array:
|
|
@@ -73,142 +63,128 @@ const { is: $e, defineProperty: Ae, getOwnPropertyDescriptor: we, getOwnProperty
|
|
|
73
63
|
}
|
|
74
64
|
}
|
|
75
65
|
return t;
|
|
76
|
-
} },
|
|
77
|
-
Symbol.metadata
|
|
78
|
-
let
|
|
66
|
+
} }, j = (i, e) => !ge(i, e), X = { attribute: !0, type: String, converter: V, reflect: !1, useDefault: !1, hasChanged: j };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), D.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
+
let S = class extends HTMLElement {
|
|
79
69
|
static addInitializer(e) {
|
|
80
|
-
this._$Ei(), (this.l
|
|
70
|
+
this._$Ei(), (this.l ??= []).push(e);
|
|
81
71
|
}
|
|
82
72
|
static get observedAttributes() {
|
|
83
73
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
74
|
}
|
|
85
|
-
static createProperty(e, t =
|
|
75
|
+
static createProperty(e, t = X) {
|
|
86
76
|
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
87
|
-
const
|
|
88
|
-
|
|
77
|
+
const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(e, s, t);
|
|
78
|
+
r !== void 0 && ve(this.prototype, e, r);
|
|
89
79
|
}
|
|
90
80
|
}
|
|
91
|
-
static getPropertyDescriptor(e, t,
|
|
92
|
-
const { get:
|
|
81
|
+
static getPropertyDescriptor(e, t, s) {
|
|
82
|
+
const { get: r, set: o } = be(this.prototype, e) ?? { get() {
|
|
93
83
|
return this[t];
|
|
94
84
|
}, set(a) {
|
|
95
85
|
this[t] = a;
|
|
96
86
|
} };
|
|
97
|
-
return { get:
|
|
98
|
-
const
|
|
99
|
-
o
|
|
87
|
+
return { get: r, set(a) {
|
|
88
|
+
const n = r?.call(this);
|
|
89
|
+
o?.call(this, a), this.requestUpdate(e, n, s);
|
|
100
90
|
}, configurable: !0, enumerable: !0 };
|
|
101
91
|
}
|
|
102
92
|
static getPropertyOptions(e) {
|
|
103
|
-
return this.elementProperties.get(e) ??
|
|
93
|
+
return this.elementProperties.get(e) ?? X;
|
|
104
94
|
}
|
|
105
95
|
static _$Ei() {
|
|
106
|
-
if (this.hasOwnProperty(
|
|
107
|
-
const e =
|
|
96
|
+
if (this.hasOwnProperty(P("elementProperties"))) return;
|
|
97
|
+
const e = Ae(this);
|
|
108
98
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
109
99
|
}
|
|
110
100
|
static finalize() {
|
|
111
|
-
if (this.hasOwnProperty(
|
|
112
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
113
|
-
const t = this.properties,
|
|
114
|
-
for (const
|
|
101
|
+
if (this.hasOwnProperty(P("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
|
|
103
|
+
const t = this.properties, s = [...ye(t), ...$e(t)];
|
|
104
|
+
for (const r of s) this.createProperty(r, t[r]);
|
|
115
105
|
}
|
|
116
106
|
const e = this[Symbol.metadata];
|
|
117
107
|
if (e !== null) {
|
|
118
108
|
const t = litPropertyMetadata.get(e);
|
|
119
|
-
if (t !== void 0) for (const [
|
|
109
|
+
if (t !== void 0) for (const [s, r] of t) this.elementProperties.set(s, r);
|
|
120
110
|
}
|
|
121
111
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
122
|
-
for (const [t,
|
|
123
|
-
const
|
|
124
|
-
|
|
112
|
+
for (const [t, s] of this.elementProperties) {
|
|
113
|
+
const r = this._$Eu(t, s);
|
|
114
|
+
r !== void 0 && this._$Eh.set(r, t);
|
|
125
115
|
}
|
|
126
116
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
127
117
|
}
|
|
128
118
|
static finalizeStyles(e) {
|
|
129
119
|
const t = [];
|
|
130
120
|
if (Array.isArray(e)) {
|
|
131
|
-
const
|
|
132
|
-
for (const
|
|
133
|
-
} else e !== void 0 && t.push(
|
|
121
|
+
const s = new Set(e.flat(1 / 0).reverse());
|
|
122
|
+
for (const r of s) t.unshift(Y(r));
|
|
123
|
+
} else e !== void 0 && t.push(Y(e));
|
|
134
124
|
return t;
|
|
135
125
|
}
|
|
136
126
|
static _$Eu(e, t) {
|
|
137
|
-
const
|
|
138
|
-
return
|
|
127
|
+
const s = t.attribute;
|
|
128
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
139
129
|
}
|
|
140
130
|
constructor() {
|
|
141
131
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
142
132
|
}
|
|
143
133
|
_$Ev() {
|
|
144
|
-
|
|
145
|
-
this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (e = this.constructor.l) == null || e.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));
|
|
146
135
|
}
|
|
147
136
|
addController(e) {
|
|
148
|
-
|
|
149
|
-
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(e), this.renderRoot !== void 0 && this.isConnected && ((t = e.hostConnected) == null || t.call(e));
|
|
137
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
|
|
150
138
|
}
|
|
151
139
|
removeController(e) {
|
|
152
|
-
|
|
153
|
-
(t = this._$EO) == null || t.delete(e);
|
|
140
|
+
this._$EO?.delete(e);
|
|
154
141
|
}
|
|
155
142
|
_$E_() {
|
|
156
143
|
const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
|
|
157
|
-
for (const
|
|
144
|
+
for (const s of t.keys()) this.hasOwnProperty(s) && (e.set(s, this[s]), delete this[s]);
|
|
158
145
|
e.size > 0 && (this._$Ep = e);
|
|
159
146
|
}
|
|
160
147
|
createRenderRoot() {
|
|
161
148
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
162
|
-
return
|
|
149
|
+
return fe(e, this.constructor.elementStyles), e;
|
|
163
150
|
}
|
|
164
151
|
connectedCallback() {
|
|
165
|
-
|
|
166
|
-
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$EO) == null || e.forEach((t) => {
|
|
167
|
-
var r;
|
|
168
|
-
return (r = t.hostConnected) == null ? void 0 : r.call(t);
|
|
169
|
-
});
|
|
152
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
|
|
170
153
|
}
|
|
171
154
|
enableUpdating(e) {
|
|
172
155
|
}
|
|
173
156
|
disconnectedCallback() {
|
|
174
|
-
|
|
175
|
-
(e = this._$EO) == null || e.forEach((t) => {
|
|
176
|
-
var r;
|
|
177
|
-
return (r = t.hostDisconnected) == null ? void 0 : r.call(t);
|
|
178
|
-
});
|
|
157
|
+
this._$EO?.forEach((e) => e.hostDisconnected?.());
|
|
179
158
|
}
|
|
180
|
-
attributeChangedCallback(e, t,
|
|
181
|
-
this._$AK(e,
|
|
159
|
+
attributeChangedCallback(e, t, s) {
|
|
160
|
+
this._$AK(e, s);
|
|
182
161
|
}
|
|
183
162
|
_$ET(e, t) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
this._$Em = e, a == null ? this.removeAttribute(s) : this.setAttribute(s, a), this._$Em = null;
|
|
163
|
+
const s = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, s);
|
|
164
|
+
if (r !== void 0 && s.reflect === !0) {
|
|
165
|
+
const o = (s.converter?.toAttribute !== void 0 ? s.converter : V).toAttribute(t, s.type);
|
|
166
|
+
this._$Em = e, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
189
167
|
}
|
|
190
168
|
}
|
|
191
169
|
_$AK(e, t) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
this[s] = m ?? ((a = this._$Ej) == null ? void 0 : a.get(s)) ?? m, this._$Em = null;
|
|
170
|
+
const s = this.constructor, r = s._$Eh.get(e);
|
|
171
|
+
if (r !== void 0 && this._$Em !== r) {
|
|
172
|
+
const o = s.getPropertyOptions(r), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : V;
|
|
173
|
+
this._$Em = r;
|
|
174
|
+
const n = a.fromAttribute(t, o.type);
|
|
175
|
+
this[r] = n ?? this._$Ej?.get(r) ?? n, this._$Em = null;
|
|
199
176
|
}
|
|
200
177
|
}
|
|
201
|
-
requestUpdate(e, t,
|
|
202
|
-
var a;
|
|
178
|
+
requestUpdate(e, t, s, r = !1, o) {
|
|
203
179
|
if (e !== void 0) {
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
206
|
-
this.C(e, t,
|
|
180
|
+
const a = this.constructor;
|
|
181
|
+
if (r === !1 && (o = this[e]), s ??= a.getPropertyOptions(e), !((s.hasChanged ?? j)(o, t) || s.useDefault && s.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(a._$Eu(e, s)))) return;
|
|
182
|
+
this.C(e, t, s);
|
|
207
183
|
}
|
|
208
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
209
185
|
}
|
|
210
|
-
C(e, t, { useDefault:
|
|
211
|
-
|
|
186
|
+
C(e, t, { useDefault: s, reflect: r, wrapped: o }, a) {
|
|
187
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, a ?? t ?? this[e]), o !== !0 || a !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), r === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
212
188
|
}
|
|
213
189
|
async _$EP() {
|
|
214
190
|
this.isUpdatePending = !0;
|
|
@@ -224,26 +200,22 @@ let k = class extends HTMLElement {
|
|
|
224
200
|
return this.performUpdate();
|
|
225
201
|
}
|
|
226
202
|
performUpdate() {
|
|
227
|
-
var r;
|
|
228
203
|
if (!this.isUpdatePending) return;
|
|
229
204
|
if (!this.hasUpdated) {
|
|
230
|
-
if (this.renderRoot
|
|
231
|
-
for (const [
|
|
205
|
+
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
206
|
+
for (const [r, o] of this._$Ep) this[r] = o;
|
|
232
207
|
this._$Ep = void 0;
|
|
233
208
|
}
|
|
234
209
|
const s = this.constructor.elementProperties;
|
|
235
|
-
if (s.size > 0) for (const [
|
|
236
|
-
const { wrapped:
|
|
237
|
-
|
|
210
|
+
if (s.size > 0) for (const [r, o] of s) {
|
|
211
|
+
const { wrapped: a } = o, n = this[r];
|
|
212
|
+
a !== !0 || this._$AL.has(r) || n === void 0 || this.C(r, void 0, o, n);
|
|
238
213
|
}
|
|
239
214
|
}
|
|
240
215
|
let e = !1;
|
|
241
216
|
const t = this._$AL;
|
|
242
217
|
try {
|
|
243
|
-
e = this.shouldUpdate(t), e ? (this.willUpdate(t),
|
|
244
|
-
var o;
|
|
245
|
-
return (o = s.hostUpdate) == null ? void 0 : o.call(s);
|
|
246
|
-
}), this.update(t)) : this._$EM();
|
|
218
|
+
e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach((s) => s.hostUpdate?.()), this.update(t)) : this._$EM();
|
|
247
219
|
} catch (s) {
|
|
248
220
|
throw e = !1, this._$EM(), s;
|
|
249
221
|
}
|
|
@@ -252,11 +224,7 @@ let k = class extends HTMLElement {
|
|
|
252
224
|
willUpdate(e) {
|
|
253
225
|
}
|
|
254
226
|
_$AE(e) {
|
|
255
|
-
|
|
256
|
-
(t = this._$EO) == null || t.forEach((r) => {
|
|
257
|
-
var s;
|
|
258
|
-
return (s = r.hostUpdated) == null ? void 0 : s.call(r);
|
|
259
|
-
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
227
|
+
this._$EO?.forEach((t) => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
260
228
|
}
|
|
261
229
|
_$EM() {
|
|
262
230
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
@@ -271,83 +239,77 @@ let k = class extends HTMLElement {
|
|
|
271
239
|
return !0;
|
|
272
240
|
}
|
|
273
241
|
update(e) {
|
|
274
|
-
this._$Eq
|
|
242
|
+
this._$Eq &&= this._$Eq.forEach((t) => this._$ET(t, this[t])), this._$EM();
|
|
275
243
|
}
|
|
276
244
|
updated(e) {
|
|
277
245
|
}
|
|
278
246
|
firstUpdated(e) {
|
|
279
247
|
}
|
|
280
248
|
};
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
*
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
\f\r]`, T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, se = /-->/g, oe = />/g, w = RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
|
|
289
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), ae = /'/g, ne = /"/g, fe = /^(?:script|style|textarea|title)$/i, Te = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), g = Te(1), E = Symbol.for("lit-noChange"), f = Symbol.for("lit-nothing"), le = /* @__PURE__ */ new WeakMap(), _ = S.createTreeWalker(S, 129);
|
|
290
|
-
function ge(i, e) {
|
|
291
|
-
if (!J(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
292
|
-
return re !== void 0 ? re.createHTML(e) : e;
|
|
249
|
+
S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[P("elementProperties")] = /* @__PURE__ */ new Map(), S[P("finalized")] = /* @__PURE__ */ new Map(), _e?.({ ReactiveElement: S }), (D.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const W = globalThis, Q = (i) => i, O = W.trustedTypes, ee = O ? O.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, de = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, he = "?" + $, xe = `<${he}>`, _ = document, C = () => _.createComment(""), R = (i) => i === null || typeof i != "object" && typeof i != "function", K = Array.isArray, Se = (i) => K(i) || typeof i?.[Symbol.iterator] == "function", L = `[
|
|
251
|
+
\f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, te = /-->/g, ie = />/g, A = RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), se = /'/g, re = /"/g, ce = /^(?:script|style|textarea|title)$/i, Ee = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), g = Ee(1), x = /* @__PURE__ */ Symbol.for("lit-noChange"), f = /* @__PURE__ */ Symbol.for("lit-nothing"), oe = /* @__PURE__ */ new WeakMap(), w = _.createTreeWalker(_, 129);
|
|
253
|
+
function pe(i, e) {
|
|
254
|
+
if (!K(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
+
return ee !== void 0 ? ee.createHTML(e) : e;
|
|
293
256
|
}
|
|
294
|
-
const
|
|
295
|
-
const t = i.length - 1,
|
|
296
|
-
let
|
|
297
|
-
for (let
|
|
298
|
-
const
|
|
299
|
-
let m, c, u = -1,
|
|
300
|
-
for (;
|
|
301
|
-
const y = a ===
|
|
302
|
-
o += a ===
|
|
303
|
-
}
|
|
304
|
-
return [
|
|
257
|
+
const ke = (i, e) => {
|
|
258
|
+
const t = i.length - 1, s = [];
|
|
259
|
+
let r, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", a = k;
|
|
260
|
+
for (let n = 0; n < t; n++) {
|
|
261
|
+
const l = i[n];
|
|
262
|
+
let m, c, u = -1, b = 0;
|
|
263
|
+
for (; b < l.length && (a.lastIndex = b, c = a.exec(l), c !== null); ) b = a.lastIndex, a === k ? c[1] === "!--" ? a = te : c[1] !== void 0 ? a = ie : c[2] !== void 0 ? (ce.test(c[2]) && (r = RegExp("</" + c[2], "g")), a = A) : c[3] !== void 0 && (a = A) : a === A ? c[0] === ">" ? (a = r ?? k, u = -1) : c[1] === void 0 ? u = -2 : (u = a.lastIndex - c[2].length, m = c[1], a = c[3] === void 0 ? A : c[3] === '"' ? re : se) : a === re || a === se ? a = A : a === te || a === ie ? a = k : (a = A, r = void 0);
|
|
264
|
+
const y = a === A && i[n + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += a === k ? l + xe : u >= 0 ? (s.push(m), l.slice(0, u) + de + l.slice(u) + $ + y) : l + $ + (u === -2 ? n : y);
|
|
266
|
+
}
|
|
267
|
+
return [pe(i, o + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
|
|
305
268
|
};
|
|
306
|
-
class
|
|
307
|
-
constructor({ strings: e, _$litType$: t },
|
|
308
|
-
let
|
|
269
|
+
class I {
|
|
270
|
+
constructor({ strings: e, _$litType$: t }, s) {
|
|
271
|
+
let r;
|
|
309
272
|
this.parts = [];
|
|
310
273
|
let o = 0, a = 0;
|
|
311
|
-
const
|
|
312
|
-
if (this.el =
|
|
274
|
+
const n = e.length - 1, l = this.parts, [m, c] = ke(e, t);
|
|
275
|
+
if (this.el = I.createElement(m, s), w.currentNode = this.el.content, t === 2 || t === 3) {
|
|
313
276
|
const u = this.el.content.firstChild;
|
|
314
277
|
u.replaceWith(...u.childNodes);
|
|
315
278
|
}
|
|
316
|
-
for (; (
|
|
317
|
-
if (
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
} else u.startsWith($) && (
|
|
322
|
-
if (
|
|
323
|
-
const u =
|
|
324
|
-
if (
|
|
325
|
-
|
|
326
|
-
for (let y = 0; y <
|
|
327
|
-
|
|
279
|
+
for (; (r = w.nextNode()) !== null && l.length < n; ) {
|
|
280
|
+
if (r.nodeType === 1) {
|
|
281
|
+
if (r.hasAttributes()) for (const u of r.getAttributeNames()) if (u.endsWith(de)) {
|
|
282
|
+
const b = c[a++], y = r.getAttribute(u).split($), z = /([.?@])?(.*)/.exec(b);
|
|
283
|
+
l.push({ type: 1, index: o, name: z[2], strings: y, ctor: z[1] === "." ? Te : z[1] === "?" ? Ce : z[1] === "@" ? Re : M }), r.removeAttribute(u);
|
|
284
|
+
} else u.startsWith($) && (l.push({ type: 6, index: o }), r.removeAttribute(u));
|
|
285
|
+
if (ce.test(r.tagName)) {
|
|
286
|
+
const u = r.textContent.split($), b = u.length - 1;
|
|
287
|
+
if (b > 0) {
|
|
288
|
+
r.textContent = O ? O.emptyScript : "";
|
|
289
|
+
for (let y = 0; y < b; y++) r.append(u[y], C()), w.nextNode(), l.push({ type: 2, index: ++o });
|
|
290
|
+
r.append(u[b], C());
|
|
328
291
|
}
|
|
329
292
|
}
|
|
330
|
-
} else if (
|
|
293
|
+
} else if (r.nodeType === 8) if (r.data === he) l.push({ type: 2, index: o });
|
|
331
294
|
else {
|
|
332
295
|
let u = -1;
|
|
333
|
-
for (; (u =
|
|
296
|
+
for (; (u = r.data.indexOf($, u + 1)) !== -1; ) l.push({ type: 7, index: o }), u += $.length - 1;
|
|
334
297
|
}
|
|
335
298
|
o++;
|
|
336
299
|
}
|
|
337
300
|
}
|
|
338
301
|
static createElement(e, t) {
|
|
339
|
-
const
|
|
340
|
-
return
|
|
302
|
+
const s = _.createElement("template");
|
|
303
|
+
return s.innerHTML = e, s;
|
|
341
304
|
}
|
|
342
305
|
}
|
|
343
|
-
function
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
return (s == null ? void 0 : s.constructor) !== o && ((l = s == null ? void 0 : s._$AO) == null || l.call(s, !1), o === void 0 ? s = void 0 : (s = new o(i), s._$AT(i, t, r)), r !== void 0 ? (t._$Co ?? (t._$Co = []))[r] = s : t._$Cl = s), s !== void 0 && (e = P(i, s._$AS(i, e.values), s, r)), e;
|
|
306
|
+
function E(i, e, t = i, s) {
|
|
307
|
+
if (e === x) return e;
|
|
308
|
+
let r = s !== void 0 ? t._$Co?.[s] : t._$Cl;
|
|
309
|
+
const o = R(e) ? void 0 : e._$litDirective$;
|
|
310
|
+
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(i), r._$AT(i, t, s)), s !== void 0 ? (t._$Co ??= [])[s] = r : t._$Cl = r), r !== void 0 && (e = E(i, r._$AS(i, e.values), r, s)), e;
|
|
349
311
|
}
|
|
350
|
-
class
|
|
312
|
+
class Pe {
|
|
351
313
|
constructor(e, t) {
|
|
352
314
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
353
315
|
}
|
|
@@ -358,35 +320,34 @@ class Re {
|
|
|
358
320
|
return this._$AM._$AU;
|
|
359
321
|
}
|
|
360
322
|
u(e) {
|
|
361
|
-
const { el: { content: t }, parts:
|
|
362
|
-
|
|
363
|
-
let o =
|
|
364
|
-
for (;
|
|
365
|
-
if (a ===
|
|
323
|
+
const { el: { content: t }, parts: s } = this._$AD, r = (e?.creationScope ?? _).importNode(t, !0);
|
|
324
|
+
w.currentNode = r;
|
|
325
|
+
let o = w.nextNode(), a = 0, n = 0, l = s[0];
|
|
326
|
+
for (; l !== void 0; ) {
|
|
327
|
+
if (a === l.index) {
|
|
366
328
|
let m;
|
|
367
|
-
|
|
329
|
+
l.type === 2 ? m = new N(o, o.nextSibling, this, e) : l.type === 1 ? m = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (m = new Ie(o, this, e)), this._$AV.push(m), l = s[++n];
|
|
368
330
|
}
|
|
369
|
-
a !==
|
|
331
|
+
a !== l?.index && (o = w.nextNode(), a++);
|
|
370
332
|
}
|
|
371
|
-
return
|
|
333
|
+
return w.currentNode = _, r;
|
|
372
334
|
}
|
|
373
335
|
p(e) {
|
|
374
336
|
let t = 0;
|
|
375
|
-
for (const
|
|
337
|
+
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
|
|
376
338
|
}
|
|
377
339
|
}
|
|
378
|
-
class
|
|
340
|
+
class N {
|
|
379
341
|
get _$AU() {
|
|
380
|
-
|
|
381
|
-
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
342
|
+
return this._$AM?._$AU ?? this._$Cv;
|
|
382
343
|
}
|
|
383
|
-
constructor(e, t,
|
|
384
|
-
this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM =
|
|
344
|
+
constructor(e, t, s, r) {
|
|
345
|
+
this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
385
346
|
}
|
|
386
347
|
get parentNode() {
|
|
387
348
|
let e = this._$AA.parentNode;
|
|
388
349
|
const t = this._$AM;
|
|
389
|
-
return t !== void 0 &&
|
|
350
|
+
return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
|
|
390
351
|
}
|
|
391
352
|
get startNode() {
|
|
392
353
|
return this._$AA;
|
|
@@ -395,7 +356,7 @@ class U {
|
|
|
395
356
|
return this._$AB;
|
|
396
357
|
}
|
|
397
358
|
_$AI(e, t = this) {
|
|
398
|
-
e =
|
|
359
|
+
e = E(this, e, t), R(e) ? e === f || e == null || e === "" ? (this._$AH !== f && this._$AR(), this._$AH = f) : e !== this._$AH && e !== x && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Se(e) ? this.k(e) : this._(e);
|
|
399
360
|
}
|
|
400
361
|
O(e) {
|
|
401
362
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -404,66 +365,63 @@ class U {
|
|
|
404
365
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
405
366
|
}
|
|
406
367
|
_(e) {
|
|
407
|
-
this._$AH !== f &&
|
|
368
|
+
this._$AH !== f && R(this._$AH) ? this._$AA.nextSibling.data = e : this.T(_.createTextNode(e)), this._$AH = e;
|
|
408
369
|
}
|
|
409
370
|
$(e) {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
if (((o = this._$AH) == null ? void 0 : o._$AD) === s) this._$AH.p(t);
|
|
371
|
+
const { values: t, _$litType$: s } = e, r = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = I.createElement(pe(s.h, s.h[0]), this.options)), s);
|
|
372
|
+
if (this._$AH?._$AD === r) this._$AH.p(t);
|
|
413
373
|
else {
|
|
414
|
-
const
|
|
415
|
-
|
|
374
|
+
const o = new Pe(r, this), a = o.u(this.options);
|
|
375
|
+
o.p(t), this.T(a), this._$AH = o;
|
|
416
376
|
}
|
|
417
377
|
}
|
|
418
378
|
_$AC(e) {
|
|
419
|
-
let t =
|
|
420
|
-
return t === void 0 &&
|
|
379
|
+
let t = oe.get(e.strings);
|
|
380
|
+
return t === void 0 && oe.set(e.strings, t = new I(e)), t;
|
|
421
381
|
}
|
|
422
382
|
k(e) {
|
|
423
|
-
|
|
383
|
+
K(this._$AH) || (this._$AH = [], this._$AR());
|
|
424
384
|
const t = this._$AH;
|
|
425
|
-
let
|
|
426
|
-
for (const o of e)
|
|
427
|
-
|
|
385
|
+
let s, r = 0;
|
|
386
|
+
for (const o of e) r === t.length ? t.push(s = new N(this.O(C()), this.O(C()), this, this.options)) : s = t[r], s._$AI(o), r++;
|
|
387
|
+
r < t.length && (this._$AR(s && s._$AB.nextSibling, r), t.length = r);
|
|
428
388
|
}
|
|
429
389
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
ie(e).remove(), e = s;
|
|
390
|
+
for (this._$AP?.(!1, !0, t); e !== this._$AB; ) {
|
|
391
|
+
const s = Q(e).nextSibling;
|
|
392
|
+
Q(e).remove(), e = s;
|
|
434
393
|
}
|
|
435
394
|
}
|
|
436
395
|
setConnected(e) {
|
|
437
|
-
|
|
438
|
-
this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
|
|
396
|
+
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
439
397
|
}
|
|
440
398
|
}
|
|
441
|
-
class
|
|
399
|
+
class M {
|
|
442
400
|
get tagName() {
|
|
443
401
|
return this.element.tagName;
|
|
444
402
|
}
|
|
445
403
|
get _$AU() {
|
|
446
404
|
return this._$AM._$AU;
|
|
447
405
|
}
|
|
448
|
-
constructor(e, t,
|
|
449
|
-
this.type = 1, this._$AH = f, this._$AN = void 0, this.element = e, this.name = t, this._$AM =
|
|
406
|
+
constructor(e, t, s, r, o) {
|
|
407
|
+
this.type = 1, this._$AH = f, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = f;
|
|
450
408
|
}
|
|
451
|
-
_$AI(e, t = this,
|
|
409
|
+
_$AI(e, t = this, s, r) {
|
|
452
410
|
const o = this.strings;
|
|
453
411
|
let a = !1;
|
|
454
|
-
if (o === void 0) e =
|
|
412
|
+
if (o === void 0) e = E(this, e, t, 0), a = !R(e) || e !== this._$AH && e !== x, a && (this._$AH = e);
|
|
455
413
|
else {
|
|
456
|
-
const
|
|
457
|
-
let
|
|
458
|
-
for (e = o[0],
|
|
414
|
+
const n = e;
|
|
415
|
+
let l, m;
|
|
416
|
+
for (e = o[0], l = 0; l < o.length - 1; l++) m = E(this, n[s + l], t, l), m === x && (m = this._$AH[l]), a ||= !R(m) || m !== this._$AH[l], m === f ? e = f : e !== f && (e += (m ?? "") + o[l + 1]), this._$AH[l] = m;
|
|
459
417
|
}
|
|
460
|
-
a && !
|
|
418
|
+
a && !r && this.j(e);
|
|
461
419
|
}
|
|
462
420
|
j(e) {
|
|
463
421
|
e === f ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
464
422
|
}
|
|
465
423
|
}
|
|
466
|
-
class
|
|
424
|
+
class Te extends M {
|
|
467
425
|
constructor() {
|
|
468
426
|
super(...arguments), this.type = 3;
|
|
469
427
|
}
|
|
@@ -471,7 +429,7 @@ class Ie extends q {
|
|
|
471
429
|
this.element[this.name] = e === f ? void 0 : e;
|
|
472
430
|
}
|
|
473
431
|
}
|
|
474
|
-
class
|
|
432
|
+
class Ce extends M {
|
|
475
433
|
constructor() {
|
|
476
434
|
super(...arguments), this.type = 4;
|
|
477
435
|
}
|
|
@@ -479,164 +437,121 @@ class Ne extends q {
|
|
|
479
437
|
this.element.toggleAttribute(this.name, !!e && e !== f);
|
|
480
438
|
}
|
|
481
439
|
}
|
|
482
|
-
class
|
|
483
|
-
constructor(e, t,
|
|
484
|
-
super(e, t,
|
|
440
|
+
class Re extends M {
|
|
441
|
+
constructor(e, t, s, r, o) {
|
|
442
|
+
super(e, t, s, r, o), this.type = 5;
|
|
485
443
|
}
|
|
486
444
|
_$AI(e, t = this) {
|
|
487
|
-
if ((e =
|
|
488
|
-
const
|
|
489
|
-
|
|
445
|
+
if ((e = E(this, e, t, 0) ?? f) === x) return;
|
|
446
|
+
const s = this._$AH, r = e === f && s !== f || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, o = e !== f && (s === f || r);
|
|
447
|
+
r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
490
448
|
}
|
|
491
449
|
handleEvent(e) {
|
|
492
|
-
|
|
493
|
-
typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
|
|
450
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
494
451
|
}
|
|
495
452
|
}
|
|
496
|
-
class
|
|
497
|
-
constructor(e, t,
|
|
498
|
-
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options =
|
|
453
|
+
class Ie {
|
|
454
|
+
constructor(e, t, s) {
|
|
455
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
|
|
499
456
|
}
|
|
500
457
|
get _$AU() {
|
|
501
458
|
return this._$AM._$AU;
|
|
502
459
|
}
|
|
503
460
|
_$AI(e) {
|
|
504
|
-
|
|
461
|
+
E(this, e);
|
|
505
462
|
}
|
|
506
463
|
}
|
|
507
|
-
const
|
|
508
|
-
|
|
509
|
-
const
|
|
510
|
-
const
|
|
511
|
-
let
|
|
512
|
-
if (
|
|
513
|
-
const o =
|
|
514
|
-
|
|
515
|
-
}
|
|
516
|
-
return
|
|
464
|
+
const Ne = W.litHtmlPolyfillSupport;
|
|
465
|
+
Ne?.(I, N), (W.litHtmlVersions ??= []).push("3.3.2");
|
|
466
|
+
const ze = (i, e, t) => {
|
|
467
|
+
const s = t?.renderBefore ?? e;
|
|
468
|
+
let r = s._$litPart$;
|
|
469
|
+
if (r === void 0) {
|
|
470
|
+
const o = t?.renderBefore ?? null;
|
|
471
|
+
s._$litPart$ = r = new N(e.insertBefore(C(), o), o, void 0, t ?? {});
|
|
472
|
+
}
|
|
473
|
+
return r._$AI(i), r;
|
|
517
474
|
};
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
* Copyright 2017 Google LLC
|
|
521
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
522
|
-
*/
|
|
523
|
-
const x = globalThis;
|
|
524
|
-
let I = class extends k {
|
|
475
|
+
const G = globalThis;
|
|
476
|
+
let T = class extends S {
|
|
525
477
|
constructor() {
|
|
526
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
527
479
|
}
|
|
528
480
|
createRenderRoot() {
|
|
529
|
-
var t;
|
|
530
481
|
const e = super.createRenderRoot();
|
|
531
|
-
return
|
|
482
|
+
return this.renderOptions.renderBefore ??= e.firstChild, e;
|
|
532
483
|
}
|
|
533
484
|
update(e) {
|
|
534
485
|
const t = this.render();
|
|
535
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = ze(t, this.renderRoot, this.renderOptions);
|
|
536
487
|
}
|
|
537
488
|
connectedCallback() {
|
|
538
|
-
|
|
539
|
-
super.connectedCallback(), (e = this._$Do) == null || e.setConnected(!0);
|
|
489
|
+
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
540
490
|
}
|
|
541
491
|
disconnectedCallback() {
|
|
542
|
-
|
|
543
|
-
super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
|
|
492
|
+
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
544
493
|
}
|
|
545
494
|
render() {
|
|
546
|
-
return
|
|
495
|
+
return x;
|
|
547
496
|
}
|
|
548
497
|
};
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
/**
|
|
555
|
-
* @license
|
|
556
|
-
* Copyright 2017 Google LLC
|
|
557
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
558
|
-
*/
|
|
559
|
-
const Ve = (i) => (e, t) => {
|
|
498
|
+
T._$litElement$ = !0, T.finalized = !0, G.litElementHydrateSupport?.({ LitElement: T });
|
|
499
|
+
const Fe = G.litElementPolyfillSupport;
|
|
500
|
+
Fe?.({ LitElement: T });
|
|
501
|
+
(G.litElementVersions ??= []).push("4.2.2");
|
|
502
|
+
const Ue = (i) => (e, t) => {
|
|
560
503
|
t !== void 0 ? t.addInitializer(() => {
|
|
561
504
|
customElements.define(i, e);
|
|
562
505
|
}) : customElements.define(i, e);
|
|
563
506
|
};
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
*/
|
|
569
|
-
const Oe = { attribute: !0, type: String, converter: M, reflect: !1, hasChanged: Y }, De = (i = Oe, e, t) => {
|
|
570
|
-
const { kind: r, metadata: s } = t;
|
|
571
|
-
let o = globalThis.litPropertyMetadata.get(s);
|
|
572
|
-
if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), r === "setter" && ((i = Object.create(i)).wrapped = !0), o.set(t.name, i), r === "accessor") {
|
|
507
|
+
const Ve = { attribute: !0, type: String, converter: V, reflect: !1, hasChanged: j }, Oe = (i = Ve, e, t) => {
|
|
508
|
+
const { kind: s, metadata: r } = t;
|
|
509
|
+
let o = globalThis.litPropertyMetadata.get(r);
|
|
510
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), o.set(t.name, i), s === "accessor") {
|
|
573
511
|
const { name: a } = t;
|
|
574
|
-
return { set(
|
|
575
|
-
const
|
|
576
|
-
e.set.call(this,
|
|
577
|
-
}, init(
|
|
578
|
-
return
|
|
512
|
+
return { set(n) {
|
|
513
|
+
const l = e.get.call(this);
|
|
514
|
+
e.set.call(this, n), this.requestUpdate(a, l, i, !0, n);
|
|
515
|
+
}, init(n) {
|
|
516
|
+
return n !== void 0 && this.C(a, void 0, i, n), n;
|
|
579
517
|
} };
|
|
580
518
|
}
|
|
581
|
-
if (
|
|
519
|
+
if (s === "setter") {
|
|
582
520
|
const { name: a } = t;
|
|
583
|
-
return function(
|
|
584
|
-
const
|
|
585
|
-
e.call(this,
|
|
521
|
+
return function(n) {
|
|
522
|
+
const l = this[a];
|
|
523
|
+
e.call(this, n), this.requestUpdate(a, l, i, !0, n);
|
|
586
524
|
};
|
|
587
525
|
}
|
|
588
|
-
throw Error("Unsupported decorator location: " +
|
|
526
|
+
throw Error("Unsupported decorator location: " + s);
|
|
589
527
|
};
|
|
590
528
|
function p(i) {
|
|
591
|
-
return (e, t) => typeof t == "object" ?
|
|
592
|
-
const a =
|
|
593
|
-
return
|
|
529
|
+
return (e, t) => typeof t == "object" ? Oe(i, e, t) : ((s, r, o) => {
|
|
530
|
+
const a = r.hasOwnProperty(o);
|
|
531
|
+
return r.constructor.createProperty(o, s), a ? Object.getOwnPropertyDescriptor(r, o) : void 0;
|
|
594
532
|
})(i, e, t);
|
|
595
533
|
}
|
|
596
|
-
|
|
597
|
-
* @license
|
|
598
|
-
* Copyright 2017 Google LLC
|
|
599
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
600
|
-
*/
|
|
601
|
-
function b(i) {
|
|
534
|
+
function v(i) {
|
|
602
535
|
return p({ ...i, state: !0, attribute: !1 });
|
|
603
536
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
const Me = (i, e, t) => (t.configurable = !0, t.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(i, e, t), t);
|
|
610
|
-
/**
|
|
611
|
-
* @license
|
|
612
|
-
* Copyright 2017 Google LLC
|
|
613
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
614
|
-
*/
|
|
615
|
-
function Le(i, e) {
|
|
616
|
-
return (t, r, s) => {
|
|
617
|
-
const o = (a) => {
|
|
618
|
-
var l;
|
|
619
|
-
return ((l = a.renderRoot) == null ? void 0 : l.querySelector(i)) ?? null;
|
|
620
|
-
};
|
|
621
|
-
return Me(t, r, { get() {
|
|
537
|
+
const De = (i, e, t) => (t.configurable = !0, t.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(i, e, t), t);
|
|
538
|
+
function Me(i, e) {
|
|
539
|
+
return (t, s, r) => {
|
|
540
|
+
const o = (a) => a.renderRoot?.querySelector(i) ?? null;
|
|
541
|
+
return De(t, s, { get() {
|
|
622
542
|
return o(this);
|
|
623
543
|
} });
|
|
624
544
|
};
|
|
625
545
|
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
* Copyright 2017 Google LLC
|
|
629
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
630
|
-
*/
|
|
631
|
-
const qe = { ATTRIBUTE: 1 }, He = (i) => (...e) => ({ _$litDirective$: i, values: e });
|
|
632
|
-
class Be {
|
|
546
|
+
const Le = { ATTRIBUTE: 1 }, Be = (i) => (...e) => ({ _$litDirective$: i, values: e });
|
|
547
|
+
class qe {
|
|
633
548
|
constructor(e) {
|
|
634
549
|
}
|
|
635
550
|
get _$AU() {
|
|
636
551
|
return this._$AM._$AU;
|
|
637
552
|
}
|
|
638
|
-
_$AT(e, t,
|
|
639
|
-
this._$Ct = e, this._$AM = t, this._$Ci =
|
|
553
|
+
_$AT(e, t, s) {
|
|
554
|
+
this._$Ct = e, this._$AM = t, this._$Ci = s;
|
|
640
555
|
}
|
|
641
556
|
_$AS(e, t) {
|
|
642
557
|
return this.update(e, t);
|
|
@@ -645,35 +560,28 @@ class Be {
|
|
|
645
560
|
return this.render(...t);
|
|
646
561
|
}
|
|
647
562
|
}
|
|
648
|
-
|
|
649
|
-
* @license
|
|
650
|
-
* Copyright 2018 Google LLC
|
|
651
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
652
|
-
*/
|
|
653
|
-
const O = He(class extends Be {
|
|
563
|
+
const F = Be(class extends qe {
|
|
654
564
|
constructor(i) {
|
|
655
|
-
|
|
656
|
-
if (super(i), i.type !== qe.ATTRIBUTE || i.name !== "class" || ((e = i.strings) == null ? void 0 : e.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
565
|
+
if (super(i), i.type !== Le.ATTRIBUTE || i.name !== "class" || i.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
657
566
|
}
|
|
658
567
|
render(i) {
|
|
659
568
|
return " " + Object.keys(i).filter((e) => i[e]).join(" ") + " ";
|
|
660
569
|
}
|
|
661
570
|
update(i, [e]) {
|
|
662
|
-
var r, s;
|
|
663
571
|
if (this.st === void 0) {
|
|
664
|
-
this.st = /* @__PURE__ */ new Set(), i.strings !== void 0 && (this.nt = new Set(i.strings.join(" ").split(/\s/).filter((
|
|
665
|
-
for (const
|
|
572
|
+
this.st = /* @__PURE__ */ new Set(), i.strings !== void 0 && (this.nt = new Set(i.strings.join(" ").split(/\s/).filter((s) => s !== "")));
|
|
573
|
+
for (const s in e) e[s] && !this.nt?.has(s) && this.st.add(s);
|
|
666
574
|
return this.render(e);
|
|
667
575
|
}
|
|
668
576
|
const t = i.element.classList;
|
|
669
|
-
for (const
|
|
670
|
-
for (const
|
|
671
|
-
const
|
|
672
|
-
|
|
577
|
+
for (const s of this.st) s in e || (t.remove(s), this.st.delete(s));
|
|
578
|
+
for (const s in e) {
|
|
579
|
+
const r = !!e[s];
|
|
580
|
+
r === this.st.has(s) || this.nt?.has(s) || (r ? (t.add(s), this.st.add(s)) : (t.remove(s), this.st.delete(s)));
|
|
673
581
|
}
|
|
674
|
-
return
|
|
582
|
+
return x;
|
|
675
583
|
}
|
|
676
|
-
}),
|
|
584
|
+
}), He = [
|
|
677
585
|
"AE",
|
|
678
586
|
"AR",
|
|
679
587
|
"AT",
|
|
@@ -728,63 +636,63 @@ const O = He(class extends Be {
|
|
|
728
636
|
"VN",
|
|
729
637
|
"ZA"
|
|
730
638
|
];
|
|
731
|
-
function
|
|
732
|
-
let t = null,
|
|
733
|
-
return function(...
|
|
734
|
-
const o = Date.now(), a = e - (o -
|
|
735
|
-
a <= 0 || a > e ? (t && (clearTimeout(t), t = null),
|
|
736
|
-
|
|
639
|
+
function et(i, e) {
|
|
640
|
+
let t = null, s = 0;
|
|
641
|
+
return function(...r) {
|
|
642
|
+
const o = Date.now(), a = e - (o - s);
|
|
643
|
+
a <= 0 || a > e ? (t && (clearTimeout(t), t = null), s = o, i.apply(this, r)) : t || (t = setTimeout(() => {
|
|
644
|
+
s = Date.now(), t = null, i.apply(this, r);
|
|
737
645
|
}, a));
|
|
738
646
|
};
|
|
739
647
|
}
|
|
740
|
-
function
|
|
648
|
+
function je(i, e) {
|
|
741
649
|
let t = null;
|
|
742
|
-
return function(...
|
|
650
|
+
return function(...s) {
|
|
743
651
|
t && clearTimeout(t), t = setTimeout(() => {
|
|
744
|
-
i.apply(this,
|
|
652
|
+
i.apply(this, s);
|
|
745
653
|
}, e);
|
|
746
654
|
};
|
|
747
655
|
}
|
|
748
|
-
function
|
|
656
|
+
function We() {
|
|
749
657
|
return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(i) {
|
|
750
658
|
const e = Math.random() * 16 | 0;
|
|
751
659
|
return (i === "x" ? e : e & 3 | 8).toString(16);
|
|
752
660
|
});
|
|
753
661
|
}
|
|
754
|
-
function
|
|
662
|
+
function Ke(i) {
|
|
755
663
|
if (!i) return null;
|
|
756
664
|
const e = i.find(
|
|
757
|
-
(t) => t.types
|
|
665
|
+
(t) => t.types?.includes("country")
|
|
758
666
|
);
|
|
759
667
|
return e ? e.short_name : null;
|
|
760
668
|
}
|
|
761
|
-
function
|
|
669
|
+
function ae(i, e) {
|
|
762
670
|
let t = null;
|
|
763
|
-
return i.address_components ? t =
|
|
764
|
-
isSupported:
|
|
671
|
+
return i.address_components ? t = Ke(i.address_components) : e && e.length === 1 && (t = e[0].toUpperCase()), t ? {
|
|
672
|
+
isSupported: He.includes(t),
|
|
765
673
|
countryCode: t
|
|
766
674
|
} : {
|
|
767
675
|
isSupported: null,
|
|
768
676
|
countryCode: null
|
|
769
677
|
};
|
|
770
678
|
}
|
|
771
|
-
function
|
|
679
|
+
function tt(i, e) {
|
|
772
680
|
const t = [];
|
|
773
|
-
let
|
|
681
|
+
let s = 0;
|
|
774
682
|
return [...e].sort((o, a) => o.offset - a.offset).forEach((o) => {
|
|
775
|
-
o.offset >
|
|
776
|
-
text: i.substring(
|
|
683
|
+
o.offset > s && t.push({
|
|
684
|
+
text: i.substring(s, o.offset),
|
|
777
685
|
highlight: !1
|
|
778
686
|
}), t.push({
|
|
779
687
|
text: i.substring(o.offset, o.offset + o.length),
|
|
780
688
|
highlight: !0
|
|
781
|
-
}),
|
|
782
|
-
}),
|
|
783
|
-
text: i.substring(
|
|
689
|
+
}), s = o.offset + o.length;
|
|
690
|
+
}), s < i.length && t.push({
|
|
691
|
+
text: i.substring(s),
|
|
784
692
|
highlight: !1
|
|
785
693
|
}), t;
|
|
786
694
|
}
|
|
787
|
-
const
|
|
695
|
+
const ne = {
|
|
788
696
|
en: {
|
|
789
697
|
placeholder: "Search for an address...",
|
|
790
698
|
noResults: "No address found for this search. Try different keywords.",
|
|
@@ -916,18 +824,18 @@ const he = {
|
|
|
916
824
|
validationSaudiFormat: "Lütfen geçerli bir Suudi ulusal adresi girin (format: AAAA1234)"
|
|
917
825
|
}
|
|
918
826
|
};
|
|
919
|
-
function
|
|
920
|
-
return
|
|
827
|
+
function B(i = "en") {
|
|
828
|
+
return ne[i] || ne.en;
|
|
921
829
|
}
|
|
922
|
-
function
|
|
830
|
+
function Ge(i) {
|
|
923
831
|
return ["ar"].includes(i);
|
|
924
832
|
}
|
|
925
|
-
var
|
|
926
|
-
for (var
|
|
927
|
-
(a = i[o]) && (
|
|
928
|
-
return
|
|
833
|
+
var Ze = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, h = (i, e, t, s) => {
|
|
834
|
+
for (var r = s > 1 ? void 0 : s ? Ye(e, t) : e, o = i.length - 1, a; o >= 0; o--)
|
|
835
|
+
(a = i[o]) && (r = (s ? a(e, t, r) : a(r)) || r);
|
|
836
|
+
return s && r && Ze(e, t, r), r;
|
|
929
837
|
};
|
|
930
|
-
let d = class extends
|
|
838
|
+
let d = class extends T {
|
|
931
839
|
constructor() {
|
|
932
840
|
super(), this.proxyUrl = "https://api.salla.dev", this.authToken = null, this.placeholder = "", this.defaultPlace = "", this.label = null, this.className = "", this.language = "en", this.dir = "auto", this.mode = "search", this.name = "", this.required = !1, this.pattern = null, this.tooltip = null, this.selectedId = null, this.errors = [], this.disabled = !1, this._value = "", this._country = null, this.locationBias = null, this.locationRestriction = null, this.types = null, this._fields = ["formatted_address", "geometry"], this.strictBounds = !1, this.useSessionToken = !0, this.resolve = !1, this.onValidateAddress = null, this.debounceDelay = 300, this.minChars = 3, this.predictions = [], this.isOpen = !1, this.isLoading = !1, this.error = null, this.activeIndex = -1, this.inputValue = "", this.sessionToken = null, this.validationError = null, this.touched = !1, this.showNationalAddressIcon = !1, this.abortController = null, this._internals = this.attachInternals();
|
|
933
841
|
}
|
|
@@ -963,7 +871,7 @@ let d = class extends I {
|
|
|
963
871
|
super.disconnectedCallback(), this.terminateSession(), this.cancelPendingRequest();
|
|
964
872
|
}
|
|
965
873
|
initializeDebounce() {
|
|
966
|
-
this.debouncedFetch =
|
|
874
|
+
this.debouncedFetch = je(this.fetchPredictions.bind(this), this.debounceDelay);
|
|
967
875
|
}
|
|
968
876
|
firstUpdated() {
|
|
969
877
|
const i = this.value || this.defaultPlace || "";
|
|
@@ -973,7 +881,7 @@ let d = class extends I {
|
|
|
973
881
|
Promise.resolve().then(i);
|
|
974
882
|
}
|
|
975
883
|
isShortAddressFormat(i) {
|
|
976
|
-
return /^[a-zA-Z]{4}\d{4}$/.test(i
|
|
884
|
+
return /^[a-zA-Z]{4}\d{4}$/.test(i?.trim());
|
|
977
885
|
}
|
|
978
886
|
updated(i) {
|
|
979
887
|
if (i.has("value")) {
|
|
@@ -983,7 +891,7 @@ let d = class extends I {
|
|
|
983
891
|
i.has("defaultPlace") && !this.value && this.defaultPlace !== this.inputValue && (this.inputValue = this.defaultPlace || "", this.isSaudiFormMode() && this.defaultPlace && this.isShortAddressFormat(this.defaultPlace) ? this.showNationalAddressIcon = !0 : this.showNationalAddressIcon = !1), i.has("selectedId") && this.selectedId && this.selectedId !== this.inputValue && this.isSaudiFormMode() && this.isShortAddressFormat(this.selectedId) && (this.inputValue = this.selectedId || "", this.showNationalAddressIcon = !0, this._internals.setFormValue(this.selectedId || "")), i.has("debounceDelay") && this.initializeDebounce();
|
|
984
892
|
}
|
|
985
893
|
createNewSession() {
|
|
986
|
-
this.useSessionToken && (this.sessionToken =
|
|
894
|
+
this.useSessionToken && (this.sessionToken = We());
|
|
987
895
|
}
|
|
988
896
|
terminateSession() {
|
|
989
897
|
this.sessionToken = null;
|
|
@@ -1006,13 +914,13 @@ let d = class extends I {
|
|
|
1006
914
|
try {
|
|
1007
915
|
const t = { input: i };
|
|
1008
916
|
this.sessionToken && (t.sessiontoken = this.sessionToken), this.country && this.country.length > 0 && (t.country = this.country.join(",")), this.types && this.types.length > 0 && (t.types = this.types.join("|")), this.locationBias && this.locationBias.radius && this.locationBias.center && (t.location = `${this.locationBias.center.lat},${this.locationBias.center.lng}`, t.radius = this.locationBias.radius.toString()), this.strictBounds && (t.strictbounds = "true");
|
|
1009
|
-
const
|
|
917
|
+
const s = new URLSearchParams(t), o = `${this.proxyUrl || ""}/store/v1/checkout/address/autocomplete/query?${s.toString()}`, a = {};
|
|
1010
918
|
this.authToken && (a.Authorization = `Bearer ${this.authToken}`);
|
|
1011
|
-
const
|
|
1012
|
-
if (!
|
|
1013
|
-
throw new Error(`HTTP ${
|
|
1014
|
-
const
|
|
1015
|
-
|
|
919
|
+
const n = await fetch(o, { signal: e, headers: a });
|
|
920
|
+
if (!n.ok)
|
|
921
|
+
throw new Error(`HTTP ${n.status}: ${n.statusText}`);
|
|
922
|
+
const l = await n.json();
|
|
923
|
+
l.success && Array.isArray(l.data) ? (this.error = null, l.data.length > 0 ? (this.predictions = l.data.map((c) => ({
|
|
1016
924
|
place_id: c.id,
|
|
1017
925
|
description: c.description || c.formatted_address,
|
|
1018
926
|
formatted_address: c.formatted_address,
|
|
@@ -1035,30 +943,30 @@ let d = class extends I {
|
|
|
1035
943
|
}
|
|
1036
944
|
}
|
|
1037
945
|
async fetchPlaceDetails(i) {
|
|
1038
|
-
var e;
|
|
1039
946
|
this.isLoading = !0, this.error = null;
|
|
1040
947
|
try {
|
|
1041
|
-
const
|
|
1042
|
-
this.fields && this.fields.length > 0 && (
|
|
1043
|
-
const
|
|
1044
|
-
this.authToken && (
|
|
1045
|
-
const
|
|
1046
|
-
if (!
|
|
1047
|
-
throw new Error(`HTTP ${
|
|
1048
|
-
const n = await
|
|
948
|
+
const e = { place_id: i };
|
|
949
|
+
this.fields && this.fields.length > 0 && (e.fields = this.fields.join(",")), this.sessionToken && (e.sessiontoken = this.sessionToken), this.country && this.country.length > 0 && (e.country = this.country.join(",")), this.resolve && (e.resolve = "true");
|
|
950
|
+
const t = new URLSearchParams(e), r = `${this.proxyUrl || ""}/store/v1/checkout/address/autocomplete/details?${t.toString()}`, o = {};
|
|
951
|
+
this.authToken && (o.Authorization = `Bearer ${this.authToken}`);
|
|
952
|
+
const a = await fetch(r, { headers: o });
|
|
953
|
+
if (!a.ok)
|
|
954
|
+
throw new Error(`HTTP ${a.status}: ${a.statusText}`);
|
|
955
|
+
const n = await a.json();
|
|
1049
956
|
return !n.success || n.message ? (this.error = n.message || "Failed to fetch place details", null) : n.success && n.data && n.data.id ? {
|
|
1050
957
|
place_id: n.data.id,
|
|
1051
958
|
...n.data,
|
|
1052
|
-
components:
|
|
1053
|
-
|
|
1054
|
-
long_name:
|
|
1055
|
-
short_name:
|
|
959
|
+
components: n.data.address_components?.reduce((m, c) => (c.types?.forEach((u) => {
|
|
960
|
+
m[u] || (m[u] = []), m[u].push({
|
|
961
|
+
long_name: c.long_name,
|
|
962
|
+
short_name: c.short_name
|
|
1056
963
|
});
|
|
1057
|
-
}),
|
|
964
|
+
}), m), {})
|
|
1058
965
|
} : null;
|
|
1059
|
-
} catch (
|
|
1060
|
-
|
|
1061
|
-
|
|
966
|
+
} catch (e) {
|
|
967
|
+
console.error("Error fetching place details:", e);
|
|
968
|
+
const t = B(this.language);
|
|
969
|
+
return this.error = e instanceof Error ? e.message : t.errorFetchDetails, null;
|
|
1062
970
|
} finally {
|
|
1063
971
|
this.isLoading = !1;
|
|
1064
972
|
}
|
|
@@ -1069,7 +977,7 @@ let d = class extends I {
|
|
|
1069
977
|
return console.error("Cannot validate address - place or formatted_address is missing"), null;
|
|
1070
978
|
if (!this.onValidateAddress || typeof this.onValidateAddress != "function")
|
|
1071
979
|
return console.error("onValidateAddress callback is required for address validation"), null;
|
|
1072
|
-
const e =
|
|
980
|
+
const e = ae(i, this.country), t = await this.onValidateAddress({
|
|
1073
981
|
place: i,
|
|
1074
982
|
sessionToken: this.sessionToken,
|
|
1075
983
|
validationSupport: e
|
|
@@ -1080,7 +988,7 @@ let d = class extends I {
|
|
|
1080
988
|
}
|
|
1081
989
|
}
|
|
1082
990
|
getValidationSupport(i) {
|
|
1083
|
-
return
|
|
991
|
+
return ae(i, this.country);
|
|
1084
992
|
}
|
|
1085
993
|
isSaudiFormMode() {
|
|
1086
994
|
return this.mode === "form" && this.country !== null && this.country.length === 1 && this.country[0].toLowerCase() === "sa";
|
|
@@ -1106,10 +1014,10 @@ let d = class extends I {
|
|
|
1106
1014
|
const i = this.inputValue && this.inputValue.trim().length > 0;
|
|
1107
1015
|
let e, t;
|
|
1108
1016
|
i ? (e = "العنوان الوطني المختصر غير صحيح (الصيغة: AAAA1234). يمكنك الحصول عليه بسهولة", t = "The short national address format is incorrect (format: AAAA1234). You can easily get it") : (e = "العنوان الوطني المختصر مطلوب. يمكنك الحصول عليه بسهولة", t = "The short national address is required. You can easily get it");
|
|
1109
|
-
const
|
|
1017
|
+
const s = "عبر الواتساب (اضغط هنا)", r = "via WhatsApp (click here)", o = "أو ابحث أعلاه", a = "or search above", n = this.language === "ar" ? e : t, l = this.language === "ar" ? s : r, m = this.language === "ar" ? o : a;
|
|
1110
1018
|
return g`
|
|
1111
1019
|
<span>
|
|
1112
|
-
${
|
|
1020
|
+
${n}
|
|
1113
1021
|
<a
|
|
1114
1022
|
href="${this.getWhatsAppLink()}"
|
|
1115
1023
|
target="_blank"
|
|
@@ -1118,7 +1026,7 @@ let d = class extends I {
|
|
|
1118
1026
|
part="whatsapp-link"
|
|
1119
1027
|
>
|
|
1120
1028
|
${this.renderWhatsAppIcon()}
|
|
1121
|
-
${
|
|
1029
|
+
${l}
|
|
1122
1030
|
</a>
|
|
1123
1031
|
${m}
|
|
1124
1032
|
</span>
|
|
@@ -1127,7 +1035,7 @@ let d = class extends I {
|
|
|
1127
1035
|
renderSaudiHelpText() {
|
|
1128
1036
|
if (!this.isSaudiFormMode() || this.validationError || this.errors && this.errors.length > 0)
|
|
1129
1037
|
return "";
|
|
1130
|
-
const i = "لا تعرف العنوان الوطني؟ احصل عليه بسهولة", e = "Don't know your national address? Get it easily", t = "عبر الواتساب (اضغط هنا)",
|
|
1038
|
+
const i = "لا تعرف العنوان الوطني؟ احصل عليه بسهولة", e = "Don't know your national address? Get it easily", t = "عبر الواتساب (اضغط هنا)", s = "via WhatsApp (click here)", r = "أو ابحث أعلاه", o = "or search above", a = this.language === "ar" ? i : e, n = this.language === "ar" ? t : s, l = this.language === "ar" ? r : o;
|
|
1131
1039
|
return g`
|
|
1132
1040
|
<div class="help-text" part="help-text">
|
|
1133
1041
|
<span>
|
|
@@ -1140,9 +1048,9 @@ let d = class extends I {
|
|
|
1140
1048
|
part="whatsapp-link"
|
|
1141
1049
|
>
|
|
1142
1050
|
${this.renderWhatsAppIcon()}
|
|
1143
|
-
${
|
|
1051
|
+
${n}
|
|
1144
1052
|
</a>
|
|
1145
|
-
${
|
|
1053
|
+
${l}
|
|
1146
1054
|
</span>
|
|
1147
1055
|
</div>
|
|
1148
1056
|
`;
|
|
@@ -1172,7 +1080,7 @@ let d = class extends I {
|
|
|
1172
1080
|
validate() {
|
|
1173
1081
|
if (this.mode !== "form")
|
|
1174
1082
|
return !0;
|
|
1175
|
-
const i =
|
|
1083
|
+
const i = B(this.language), e = this.inputValue || "";
|
|
1176
1084
|
return this.required && !e.trim() ? (this.validationError = i.validationRequired, this._internals.setValidity(
|
|
1177
1085
|
{ valueMissing: !0 },
|
|
1178
1086
|
this.validationError,
|
|
@@ -1204,11 +1112,10 @@ let d = class extends I {
|
|
|
1204
1112
|
}));
|
|
1205
1113
|
}
|
|
1206
1114
|
async handleSelect(i) {
|
|
1207
|
-
var t;
|
|
1208
1115
|
if (this.disabled) return;
|
|
1209
1116
|
this.isSaudiFormMode() && i.place_id && this.isShortAddressFormat(i.place_id) ? (this.inputValue = i.place_id, this.showNationalAddressIcon = !0) : (this.inputValue = i.formatted_address, this.showNationalAddressIcon = !1), this.isOpen = !1, this.predictions = [], this.touched = !0;
|
|
1210
1117
|
let e = null;
|
|
1211
|
-
if (this.mode === "form" ? e = await this.fetchPlaceDetails(i.place_id) :
|
|
1118
|
+
if (this.mode === "form" ? e = await this.fetchPlaceDetails(i.place_id) : i.geometry?.location ? e = {
|
|
1212
1119
|
place_id: i.place_id,
|
|
1213
1120
|
formatted_address: i.formatted_address || i.description,
|
|
1214
1121
|
geometry: i.geometry,
|
|
@@ -1223,13 +1130,13 @@ let d = class extends I {
|
|
|
1223
1130
|
bubbles: !0,
|
|
1224
1131
|
composed: !0
|
|
1225
1132
|
}));
|
|
1226
|
-
const
|
|
1133
|
+
const t = this.getValidationSupport(e);
|
|
1227
1134
|
this.dispatchEvent(new CustomEvent("place-select", {
|
|
1228
|
-
detail: { place: e, validationSupport:
|
|
1135
|
+
detail: { place: e, validationSupport: t },
|
|
1229
1136
|
bubbles: !0,
|
|
1230
1137
|
composed: !0
|
|
1231
1138
|
})), this.dispatchEvent(new CustomEvent("place-changed", {
|
|
1232
|
-
detail: { place: e, validationSupport:
|
|
1139
|
+
detail: { place: e, validationSupport: t },
|
|
1233
1140
|
bubbles: !0,
|
|
1234
1141
|
composed: !0
|
|
1235
1142
|
}));
|
|
@@ -1285,10 +1192,10 @@ let d = class extends I {
|
|
|
1285
1192
|
"dropdown-item": !0,
|
|
1286
1193
|
active: e === this.activeIndex
|
|
1287
1194
|
};
|
|
1288
|
-
let
|
|
1289
|
-
return i.short_address &&
|
|
1195
|
+
let s = i.structured_formatting.main_text;
|
|
1196
|
+
return i.short_address && s.includes(i.short_address) && (s = s.replace(i.short_address, "").trim(), s = s.replace(/\s*,\s*,\s*/g, ", ").replace(/^\s*,\s*|\s*,\s*$/g, "").trim()), g`
|
|
1290
1197
|
<div
|
|
1291
|
-
class=${
|
|
1198
|
+
class=${F(t)}
|
|
1292
1199
|
part="dropdown-item ${e === this.activeIndex ? "dropdown-item-active" : ""}"
|
|
1293
1200
|
@click=${() => this.handleSelect(i)}
|
|
1294
1201
|
role="option"
|
|
@@ -1308,7 +1215,7 @@ let d = class extends I {
|
|
|
1308
1215
|
<span class="national-address-separator">-</span>
|
|
1309
1216
|
</span>
|
|
1310
1217
|
` : ""}
|
|
1311
|
-
${
|
|
1218
|
+
${s}
|
|
1312
1219
|
</div>
|
|
1313
1220
|
${i.structured_formatting.secondary_text ? g`
|
|
1314
1221
|
<div class="secondary-text" part="secondary-text">
|
|
@@ -1328,12 +1235,12 @@ let d = class extends I {
|
|
|
1328
1235
|
"with-national-icon": this.showNationalAddressIcon
|
|
1329
1236
|
}, t = {
|
|
1330
1237
|
required: this.mode === "form" && this.required
|
|
1331
|
-
},
|
|
1238
|
+
}, s = B(this.language), r = this.dir === "auto" ? Ge(this.language) ? "rtl" : "ltr" : this.dir, o = this.placeholder || s.placeholder, a = this.name || "salla-address-search";
|
|
1332
1239
|
return g`
|
|
1333
|
-
<div class="wrapper ${this.className}" part="wrapper" dir="${
|
|
1240
|
+
<div class="wrapper ${this.className}" part="wrapper" dir="${r}">
|
|
1334
1241
|
<div class="input-container" part="input-container">
|
|
1335
1242
|
${this.label ? g`
|
|
1336
|
-
<label part="label" class=${
|
|
1243
|
+
<label part="label" class=${F(t)}>
|
|
1337
1244
|
<span class="label-content">
|
|
1338
1245
|
<span>${this.label}</span>
|
|
1339
1246
|
${this.renderTooltip()}
|
|
@@ -1343,7 +1250,7 @@ let d = class extends I {
|
|
|
1343
1250
|
<div class="input-wrapper">
|
|
1344
1251
|
<input
|
|
1345
1252
|
part="input"
|
|
1346
|
-
class=${
|
|
1253
|
+
class=${F(e)}
|
|
1347
1254
|
type="text"
|
|
1348
1255
|
name="${a}"
|
|
1349
1256
|
.value=${this.inputValue}
|
|
@@ -1368,11 +1275,11 @@ let d = class extends I {
|
|
|
1368
1275
|
|
|
1369
1276
|
<div
|
|
1370
1277
|
id="predictions-list"
|
|
1371
|
-
class=${
|
|
1278
|
+
class=${F(i)}
|
|
1372
1279
|
part="dropdown"
|
|
1373
1280
|
role="listbox"
|
|
1374
1281
|
>
|
|
1375
|
-
${this.predictions.length > 0 ? this.predictions.map((
|
|
1282
|
+
${this.predictions.length > 0 ? this.predictions.map((n, l) => this.renderPrediction(n, l)) : this.inputValue && !this.isLoading ? g`<div class="no-results" part="no-results">${s.noResults}</div>` : ""}
|
|
1376
1283
|
</div>
|
|
1377
1284
|
</div>
|
|
1378
1285
|
${this.mode === "form" && this.validationError ? g`
|
|
@@ -1391,7 +1298,7 @@ let d = class extends I {
|
|
|
1391
1298
|
}
|
|
1392
1299
|
};
|
|
1393
1300
|
d.formAssociated = !0;
|
|
1394
|
-
d.styles =
|
|
1301
|
+
d.styles = me`
|
|
1395
1302
|
:host {
|
|
1396
1303
|
display: block;
|
|
1397
1304
|
position: relative;
|
|
@@ -1956,50 +1863,50 @@ h([
|
|
|
1956
1863
|
p({ type: Number })
|
|
1957
1864
|
], d.prototype, "minChars", 2);
|
|
1958
1865
|
h([
|
|
1959
|
-
|
|
1866
|
+
v()
|
|
1960
1867
|
], d.prototype, "predictions", 2);
|
|
1961
1868
|
h([
|
|
1962
|
-
|
|
1869
|
+
v()
|
|
1963
1870
|
], d.prototype, "isOpen", 2);
|
|
1964
1871
|
h([
|
|
1965
|
-
|
|
1872
|
+
v()
|
|
1966
1873
|
], d.prototype, "isLoading", 2);
|
|
1967
1874
|
h([
|
|
1968
|
-
|
|
1875
|
+
v()
|
|
1969
1876
|
], d.prototype, "error", 2);
|
|
1970
1877
|
h([
|
|
1971
|
-
|
|
1878
|
+
v()
|
|
1972
1879
|
], d.prototype, "activeIndex", 2);
|
|
1973
1880
|
h([
|
|
1974
|
-
|
|
1881
|
+
v()
|
|
1975
1882
|
], d.prototype, "inputValue", 2);
|
|
1976
1883
|
h([
|
|
1977
|
-
|
|
1884
|
+
v()
|
|
1978
1885
|
], d.prototype, "sessionToken", 2);
|
|
1979
1886
|
h([
|
|
1980
|
-
|
|
1887
|
+
v()
|
|
1981
1888
|
], d.prototype, "validationError", 2);
|
|
1982
1889
|
h([
|
|
1983
|
-
|
|
1890
|
+
v()
|
|
1984
1891
|
], d.prototype, "touched", 2);
|
|
1985
1892
|
h([
|
|
1986
|
-
|
|
1893
|
+
v()
|
|
1987
1894
|
], d.prototype, "showNationalAddressIcon", 2);
|
|
1988
1895
|
h([
|
|
1989
|
-
|
|
1896
|
+
Me("input")
|
|
1990
1897
|
], d.prototype, "inputElement", 2);
|
|
1991
1898
|
d = h([
|
|
1992
|
-
|
|
1899
|
+
Ue("salla-address-autocomplete")
|
|
1993
1900
|
], d);
|
|
1994
1901
|
export {
|
|
1995
|
-
|
|
1902
|
+
He as ADDRESS_VALIDATION_SUPPORTED_COUNTRIES,
|
|
1996
1903
|
d as SallaAddressAutocomplete,
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
1904
|
+
ae as checkValidationSupport,
|
|
1905
|
+
je as debounce,
|
|
1906
|
+
We as generateSessionToken,
|
|
1907
|
+
Ke as getCountryCode,
|
|
1908
|
+
B as getTranslations,
|
|
1909
|
+
Ge as isRTL,
|
|
1910
|
+
tt as parseHighlight,
|
|
1911
|
+
et as throttle
|
|
2005
1912
|
};
|