@telia-ace/widget-components-widget-header-flamingo 1.1.28 → 1.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1359 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- const I = globalThis, F = I.ShadowRoot && (I.ShadyCSS === void 0 || I.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, X = Symbol(), rt = /* @__PURE__ */ new WeakMap();
7
- let ft = class {
8
- constructor(t, e, s) {
9
- if (this._$cssResult$ = !0, s !== X)
10
- throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
11
- this.cssText = t, this.t = e;
12
- }
13
- get styleSheet() {
14
- let t = this.o;
15
- const e = this.t;
16
- if (F && t === void 0) {
17
- const s = e !== void 0 && e.length === 1;
18
- s && (t = rt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && rt.set(e, t));
19
- }
20
- return t;
21
- }
22
- toString() {
23
- return this.cssText;
24
- }
25
- };
26
- const Ut = (r) => new ft(typeof r == "string" ? r : r + "", void 0, X), P = (r, ...t) => {
27
- const e = r.length === 1 ? r[0] : t.reduce((s, i, n) => s + ((o) => {
28
- if (o._$cssResult$ === !0)
29
- return o.cssText;
30
- if (typeof o == "number")
31
- return o;
32
- throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
33
- })(i) + r[n + 1], r[0]);
34
- return new ft(e, r, X);
35
- }, kt = (r, t) => {
36
- if (F)
37
- r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
38
- else
39
- for (const e of t) {
40
- const s = document.createElement("style"), i = I.litNonce;
41
- i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
42
- }
43
- }, nt = F ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
44
- let e = "";
45
- for (const s of t.cssRules)
46
- e += s.cssText;
47
- return Ut(e);
48
- })(r) : r;
49
- /**
50
- * @license
51
- * Copyright 2017 Google LLC
52
- * SPDX-License-Identifier: BSD-3-Clause
53
- */
54
- const { is: Nt, defineProperty: Rt, getOwnPropertyDescriptor: Ht, getOwnPropertyNames: Mt, getOwnPropertySymbols: Lt, getPrototypeOf: zt } = Object, _ = globalThis, ot = _.trustedTypes, Bt = ot ? ot.emptyScript : "", Y = _.reactiveElementPolyfillSupport, U = (r, t) => r, W = { toAttribute(r, t) {
55
- switch (t) {
56
- case Boolean:
57
- r = r ? Bt : null;
58
- break;
59
- case Object:
60
- case Array:
61
- r = r == null ? r : JSON.stringify(r);
62
- }
63
- return r;
64
- }, fromAttribute(r, t) {
65
- let e = r;
66
- switch (t) {
67
- case Boolean:
68
- e = r !== null;
69
- break;
70
- case Number:
71
- e = r === null ? null : Number(r);
72
- break;
73
- case Object:
74
- case Array:
75
- try {
76
- e = JSON.parse(r);
77
- } catch {
78
- e = null;
79
- }
80
- }
81
- return e;
82
- } }, tt = (r, t) => !Nt(r, t), at = { attribute: !0, type: String, converter: W, reflect: !1, hasChanged: tt };
83
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), _.litPropertyMetadata ?? (_.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
84
- class C extends HTMLElement {
85
- static addInitializer(t) {
86
- this._$Ei(), (this.l ?? (this.l = [])).push(t);
87
- }
88
- static get observedAttributes() {
89
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
90
- }
91
- static createProperty(t, e = at) {
92
- if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
93
- const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
94
- i !== void 0 && Rt(this.prototype, t, i);
95
- }
96
- }
97
- static getPropertyDescriptor(t, e, s) {
98
- const { get: i, set: n } = Ht(this.prototype, t) ?? { get() {
99
- return this[e];
100
- }, set(o) {
101
- this[e] = o;
102
- } };
103
- return { get() {
104
- return i == null ? void 0 : i.call(this);
105
- }, set(o) {
106
- const c = i == null ? void 0 : i.call(this);
107
- n.call(this, o), this.requestUpdate(t, c, s);
108
- }, configurable: !0, enumerable: !0 };
109
- }
110
- static getPropertyOptions(t) {
111
- return this.elementProperties.get(t) ?? at;
112
- }
113
- static _$Ei() {
114
- if (this.hasOwnProperty(U("elementProperties")))
115
- return;
116
- const t = zt(this);
117
- t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
118
- }
119
- static finalize() {
120
- if (this.hasOwnProperty(U("finalized")))
121
- return;
122
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(U("properties"))) {
123
- const e = this.properties, s = [...Mt(e), ...Lt(e)];
124
- for (const i of s)
125
- this.createProperty(i, e[i]);
126
- }
127
- const t = this[Symbol.metadata];
128
- if (t !== null) {
129
- const e = litPropertyMetadata.get(t);
130
- if (e !== void 0)
131
- for (const [s, i] of e)
132
- this.elementProperties.set(s, i);
133
- }
134
- this._$Eh = /* @__PURE__ */ new Map();
135
- for (const [e, s] of this.elementProperties) {
136
- const i = this._$Eu(e, s);
137
- i !== void 0 && this._$Eh.set(i, e);
138
- }
139
- this.elementStyles = this.finalizeStyles(this.styles);
140
- }
141
- static finalizeStyles(t) {
142
- const e = [];
143
- if (Array.isArray(t)) {
144
- const s = new Set(t.flat(1 / 0).reverse());
145
- for (const i of s)
146
- e.unshift(nt(i));
147
- } else
148
- t !== void 0 && e.push(nt(t));
149
- return e;
150
- }
151
- static _$Eu(t, e) {
152
- const s = e.attribute;
153
- return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
154
- }
155
- constructor() {
156
- super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
157
- }
158
- _$Ev() {
159
- var t;
160
- this._$Eg = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
161
- }
162
- addController(t) {
163
- var e;
164
- (this._$ES ?? (this._$ES = [])).push(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
165
- }
166
- removeController(t) {
167
- var e;
168
- (e = this._$ES) == null || e.splice(this._$ES.indexOf(t) >>> 0, 1);
169
- }
170
- _$E_() {
171
- const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
172
- for (const s of e.keys())
173
- this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
174
- t.size > 0 && (this._$Ep = t);
175
- }
176
- createRenderRoot() {
177
- const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
178
- return kt(t, this.constructor.elementStyles), t;
179
- }
180
- connectedCallback() {
181
- var t;
182
- this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$ES) == null || t.forEach((e) => {
183
- var s;
184
- return (s = e.hostConnected) == null ? void 0 : s.call(e);
185
- });
186
- }
187
- enableUpdating(t) {
188
- }
189
- disconnectedCallback() {
190
- var t;
191
- (t = this._$ES) == null || t.forEach((e) => {
192
- var s;
193
- return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
194
- });
195
- }
196
- attributeChangedCallback(t, e, s) {
197
- this._$AK(t, s);
198
- }
199
- _$EO(t, e) {
200
- var n;
201
- const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
202
- if (i !== void 0 && s.reflect === !0) {
203
- const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : W).toAttribute(e, s.type);
204
- this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
205
- }
206
- }
207
- _$AK(t, e) {
208
- var n;
209
- const s = this.constructor, i = s._$Eh.get(t);
210
- if (i !== void 0 && this._$Em !== i) {
211
- const o = s.getPropertyOptions(i), c = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : W;
212
- this._$Em = i, this[i] = c.fromAttribute(e, o.type), this._$Em = null;
213
- }
214
- }
215
- requestUpdate(t, e, s, i = !1, n) {
216
- if (t !== void 0) {
217
- if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? tt)(i ? n : this[t], e))
218
- return;
219
- this.C(t, e, s);
220
- }
221
- this.isUpdatePending === !1 && (this._$Eg = this._$EP());
222
- }
223
- C(t, e, s) {
224
- this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
225
- }
226
- async _$EP() {
227
- this.isUpdatePending = !0;
228
- try {
229
- await this._$Eg;
230
- } catch (e) {
231
- Promise.reject(e);
232
- }
233
- const t = this.scheduleUpdate();
234
- return t != null && await t, !this.isUpdatePending;
235
- }
236
- scheduleUpdate() {
237
- return this.performUpdate();
238
- }
239
- performUpdate() {
240
- var s;
241
- if (!this.isUpdatePending)
242
- return;
243
- if (!this.hasUpdated) {
244
- if (this._$Ep) {
245
- for (const [n, o] of this._$Ep)
246
- this[n] = o;
247
- this._$Ep = void 0;
248
- }
249
- const i = this.constructor.elementProperties;
250
- if (i.size > 0)
251
- for (const [n, o] of i)
252
- o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.C(n, this[n], o);
253
- }
254
- let t = !1;
255
- const e = this._$AL;
256
- try {
257
- t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$ES) == null || s.forEach((i) => {
258
- var n;
259
- return (n = i.hostUpdate) == null ? void 0 : n.call(i);
260
- }), this.update(e)) : this._$ET();
261
- } catch (i) {
262
- throw t = !1, this._$ET(), i;
263
- }
264
- t && this._$AE(e);
265
- }
266
- willUpdate(t) {
267
- }
268
- _$AE(t) {
269
- var e;
270
- (e = this._$ES) == null || e.forEach((s) => {
271
- var i;
272
- return (i = s.hostUpdated) == null ? void 0 : i.call(s);
273
- }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
274
- }
275
- _$ET() {
276
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
277
- }
278
- get updateComplete() {
279
- return this.getUpdateComplete();
280
- }
281
- getUpdateComplete() {
282
- return this._$Eg;
283
- }
284
- shouldUpdate(t) {
285
- return !0;
286
- }
287
- update(t) {
288
- this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EO(e, this[e]))), this._$ET();
289
- }
290
- updated(t) {
291
- }
292
- firstUpdated(t) {
293
- }
294
- }
295
- C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[U("elementProperties")] = /* @__PURE__ */ new Map(), C[U("finalized")] = /* @__PURE__ */ new Map(), Y == null || Y({ ReactiveElement: C }), (_.reactiveElementVersions ?? (_.reactiveElementVersions = [])).push("2.0.1");
296
- /**
297
- * @license
298
- * Copyright 2017 Google LLC
299
- * SPDX-License-Identifier: BSD-3-Clause
300
- */
301
- const k = globalThis, G = k.trustedTypes, ct = G ? G.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, $t = "$lit$", y = `lit$${(Math.random() + "").slice(9)}$`, mt = "?" + y, Dt = `<${mt}>`, w = document, R = () => w.createComment(""), H = (r) => r === null || typeof r != "object" && typeof r != "function", yt = Array.isArray, jt = (r) => yt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", J = `[
302
- \f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, lt = /-->/g, ht = />/g, b = RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^
303
- \f\r"'\`<>=]|("|')|))|$)`, "g"), dt = /'/g, pt = /"/g, _t = /^(?:script|style|textarea|title)$/i, It = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), f = It(1), E = Symbol.for("lit-noChange"), l = Symbol.for("lit-nothing"), ut = /* @__PURE__ */ new WeakMap(), x = w.createTreeWalker(w, 129);
304
- function vt(r, t) {
305
- if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
306
- throw Error("invalid template strings array");
307
- return ct !== void 0 ? ct.createHTML(t) : t;
308
- }
309
- const Wt = (r, t) => {
310
- const e = r.length - 1, s = [];
311
- let i, n = t === 2 ? "<svg>" : "", o = O;
312
- for (let c = 0; c < e; c++) {
313
- const a = r[c];
314
- let d, p, h = -1, u = 0;
315
- for (; u < a.length && (o.lastIndex = u, p = o.exec(a), p !== null); )
316
- u = o.lastIndex, o === O ? p[1] === "!--" ? o = lt : p[1] !== void 0 ? o = ht : p[2] !== void 0 ? (_t.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = b) : p[3] !== void 0 && (o = b) : o === b ? p[0] === ">" ? (o = i ?? O, h = -1) : p[1] === void 0 ? h = -2 : (h = o.lastIndex - p[2].length, d = p[1], o = p[3] === void 0 ? b : p[3] === '"' ? pt : dt) : o === pt || o === dt ? o = b : o === lt || o === ht ? o = O : (o = b, i = void 0);
317
- const m = o === b && r[c + 1].startsWith("/>") ? " " : "";
318
- n += o === O ? a + Dt : h >= 0 ? (s.push(d), a.slice(0, h) + $t + a.slice(h) + y + m) : a + y + (h === -2 ? c : m);
319
- }
320
- return [vt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), s];
321
- };
322
- class M {
323
- constructor({ strings: t, _$litType$: e }, s) {
324
- let i;
325
- this.parts = [];
326
- let n = 0, o = 0;
327
- const c = t.length - 1, a = this.parts, [d, p] = Wt(t, e);
328
- if (this.el = M.createElement(d, s), x.currentNode = this.el.content, e === 2) {
329
- const h = this.el.content.firstChild;
330
- h.replaceWith(...h.childNodes);
331
- }
332
- for (; (i = x.nextNode()) !== null && a.length < c; ) {
333
- if (i.nodeType === 1) {
334
- if (i.hasAttributes())
335
- for (const h of i.getAttributeNames())
336
- if (h.endsWith($t)) {
337
- const u = p[o++], m = i.getAttribute(h).split(y), D = /([.?@])?(.*)/.exec(u);
338
- a.push({ type: 1, index: n, name: D[2], strings: m, ctor: D[1] === "." ? Vt : D[1] === "?" ? qt : D[1] === "@" ? Yt : q }), i.removeAttribute(h);
339
- } else
340
- h.startsWith(y) && (a.push({ type: 6, index: n }), i.removeAttribute(h));
341
- if (_t.test(i.tagName)) {
342
- const h = i.textContent.split(y), u = h.length - 1;
343
- if (u > 0) {
344
- i.textContent = G ? G.emptyScript : "";
345
- for (let m = 0; m < u; m++)
346
- i.append(h[m], R()), x.nextNode(), a.push({ type: 2, index: ++n });
347
- i.append(h[u], R());
348
- }
349
- }
350
- } else if (i.nodeType === 8)
351
- if (i.data === mt)
352
- a.push({ type: 2, index: n });
353
- else {
354
- let h = -1;
355
- for (; (h = i.data.indexOf(y, h + 1)) !== -1; )
356
- a.push({ type: 7, index: n }), h += y.length - 1;
357
- }
358
- n++;
359
- }
360
- }
361
- static createElement(t, e) {
362
- const s = w.createElement("template");
363
- return s.innerHTML = t, s;
364
- }
365
- }
366
- function S(r, t, e = r, s) {
367
- var o, c;
368
- if (t === E)
369
- return t;
370
- let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
371
- const n = H(t) ? void 0 : t._$litDirective$;
372
- return (i == null ? void 0 : i.constructor) !== n && ((c = i == null ? void 0 : i._$AO) == null || c.call(i, !1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = S(r, i._$AS(r, t.values), i, s)), t;
373
- }
374
- class Gt {
375
- constructor(t, e) {
376
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
377
- }
378
- get parentNode() {
379
- return this._$AM.parentNode;
380
- }
381
- get _$AU() {
382
- return this._$AM._$AU;
383
- }
384
- u(t) {
385
- const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? w).importNode(e, !0);
386
- x.currentNode = i;
387
- let n = x.nextNode(), o = 0, c = 0, a = s[0];
388
- for (; a !== void 0; ) {
389
- if (o === a.index) {
390
- let d;
391
- a.type === 2 ? d = new L(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Jt(n, this, t)), this._$AV.push(d), a = s[++c];
392
- }
393
- o !== (a == null ? void 0 : a.index) && (n = x.nextNode(), o++);
394
- }
395
- return x.currentNode = w, i;
396
- }
397
- p(t) {
398
- let e = 0;
399
- for (const s of this._$AV)
400
- s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
401
- }
402
- }
403
- class L {
404
- get _$AU() {
405
- var t;
406
- return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
407
- }
408
- constructor(t, e, s, i) {
409
- this.type = 2, this._$AH = l, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
410
- }
411
- get parentNode() {
412
- let t = this._$AA.parentNode;
413
- const e = this._$AM;
414
- return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
415
- }
416
- get startNode() {
417
- return this._$AA;
418
- }
419
- get endNode() {
420
- return this._$AB;
421
- }
422
- _$AI(t, e = this) {
423
- t = S(this, t, e), H(t) ? t === l || t == null || t === "" ? (this._$AH !== l && this._$AR(), this._$AH = l) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : jt(t) ? this.T(t) : this._(t);
424
- }
425
- k(t) {
426
- return this._$AA.parentNode.insertBefore(t, this._$AB);
427
- }
428
- $(t) {
429
- this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
430
- }
431
- _(t) {
432
- this._$AH !== l && H(this._$AH) ? this._$AA.nextSibling.data = t : this.$(w.createTextNode(t)), this._$AH = t;
433
- }
434
- g(t) {
435
- var n;
436
- const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = M.createElement(vt(s.h, s.h[0]), this.options)), s);
437
- if (((n = this._$AH) == null ? void 0 : n._$AD) === i)
438
- this._$AH.p(e);
439
- else {
440
- const o = new Gt(i, this), c = o.u(this.options);
441
- o.p(e), this.$(c), this._$AH = o;
442
- }
443
- }
444
- _$AC(t) {
445
- let e = ut.get(t.strings);
446
- return e === void 0 && ut.set(t.strings, e = new M(t)), e;
447
- }
448
- T(t) {
449
- yt(this._$AH) || (this._$AH = [], this._$AR());
450
- const e = this._$AH;
451
- let s, i = 0;
452
- for (const n of t)
453
- i === e.length ? e.push(s = new L(this.k(R()), this.k(R()), this, this.options)) : s = e[i], s._$AI(n), i++;
454
- i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
455
- }
456
- _$AR(t = this._$AA.nextSibling, e) {
457
- var s;
458
- for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
459
- const i = t.nextSibling;
460
- t.remove(), t = i;
461
- }
462
- }
463
- setConnected(t) {
464
- var e;
465
- this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
466
- }
467
- }
468
- class q {
469
- get tagName() {
470
- return this.element.tagName;
471
- }
472
- get _$AU() {
473
- return this._$AM._$AU;
474
- }
475
- constructor(t, e, s, i, n) {
476
- this.type = 1, this._$AH = l, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = l;
477
- }
478
- _$AI(t, e = this, s, i) {
479
- const n = this.strings;
480
- let o = !1;
481
- if (n === void 0)
482
- t = S(this, t, e, 0), o = !H(t) || t !== this._$AH && t !== E, o && (this._$AH = t);
483
- else {
484
- const c = t;
485
- let a, d;
486
- for (t = n[0], a = 0; a < n.length - 1; a++)
487
- d = S(this, c[s + a], e, a), d === E && (d = this._$AH[a]), o || (o = !H(d) || d !== this._$AH[a]), d === l ? t = l : t !== l && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
488
- }
489
- o && !i && this.O(t);
490
- }
491
- O(t) {
492
- t === l ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
493
- }
494
- }
495
- class Vt extends q {
496
- constructor() {
497
- super(...arguments), this.type = 3;
498
- }
499
- O(t) {
500
- this.element[this.name] = t === l ? void 0 : t;
501
- }
502
- }
503
- class qt extends q {
504
- constructor() {
505
- super(...arguments), this.type = 4;
506
- }
507
- O(t) {
508
- this.element.toggleAttribute(this.name, !!t && t !== l);
509
- }
510
- }
511
- class Yt extends q {
512
- constructor(t, e, s, i, n) {
513
- super(t, e, s, i, n), this.type = 5;
514
- }
515
- _$AI(t, e = this) {
516
- if ((t = S(this, t, e, 0) ?? l) === E)
517
- return;
518
- const s = this._$AH, i = t === l && s !== l || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== l && (s === l || i);
519
- i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
520
- }
521
- handleEvent(t) {
522
- var e;
523
- typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
524
- }
525
- }
526
- class Jt {
527
- constructor(t, e, s) {
528
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
529
- }
530
- get _$AU() {
531
- return this._$AM._$AU;
532
- }
533
- _$AI(t) {
534
- S(this, t);
535
- }
536
- }
537
- const K = k.litHtmlPolyfillSupport;
538
- K == null || K(M, L), (k.litHtmlVersions ?? (k.litHtmlVersions = [])).push("3.0.2");
539
- const Kt = (r, t, e) => {
540
- const s = (e == null ? void 0 : e.renderBefore) ?? t;
541
- let i = s._$litPart$;
542
- if (i === void 0) {
543
- const n = (e == null ? void 0 : e.renderBefore) ?? null;
544
- s._$litPart$ = i = new L(t.insertBefore(R(), n), n, void 0, e ?? {});
545
- }
546
- return i._$AI(r), i;
547
- };
548
- /**
549
- * @license
550
- * Copyright 2017 Google LLC
551
- * SPDX-License-Identifier: BSD-3-Clause
552
- */
553
- let $ = class extends C {
554
- constructor() {
555
- super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
556
- }
557
- createRenderRoot() {
558
- var e;
559
- const t = super.createRenderRoot();
560
- return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
561
- }
562
- update(t) {
563
- const e = this.render();
564
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Kt(e, this.renderRoot, this.renderOptions);
565
- }
566
- connectedCallback() {
567
- var t;
568
- super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
569
- }
570
- disconnectedCallback() {
571
- var t;
572
- super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
573
- }
574
- render() {
575
- return E;
576
- }
577
- };
578
- var gt;
579
- $._$litElement$ = !0, $.finalized = !0, (gt = globalThis.litElementHydrateSupport) == null || gt.call(globalThis, { LitElement: $ });
580
- const Z = globalThis.litElementPolyfillSupport;
581
- Z == null || Z({ LitElement: $ });
582
- (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.1");
583
- /**
584
- * @license
585
- * Copyright 2017 Google LLC
586
- * SPDX-License-Identifier: BSD-3-Clause
587
- */
588
- const Zt = { attribute: !0, type: String, converter: W, reflect: !1, hasChanged: tt }, Qt = (r = Zt, t, e) => {
589
- const { kind: s, metadata: i } = e;
590
- let n = globalThis.litPropertyMetadata.get(i);
591
- if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), n.set(e.name, r), s === "accessor") {
592
- const { name: o } = e;
593
- return { set(c) {
594
- const a = t.get.call(this);
595
- t.set.call(this, c), this.requestUpdate(o, a, r);
596
- }, init(c) {
597
- return c !== void 0 && this.C(o, void 0, r), c;
598
- } };
599
- }
600
- if (s === "setter") {
601
- const { name: o } = e;
602
- return function(c) {
603
- const a = this[o];
604
- t.call(this, c), this.requestUpdate(o, a, r);
605
- };
606
- }
607
- throw Error("Unsupported decorator location: " + s);
608
- };
609
- function g(r) {
610
- return (t, e) => typeof e == "object" ? Qt(r, t, e) : ((s, i, n) => {
611
- const o = i.hasOwnProperty(n);
612
- return i.constructor.createProperty(n, o ? { ...s, wrapped: !0 } : s), o ? Object.getOwnPropertyDescriptor(i, n) : void 0;
613
- })(r, t, e);
614
- }
615
- /**
616
- * @license
617
- * Copyright 2017 Google LLC
618
- * SPDX-License-Identifier: BSD-3-Clause
619
- */
620
- function T(r) {
621
- return g({ ...r, state: !0, attribute: !1 });
622
- }
623
- /**
624
- * @license
625
- * Copyright 2017 Google LLC
626
- * SPDX-License-Identifier: BSD-3-Clause
627
- */
628
- const bt = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, At = (r) => (...t) => ({ _$litDirective$: r, values: t });
629
- class xt {
630
- constructor(t) {
631
- }
632
- get _$AU() {
633
- return this._$AM._$AU;
634
- }
635
- _$AT(t, e, s) {
636
- this._$Ct = t, this._$AM = e, this._$Ci = s;
637
- }
638
- _$AS(t, e) {
639
- return this.update(t, e);
640
- }
641
- update(t, e) {
642
- return this.render(...e);
643
- }
644
- }
645
- /**
646
- * @license
647
- * Copyright 2018 Google LLC
648
- * SPDX-License-Identifier: BSD-3-Clause
649
- */
650
- const Ft = At(class extends xt {
651
- constructor(r) {
652
- var t;
653
- if (super(r), r.type !== bt.ATTRIBUTE || r.name !== "class" || ((t = r.strings) == null ? void 0 : t.length) > 2)
654
- throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
655
- }
656
- render(r) {
657
- return " " + Object.keys(r).filter((t) => r[t]).join(" ") + " ";
658
- }
659
- update(r, [t]) {
660
- var s, i;
661
- if (this.it === void 0) {
662
- this.it = /* @__PURE__ */ new Set(), r.strings !== void 0 && (this.st = new Set(r.strings.join(" ").split(/\s/).filter((n) => n !== "")));
663
- for (const n in t)
664
- t[n] && !((s = this.st) != null && s.has(n)) && this.it.add(n);
665
- return this.render(t);
666
- }
667
- const e = r.element.classList;
668
- for (const n of this.it)
669
- n in t || (e.remove(n), this.it.delete(n));
670
- for (const n in t) {
671
- const o = !!t[n];
672
- o === this.it.has(n) || (i = this.st) != null && i.has(n) || (o ? (e.add(n), this.it.add(n)) : (e.remove(n), this.it.delete(n)));
673
- }
674
- return E;
675
- }
676
- }), j = (r, t, e) => {
677
- r && e.style.setProperty(t, r);
678
- }, wt = (r, t) => {
679
- var e, s, i, n;
680
- j((e = r.colors) == null ? void 0 : e.primaryBackground, "--primary-background", t), j(
681
- (s = r.colors) == null ? void 0 : s.textOnPrimaryBackground,
682
- "--text-on-primary-background",
683
- t
684
- ), j(
685
- (i = r.colors) == null ? void 0 : i.secondaryBackground,
686
- "--secondary-background",
687
- t
688
- ), j(
689
- (n = r.colors) == null ? void 0 : n.textOnSecondaryBackground,
690
- "--text-on-secondary-background",
691
- t
692
- );
693
- };
694
- /**
695
- * @license
696
- * Copyright 2020 Google LLC
697
- * SPDX-License-Identifier: BSD-3-Clause
698
- */
699
- const Xt = (r) => r.strings === void 0;
700
- /**
701
- * @license
702
- * Copyright 2017 Google LLC
703
- * SPDX-License-Identifier: BSD-3-Clause
704
- */
705
- const N = (r, t) => {
706
- var s;
707
- const e = r._$AN;
708
- if (e === void 0)
709
- return !1;
710
- for (const i of e)
711
- (s = i._$AO) == null || s.call(i, t, !1), N(i, t);
712
- return !0;
713
- }, V = (r) => {
714
- let t, e;
715
- do {
716
- if ((t = r._$AM) === void 0)
717
- break;
718
- e = t._$AN, e.delete(r), r = t;
719
- } while ((e == null ? void 0 : e.size) === 0);
720
- }, Et = (r) => {
721
- for (let t; t = r._$AM; r = t) {
722
- let e = t._$AN;
723
- if (e === void 0)
724
- t._$AN = e = /* @__PURE__ */ new Set();
725
- else if (e.has(r))
726
- break;
727
- e.add(r), se(t);
728
- }
729
- };
730
- function te(r) {
731
- this._$AN !== void 0 ? (V(this), this._$AM = r, Et(this)) : this._$AM = r;
732
- }
733
- function ee(r, t = !1, e = 0) {
734
- const s = this._$AH, i = this._$AN;
735
- if (i !== void 0 && i.size !== 0)
736
- if (t)
737
- if (Array.isArray(s))
738
- for (let n = e; n < s.length; n++)
739
- N(s[n], !1), V(s[n]);
740
- else
741
- s != null && (N(s, !1), V(s));
742
- else
743
- N(this, r);
744
- }
745
- const se = (r) => {
746
- r.type == bt.CHILD && (r._$AP ?? (r._$AP = ee), r._$AQ ?? (r._$AQ = te));
747
- };
748
- class ie extends xt {
749
- constructor() {
750
- super(...arguments), this._$AN = void 0;
751
- }
752
- _$AT(t, e, s) {
753
- super._$AT(t, e, s), Et(this), this.isConnected = t._$AU;
754
- }
755
- _$AO(t, e = !0) {
756
- var s, i;
757
- t !== this.isConnected && (this.isConnected = t, t ? (s = this.reconnected) == null || s.call(this) : (i = this.disconnected) == null || i.call(this)), e && (N(this, t), V(this));
758
- }
759
- setValue(t) {
760
- if (Xt(this._$Ct))
761
- this._$Ct._$AI(t, this);
762
- else {
763
- const e = [...this._$Ct._$AH];
764
- e[this._$Ci] = t, this._$Ct._$AI(e, this, 0);
765
- }
766
- }
767
- disconnected() {
768
- }
769
- reconnected() {
770
- }
771
- }
772
- /**
773
- * @license
774
- * Copyright 2020 Google LLC
775
- * SPDX-License-Identifier: BSD-3-Clause
776
- */
777
- const Ct = () => new re();
778
- class re {
779
- }
780
- const Q = /* @__PURE__ */ new WeakMap(), St = At(class extends ie {
781
- render(r) {
782
- return l;
783
- }
784
- update(r, [t]) {
785
- var s;
786
- const e = t !== this.G;
787
- return e && this.G !== void 0 && this.ot(void 0), (e || this.rt !== this.lt) && (this.G = t, this.ct = (s = r.options) == null ? void 0 : s.host, this.ot(this.lt = r.element)), l;
788
- }
789
- ot(r) {
790
- if (typeof this.G == "function") {
791
- const t = this.ct ?? globalThis;
792
- let e = Q.get(t);
793
- e === void 0 && (e = /* @__PURE__ */ new WeakMap(), Q.set(t, e)), e.get(this.G) !== void 0 && this.G.call(this.ct, void 0), e.set(this.G, r), r !== void 0 && this.G.call(this.ct, r);
794
- } else
795
- this.G.value = r;
796
- }
797
- get rt() {
798
- var r, t;
799
- return typeof this.G == "function" ? (r = Q.get(this.ct ?? globalThis)) == null ? void 0 : r.get(this.G) : (t = this.G) == null ? void 0 : t.value;
800
- }
801
- disconnected() {
802
- this.rt === this.lt && this.ot(void 0);
803
- }
804
- reconnected() {
805
- this.ot(this.lt);
806
- }
807
- });
808
- var ne = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, z = (r, t, e, s) => {
809
- for (var i = s > 1 ? void 0 : s ? oe(t, e) : t, n = r.length - 1, o; n >= 0; n--)
810
- (o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
811
- return s && i && ne(t, e, i), i;
812
- };
813
- class v extends $ {
814
- constructor() {
815
- super(...arguments), this.active = !1, this.loaded = !1, this.offset = 0, this.buttonRef = Ct();
816
- }
817
- async connectedCallback() {
818
- super.connectedCallback(), this.icon = await this._renderSymbol(), this.loaded = !0, this._applyBranding(), this.offset > 0 && this.buttonRef.value && (this.buttonRef.value.style.right = `calc(${this.offset}px + 20px)`);
819
- }
820
- _toggleActive() {
821
- var t;
822
- if (!((t = this.application) != null && t.root)) {
823
- console.warn(
824
- "Could not activate widget. No root element assigned to widget."
825
- );
826
- return;
827
- }
828
- this.active = !this.active, this.active ? this.application.appendToDOM() : this.application.hide();
829
- }
830
- _applyBranding() {
831
- var t;
832
- (t = this.application) != null && t.settings && wt(this.application.settings.branding, this);
833
- }
834
- async _renderSymbol() {
835
- var c, a, d;
836
- const t = (c = this.application) == null ? void 0 : c.branding(), e = (a = t == null ? void 0 : t.graphics) == null ? void 0 : a.trigger;
837
- if (e)
838
- return f` <img src=${e} class="trigger-icon" alt="" /> `;
839
- const s = (d = this.application) == null ? void 0 : d.triggerIcon;
840
- if (!s)
841
- return l;
842
- const i = async (p) => await import("./index-5087564d.mjs").then(
843
- (u) => u[p]
844
- ), { type: n, content: o } = s;
845
- switch (n) {
846
- case "Telia": {
847
- const p = await i(o);
848
- return p ? f`<telia-icon
849
- class="trigger-icon"
850
- svg=${p.svg}
851
- size="lg"
852
- ></telia-icon>` : l;
853
- }
854
- default:
855
- return l;
856
- }
857
- }
858
- setOffset(t) {
859
- this.offset = t;
860
- }
861
- render() {
862
- var t, e, s, i;
863
- return f`<div class="trigger-container">
864
- ${(i = (s = (e = (t = this.application) == null ? void 0 : t.settings) == null ? void 0 : e.branding) == null ? void 0 : s.other) != null && i.showButtonLabel ? f`
865
- <button class="trigger-label" @click=${this._toggleActive}>
866
- ${this.application.settings.branding.other.buttonLabelText}
867
- </button>
868
- ` : l}
869
-
870
- <button
871
- class=${Ft({
872
- trigger: !0,
873
- active: this.active,
874
- rendered: this.loaded
875
- })}
876
- @click=${this._toggleActive}
877
- ${St(this.buttonRef)}
878
- >
879
- ${this.icon}
880
- <span class="trigger-close">
881
- <svg
882
- width="18"
883
- height="9"
884
- viewBox="0 0 18 9"
885
- fill="none"
886
- xmlns="http://www.w3.org/2000/svg"
887
- >
888
- <path
889
- d="M9 9C8.81794 9.00045 8.63759 8.96634 8.46939 8.89965C8.3012 8.83295 8.14851 8.735 8.02015 8.61145L0.194523 1.12367C0.068294 0.99862 -0.00155266 0.831133 2.61958e-05 0.657285C0.00160506 0.483436 0.0744832 0.317136 0.202964 0.194202C0.331445 0.0712675 0.505249 0.00153576 0.686941 2.50649e-05C0.868634 -0.00148563 1.04368 0.0653456 1.17437 0.186125L9 7.6739L16.8256 0.186125C16.9563 0.0653456 17.1314 -0.00148563 17.3131 2.50649e-05C17.4948 0.00153576 17.6686 0.0712675 17.797 0.194202C17.9255 0.317136 17.9984 0.483436 18 0.657285C18.0016 0.831133 17.9317 0.99862 17.8055 1.12367L9.97985 8.61145C9.85149 8.735 9.6988 8.83295 9.53061 8.89965C9.36241 8.96634 9.18206 9.00045 9 9Z"
890
- fill="white"
891
- />
892
- </svg>
893
- </span>
894
- <span class="trigger-loader">
895
- <svg viewBox="25 25 50 50">
896
- <circle
897
- cx="50"
898
- cy="50"
899
- r="20"
900
- fill="none"
901
- stroke="#000"
902
- stroke-width="2"
903
- stroke-miterlimit="10"
904
- />
905
- </svg>
906
- </span>
907
- </button>
908
- </div>`;
909
- }
910
- }
911
- v.styles = [
912
- P`
913
- :host {
914
- --voca-rem-multiplier: 0.625;
915
- --trigger-label-bg: #f5e0ff;
916
- --trigger-label-text-color: rgba(0, 0, 0, 0.8);
917
- display: block;
918
- box-sizing: border-box;
919
- /* font-family: var(--font-family); */
920
- font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
921
- }
922
-
923
- .trigger-container {
924
- position: fixed;
925
- bottom: 20px;
926
- right: 20px;
927
- display: flex;
928
- align-items: center;
929
- gap: 1rem;
930
- }
931
-
932
- .trigger {
933
- transform: scale(0);
934
- box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
935
- z-index: 5;
936
- display: flex;
937
- align-items: center;
938
- justify-content: center;
939
- border: none;
940
- line-height: 55px;
941
- height: 55px;
942
- width: 55px;
943
- border-radius: 55px;
944
- cursor: pointer;
945
- background-color: var(--trigger-bg, var(--primary-background));
946
- font-family: Lato;
947
- text-decoration: none;
948
- border: 3px dashed transparent;
949
- box-sizing: border-box;
950
- transition: transform 200ms ease-out;
951
- }
952
- .trigger:hover {
953
- transform: scale(1.1) !important;
954
- }
955
- .trigger.rendered {
956
- transform: scale(1);
957
- }
958
- .trigger.active .trigger-icon {
959
- opacity: 0;
960
- transform: rotate(-180deg) scale(0);
961
- }
962
- .trigger.active .trigger-close {
963
- opacity: 1;
964
- transform: rotate(0deg) scale(1);
965
- }
966
-
967
- .trigger-icon {
968
- display: inline-block;
969
- line-height: inherit;
970
- text-align: center;
971
- opacity: 1;
972
- transform: rotate(0deg) scale(1);
973
- transition: opacity 200ms ease-out, transform 200ms ease-out;
974
- color: var(--trigger-text-color, var(--text-on-primary-background));
975
- }
976
- .trigger-close {
977
- opacity: 0;
978
- transition: transform 200ms ease-out;
979
- transform: rotate(180deg) scale(0);
980
- position: absolute;
981
- top: 0;
982
- bottom: 0;
983
- left: 0;
984
- right: 0;
985
- display: flex;
986
- justify-content: center;
987
- align-items: center;
988
- fill: var(--trigger-text-color, var(--text-on-primary-background));
989
- }
990
-
991
- img {
992
- max-width: 100%;
993
- }
994
-
995
- .trigger-label {
996
- box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1);
997
- background-color: var(--trigger-label-bg);
998
- color: var(--trigger-label-text-color);
999
- white-space: nowrap;
1000
- padding: 0.7rem 1rem;
1001
- border-radius: 0.3rem;
1002
- font-weight: 500;
1003
- display: flex;
1004
- justify-content: center;
1005
- align-items: center;
1006
- cursor: pointer;
1007
- border: none;
1008
- font-size: 1rem;
1009
- font-family: inherit;
1010
- transition: all 300ms ease-in-out;
1011
- }
1012
-
1013
- .trigger-label:hover {
1014
- opacity: 0.8;
1015
- }
1016
- `
1017
- ];
1018
- z([
1019
- g({ attribute: !1 })
1020
- ], v.prototype, "application", 2);
1021
- z([
1022
- T()
1023
- ], v.prototype, "active", 2);
1024
- z([
1025
- T()
1026
- ], v.prototype, "loaded", 2);
1027
- z([
1028
- T()
1029
- ], v.prototype, "icon", 2);
1030
- z([
1031
- T()
1032
- ], v.prototype, "offset", 2);
1033
- var ae = Object.defineProperty, ce = Object.getOwnPropertyDescriptor, A = (r, t, e, s) => {
1034
- for (var i = s > 1 ? void 0 : s ? ce(t, e) : t, n = r.length - 1, o; n >= 0; n--)
1035
- (o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
1036
- return s && i && ae(t, e, i), i;
1037
- };
1038
- const Pt = (r) => {
1039
- class t extends r {
1040
- constructor() {
1041
- super(...arguments), this.properties = {}, this.context = {}, this.layout = {}, this.nodes = [];
1042
- }
1043
- writeProperties(s) {
1044
- this.properties = s;
1045
- }
1046
- writeLayout(s) {
1047
- this.layout = s;
1048
- }
1049
- writeContext(s) {
1050
- this.context = s;
1051
- }
1052
- addChild(s) {
1053
- s.parent = this, this.nodes.push(s);
1054
- }
1055
- connectedCallback() {
1056
- super.connectedCallback(), this.renderRoot.host.style.setProperty(
1057
- "--width",
1058
- this.layout.size === "full" ? "var(--columns, 1)" : `min(${this.layout.size || "var(--columns)"}, var(--columns))`
1059
- );
1060
- }
1061
- }
1062
- return t.styles = [
1063
- // (superClass as unknown as typeof LitElement).styles ?? [],
1064
- P`
1065
- :host {
1066
- font-family: var(--font-family);
1067
- grid-column: span var(--width);
1068
- max-width: 100%;
1069
- overflow: hidden;
1070
- box-sizing: border-box;
1071
- display: block;
1072
- }
1073
- * {
1074
- box-sizing: border-box;
1075
- }
1076
- `
1077
- ], A([
1078
- g()
1079
- ], t.prototype, "properties", 2), A([
1080
- g()
1081
- ], t.prototype, "context", 2), A([
1082
- g()
1083
- ], t.prototype, "layout", 2), A([
1084
- g()
1085
- ], t.prototype, "name", 2), A([
1086
- g()
1087
- ], t.prototype, "type", 2), A([
1088
- g({ attribute: !1 })
1089
- ], t.prototype, "application", 2), A([
1090
- g({ attribute: !1 })
1091
- ], t.prototype, "parent", 2), t;
1092
- };
1093
- class Tt extends Pt($) {
1094
- render() {
1095
- return f`Non resolved component`;
1096
- }
1097
- }
1098
- Tt.styles = [
1099
- P`
1100
- :host {
1101
- display: block;
1102
- }
1103
- `
1104
- ];
1105
- /**
1106
- * @license
1107
- * Copyright 2021 Google LLC
1108
- * SPDX-License-Identifier: BSD-3-Clause
1109
- */
1110
- function* le(r, t) {
1111
- if (r !== void 0) {
1112
- let e = 0;
1113
- for (const s of r)
1114
- yield t(s, e++);
1115
- }
1116
- }
1117
- var et = /* @__PURE__ */ ((r) => (r.Inline = "inline", r.Trigger = "trigger", r))(et || {}), he = Object.defineProperty, de = Object.getOwnPropertyDescriptor, pe = (r, t, e, s) => {
1118
- for (var i = s > 1 ? void 0 : s ? de(t, e) : t, n = r.length - 1, o; n >= 0; n--)
1119
- (o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
1120
- return s && i && he(t, e, i), i;
1121
- };
1122
- class st extends $ {
1123
- constructor() {
1124
- super(...arguments), this.nodes = [], this.wrapperRef = Ct();
1125
- }
1126
- addChild(t) {
1127
- t.parent = this, this.nodes.push(t);
1128
- }
1129
- applyBranding() {
1130
- if (!this.wrapperRef.value)
1131
- return;
1132
- const t = this.application.settings;
1133
- t != null && t.branding && wt(t.branding, this.wrapperRef.value);
1134
- }
1135
- applyStyles() {
1136
- if (!this.wrapperRef.value)
1137
- return;
1138
- const t = this.application.styles(), e = this.wrapperRef.value;
1139
- Object.entries(t).forEach(([s, i]) => {
1140
- e.style.setProperty(`--${s}`, i);
1141
- });
1142
- }
1143
- firstUpdated(t) {
1144
- this.applyBranding(), this.applyStyles();
1145
- }
1146
- render() {
1147
- return this.application.renderStrategy === et.Trigger && this.renderRoot.host.classList.add("floating"), f`<div class="widget-container" ${St(this.wrapperRef)}>
1148
- ${le(this.nodes, (t) => t)}
1149
- </div>`;
1150
- }
1151
- }
1152
- st.styles = P`
1153
- :host {
1154
- --font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
1155
- --spacing-xs: 0.2rem;
1156
- --spacing-sm: 0.5rem;
1157
- --spacing-md: 1rem;
1158
- --spacing-lg: 1.2rem;
1159
- --spacing-xl: 1.8rem;
1160
-
1161
- --text-color: #222222;
1162
- --link-color: #990ae3;
1163
- --gray-color: #f3f3f8;
1164
- --gray-dark-color: #a6a6a6;
1165
-
1166
- --box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
1167
- --border-radius: var(--spacing-sm);
1168
- --border-radius-sm: var(--spacing-sm);
1169
- --gap: var(--spacing-sm);
1170
- }
1171
- :host {
1172
- --voca-rem-multiplier: 0.625;
1173
- box-sizing: border-box;
1174
- display: block;
1175
- }
1176
-
1177
- :host(.inline) {
1178
- height: 100%;
1179
- position: fixed;
1180
- inset: 0 0 0 0;
1181
- }
1182
-
1183
- :host(.floating) {
1184
- z-index: 6;
1185
- position: fixed;
1186
- }
1187
- @media screen and (max-width: 800px) {
1188
- :host(.floating) {
1189
- inset: 0 0 95px 0;
1190
- }
1191
- }
1192
- @media screen and (min-width: 801px) {
1193
- :host(.floating) {
1194
- inset: auto 20px 95px auto;
1195
- max-height: calc(100vh - 120px);
1196
- width: 400px;
1197
- height: 700px;
1198
- }
1199
- }
1200
-
1201
- :host(.floating) .widget-container {
1202
- box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
1203
- border-radius: 0.7rem;
1204
- }
1205
-
1206
- * {
1207
- box-sizing: border-box;
1208
- }
1209
- .widget-container {
1210
- height: 100%;
1211
- background-color: var(--primary-background);
1212
- padding: var(--spacing-sm);
1213
- border: var(--widget-border, none);
1214
- }
1215
- @keyframes slideDown {
1216
- from {
1217
- transform: translateY(0);
1218
- opacity: 1;
1219
- }
1220
- to {
1221
- transform: translateY(100%);
1222
- opacity: 0;
1223
- }
1224
- }
1225
- @keyframes slideUp {
1226
- from {
1227
- transform: translateY(100%);
1228
- opacity: 0;
1229
- }
1230
- to {
1231
- transform: translateY(0);
1232
- opacity: 1;
1233
- }
1234
- }
1235
- :host(.expanded) {
1236
- opacity: 1;
1237
- animation: slideUp 0.3s linear;
1238
- }
1239
- :host(.hidden) {
1240
- opacity: 0;
1241
- animation: slideDown 0.3s linear;
1242
- }
1243
- `;
1244
- pe([
1245
- g({ attribute: !1 })
1246
- ], st.prototype, "application", 2);
1247
- var ue = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, it = (r, t, e, s) => {
1248
- for (var i = s > 1 ? void 0 : s ? ge(t, e) : t, n = r.length - 1, o; n >= 0; n--)
1249
- (o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
1250
- return s && i && ue(t, e, i), i;
1251
- };
1252
- class B extends $ {
1253
- constructor() {
1254
- super(), this.status = "deactivated", this.addEventListener("environment-created", this.onEnvironmentCreated);
1255
- }
1256
- async connectedCallback() {
1257
- super.connectedCallback(), await this.getGlobalEnvironment();
1258
- }
1259
- disconnectedCallback() {
1260
- super.disconnectedCallback(), this.removeEventListener("environment-created", this.onEnvironmentCreated);
1261
- }
1262
- async onEnvironmentCreated(t) {
1263
- this.widget = t.detail.widget, await this.activate(), this.requestUpdate();
1264
- }
1265
- async activate() {
1266
- this.widget && (await this.widget.activate(), this.status = "activated");
1267
- }
1268
- async getGlobalEnvironment() {
1269
- const t = globalThis.widgets;
1270
- t && (this.widget = t.applications.find(
1271
- (e) => e.name === this.name
1272
- ), await this.activate());
1273
- }
1274
- render() {
1275
- if (!this.widget || this.status !== "activated")
1276
- return l;
1277
- if (this.widget.renderStrategy === et.Trigger) {
1278
- const t = new v();
1279
- return t.application = this.widget, t;
1280
- }
1281
- return this.widget.render();
1282
- }
1283
- }
1284
- B.styles = [
1285
- P`
1286
- :host {
1287
- display: block;
1288
- }
1289
- `
1290
- ];
1291
- it([
1292
- g({ attribute: !0 })
1293
- ], B.prototype, "name", 2);
1294
- it([
1295
- T()
1296
- ], B.prototype, "widget", 2);
1297
- it([
1298
- T()
1299
- ], B.prototype, "status", 2);
1300
- customElements.get("ace-trigger") || customElements.define("ace-trigger", v);
1301
- customElements.get("ace-unresolved-component") || customElements.define("ace-unresolved-component", Tt);
1302
- customElements.get("ace-wrapper") || customElements.define("ace-wrapper", st);
1303
- customElements.get("ace-widget") || customElements.define("ace-widget", B);
1304
- const Ot = Pt($);
1305
- class fe extends Ot {
1306
- render() {
1307
- var n;
1308
- const t = this.application.branding(), e = (n = t == null ? void 0 : t.graphics) == null ? void 0 : n.logotype, i = this.application.texts.get("widget-header.header", "ACE Widget");
1309
- return f` <div class="widget-header">
1310
- <!-- <telia-icon svg={aiRobot.svg} size="lg"></telia-icon> -->
1311
- ${e ? f` <img src=${e} class="logotype" alt="" />` : l}
1312
-
1313
- <div>
1314
- <h1>${i}</h1>
1315
-
1316
- ${this.properties.tagline ? f`<p>${this.properties.tagline}</p>` : l}
1317
- </div>
1318
- </div>`;
1319
- }
1320
- }
1321
- fe.styles = [
1322
- Ot.styles || [],
1323
- P`
1324
- :host {
1325
- --header-text-color: var(--text-on-primary-background);
1326
- }
1327
-
1328
- img {
1329
- max-width: 140px;
1330
- max-height: 80%;
1331
- }
1332
-
1333
- .widget-header {
1334
- background-color: transparent;
1335
- color: var(--header-text-color);
1336
- height: 69px;
1337
- display: flex;
1338
- gap: var(--spacing-md);
1339
- flex-direction: row;
1340
- align-items: center;
1341
- border-radius: var(--spacing-sm) var(--spacing-sm) 0px 0px;
1342
- padding: 0 var(--spacing-md);
1343
- }
1344
-
1345
- h1 {
1346
- font-size: 1.2rem;
1347
- }
1348
-
1349
- h1,
1350
- p {
1351
- margin: 0;
1352
- padding: 0;
1353
- }
1354
- `
1355
- ];
1356
- export {
1357
- fe as WidgetHeader,
1358
- fe as default
1359
- };