@telia-ace/widget-runtime-flamingo 1.1.111-rc.0 → 1.1.111-rc.2

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,73 +1,73 @@
1
- import { i as L, t as D, e as A, E as _, r as P, a as z, c as E, b as M, m as N, o as f, x as g, d as R, n as T, f as u, T as v, W as j, g as W } from "./index-hvD4rZ3z.mjs";
1
+ import { i as L, t as D, e as P, E as _, r as A, a as z, c as E, b as M, m as j, o as f, x as m, d as R, n as N, f as u, T as w, W as T, g as W } from "./index-BpOmXqng.mjs";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
6
  */
7
- const S = (e) => (t, s) => {
7
+ const S = (t) => (e, s) => {
8
8
  s !== void 0 ? s.addInitializer(() => {
9
- customElements.define(e, t);
10
- }) : customElements.define(e, t);
9
+ customElements.define(t, e);
10
+ }) : customElements.define(t, e);
11
11
  };
12
12
  /**
13
13
  * @license
14
14
  * Copyright 2020 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- const I = (e) => e === null || typeof e != "object" && typeof e != "function", q = (e) => e.strings === void 0;
17
+ const I = (t) => t === null || typeof t != "object" && typeof t != "function", q = (t) => t.strings === void 0;
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
21
21
  * SPDX-License-Identifier: BSD-3-Clause
22
22
  */
23
- const p = (e, t) => {
23
+ const p = (t, e) => {
24
24
  var n;
25
- const s = e._$AN;
25
+ const s = t._$AN;
26
26
  if (s === void 0) return !1;
27
- for (const i of s) (n = i._$AO) == null || n.call(i, t, !1), p(i, t);
27
+ for (const i of s) (n = i._$AO) == null || n.call(i, e, !1), p(i, e);
28
28
  return !0;
29
- }, m = (e) => {
30
- let t, s;
29
+ }, g = (t) => {
30
+ let e, s;
31
31
  do {
32
- if ((t = e._$AM) === void 0) break;
33
- s = t._$AN, s.delete(e), e = t;
32
+ if ((e = t._$AM) === void 0) break;
33
+ s = e._$AN, s.delete(t), t = e;
34
34
  } while ((s == null ? void 0 : s.size) === 0);
35
- }, k = (e) => {
36
- for (let t; t = e._$AM; e = t) {
37
- let s = t._$AN;
38
- if (s === void 0) t._$AN = s = /* @__PURE__ */ new Set();
39
- else if (s.has(e)) break;
40
- s.add(e), X(t);
35
+ }, Y = (t) => {
36
+ for (let e; e = t._$AM; t = e) {
37
+ let s = e._$AN;
38
+ if (s === void 0) e._$AN = s = /* @__PURE__ */ new Set();
39
+ else if (s.has(t)) break;
40
+ s.add(t), X(e);
41
41
  }
42
42
  };
43
- function H(e) {
44
- this._$AN !== void 0 ? (m(this), this._$AM = e, k(this)) : this._$AM = e;
43
+ function H(t) {
44
+ this._$AN !== void 0 ? (g(this), this._$AM = t, Y(this)) : this._$AM = t;
45
45
  }
46
- function K(e, t = !1, s = 0) {
46
+ function K(t, e = !1, s = 0) {
47
47
  const n = this._$AH, i = this._$AN;
48
- if (i !== void 0 && i.size !== 0) if (t) if (Array.isArray(n)) for (let r = s; r < n.length; r++) p(n[r], !1), m(n[r]);
49
- else n != null && (p(n, !1), m(n));
50
- else p(this, e);
48
+ if (i !== void 0 && i.size !== 0) if (e) if (Array.isArray(n)) for (let r = s; r < n.length; r++) p(n[r], !1), g(n[r]);
49
+ else n != null && (p(n, !1), g(n));
50
+ else p(this, t);
51
51
  }
52
- const X = (e) => {
53
- e.type == D.CHILD && (e._$AP ?? (e._$AP = K), e._$AQ ?? (e._$AQ = H));
52
+ const X = (t) => {
53
+ t.type == D.CHILD && (t._$AP ?? (t._$AP = K), t._$AQ ?? (t._$AQ = H));
54
54
  };
55
- class Y extends L {
55
+ class k extends L {
56
56
  constructor() {
57
57
  super(...arguments), this._$AN = void 0;
58
58
  }
59
- _$AT(t, s, n) {
60
- super._$AT(t, s, n), k(this), this.isConnected = t._$AU;
59
+ _$AT(e, s, n) {
60
+ super._$AT(e, s, n), Y(this), this.isConnected = e._$AU;
61
61
  }
62
- _$AO(t, s = !0) {
62
+ _$AO(e, s = !0) {
63
63
  var n, i;
64
- t !== this.isConnected && (this.isConnected = t, t ? (n = this.reconnected) == null || n.call(this) : (i = this.disconnected) == null || i.call(this)), s && (p(this, t), m(this));
64
+ e !== this.isConnected && (this.isConnected = e, e ? (n = this.reconnected) == null || n.call(this) : (i = this.disconnected) == null || i.call(this)), s && (p(this, e), g(this));
65
65
  }
66
- setValue(t) {
67
- if (q(this._$Ct)) this._$Ct._$AI(t, this);
66
+ setValue(e) {
67
+ if (q(this._$Ct)) this._$Ct._$AI(e, this);
68
68
  else {
69
69
  const s = [...this._$Ct._$AH];
70
- s[this._$Ci] = t, this._$Ct._$AI(s, this, 0);
70
+ s[this._$Ci] = e, this._$Ct._$AI(s, this, 0);
71
71
  }
72
72
  }
73
73
  disconnected() {
@@ -83,25 +83,25 @@ class Y extends L {
83
83
  const Z = () => new B();
84
84
  let B = class {
85
85
  };
86
- const b = /* @__PURE__ */ new WeakMap(), U = A(class extends Y {
87
- render(e) {
86
+ const $ = /* @__PURE__ */ new WeakMap(), U = P(class extends k {
87
+ render(t) {
88
88
  return _;
89
89
  }
90
- update(e, [t]) {
90
+ update(t, [e]) {
91
91
  var n;
92
- const s = t !== this.Y;
93
- return s && this.Y !== void 0 && this.rt(void 0), (s || this.lt !== this.ct) && (this.Y = t, this.ht = (n = e.options) == null ? void 0 : n.host, this.rt(this.ct = e.element)), _;
92
+ const s = e !== this.Y;
93
+ return s && this.Y !== void 0 && this.rt(void 0), (s || this.lt !== this.ct) && (this.Y = e, this.ht = (n = t.options) == null ? void 0 : n.host, this.rt(this.ct = t.element)), _;
94
94
  }
95
- rt(e) {
96
- if (this.isConnected || (e = void 0), typeof this.Y == "function") {
97
- const t = this.ht ?? globalThis;
98
- let s = b.get(t);
99
- s === void 0 && (s = /* @__PURE__ */ new WeakMap(), b.set(t, s)), s.get(this.Y) !== void 0 && this.Y.call(this.ht, void 0), s.set(this.Y, e), e !== void 0 && this.Y.call(this.ht, e);
100
- } else this.Y.value = e;
95
+ rt(t) {
96
+ if (this.isConnected || (t = void 0), typeof this.Y == "function") {
97
+ const e = this.ht ?? globalThis;
98
+ let s = $.get(e);
99
+ s === void 0 && (s = /* @__PURE__ */ new WeakMap(), $.set(e, s)), s.get(this.Y) !== void 0 && this.Y.call(this.ht, void 0), s.set(this.Y, t), t !== void 0 && this.Y.call(this.ht, t);
100
+ } else this.Y.value = t;
101
101
  }
102
102
  get lt() {
103
- var e, t;
104
- return typeof this.Y == "function" ? (e = b.get(this.ht ?? globalThis)) == null ? void 0 : e.get(this.Y) : (t = this.Y) == null ? void 0 : t.value;
103
+ var t, e;
104
+ return typeof this.Y == "function" ? (t = $.get(this.ht ?? globalThis)) == null ? void 0 : t.get(this.Y) : (e = this.Y) == null ? void 0 : e.value;
105
105
  }
106
106
  disconnected() {
107
107
  this.lt === this.ct && this.rt(void 0);
@@ -109,46 +109,46 @@ const b = /* @__PURE__ */ new WeakMap(), U = A(class extends Y {
109
109
  reconnected() {
110
110
  this.rt(this.ct);
111
111
  }
112
- }), V = async (e) => await e.get("$widget").invoke("renderState"), F = async (e, t) => {
113
- const s = e.get("$widget");
114
- return (await e.getAsync(
112
+ }), V = async (t) => await t.get("$widget").invoke("renderState"), F = async (t, e) => {
113
+ const s = t.get("$widget");
114
+ return (await t.getAsync(
115
115
  "actionResolver"
116
- )).subscribe(s.name, t);
117
- }, G = (e, t, s = !1) => {
118
- const n = e.reduce(
119
- (o, { breakpoints: a = [], values: h }) => a.length ? t.some((y) => a.includes(y)) ? { ...o, ...h } : o : { ...o, ...h },
116
+ )).subscribe(s.name, e);
117
+ }, G = (t, e, s = !1) => {
118
+ const n = t.reduce(
119
+ (o, { breakpoints: a = [], values: h }) => a.length ? e.some((v) => a.includes(v)) ? { ...o, ...h } : o : { ...o, ...h },
120
120
  {}
121
121
  ), i = {}, r = n.type;
122
122
  return i.height = n.height || "", i.width = n.width || "", n.type === "floating" || n.type === "inline" && s && (i.height = "calc(100vh - 120px)"), { type: r, styles: i };
123
123
  };
124
- var Q = Object.defineProperty, J = Object.getOwnPropertyDescriptor, d = (e, t, s, n) => {
125
- for (var i = n > 1 ? void 0 : n ? J(t, s) : t, r = e.length - 1, o; r >= 0; r--)
126
- (o = e[r]) && (i = (n ? o(t, s, i) : o(i)) || i);
127
- return n && i && Q(t, s, i), i;
124
+ var Q = Object.defineProperty, J = Object.getOwnPropertyDescriptor, l = (t, e, s, n) => {
125
+ for (var i = n > 1 ? void 0 : n ? J(e, s) : e, r = t.length - 1, o; r >= 0; r--)
126
+ (o = t[r]) && (i = (n ? o(e, s, i) : o(i)) || i);
127
+ return n && i && Q(e, s, i), i;
128
128
  };
129
- let c = class extends P {
129
+ let c = class extends A {
130
130
  constructor() {
131
131
  super(), this._provider = new z(this, E, void 0), this.wrapperRef = Z(), this.breakpoints = [], this.breakpointsSet = !1;
132
132
  }
133
133
  connectedCallback() {
134
- super.connectedCallback(), this._provider.setValue(this.container), this.container && (V(this.container).then((e) => {
135
- this.renderState = e;
136
- }), F(this.container, (e, t) => {
137
- switch (t) {
134
+ super.connectedCallback(), this._provider.setValue(this.container), this.container && (V(this.container).then((t) => {
135
+ this.renderState = t;
136
+ }), F(this.container, (t, e) => {
137
+ switch (e) {
138
138
  case "close":
139
139
  case "open":
140
- this.renderState = t === "open" ? f.open : f.closed;
140
+ this.renderState = e === "open" ? f.open : f.closed;
141
141
  break;
142
142
  case "hide":
143
143
  this.renderState = f.hidden;
144
144
  }
145
- }).then((e) => {
146
- this._unsubscribeRenderState = e;
145
+ }).then((t) => {
146
+ this._unsubscribeRenderState = t;
147
147
  }), M.getInstance(this.container).then(
148
- (e) => {
149
- this.componentPlatform = e, this.breakpoints = this.componentPlatform.breakpoints, this.breakpointsSet = !0, this._unsubscribePropChange = this.componentPlatform.events.subscribe(
148
+ (t) => {
149
+ this.componentPlatform = t, this.breakpoints = this.componentPlatform.breakpoints, this.breakpointsSet = !0, this._unsubscribePropChange = this.componentPlatform.events.subscribe(
150
150
  "components:properties-changed",
151
- (t, s) => {
151
+ (e, s) => {
152
152
  var n, i;
153
153
  ((n = s == null ? void 0 : s.node) == null ? void 0 : n.type) === "root" && (this.breakpoints = (i = this.componentPlatform) != null && i.breakpoints ? [...this.componentPlatform.breakpoints] : []);
154
154
  }
@@ -160,15 +160,15 @@ let c = class extends P {
160
160
  super.disconnectedCallback(), this._unsubscribeRenderState && this._unsubscribeRenderState(), this._unsubscribePropChange && this._unsubscribePropChange();
161
161
  }
162
162
  applyBranding() {
163
- var e;
163
+ var t;
164
164
  if (this.wrapperRef.value) {
165
- const t = (e = this.container) == null ? void 0 : e.get("$settings");
166
- t != null && t.branding && N(t.branding, this.wrapperRef.value);
165
+ const e = (t = this.container) == null ? void 0 : t.get("$settings");
166
+ e != null && e.branding && j(e.branding, this.wrapperRef.value);
167
167
  }
168
168
  }
169
169
  render() {
170
- var t, s, n, i;
171
- let e;
170
+ var e, s, n, i;
171
+ let t;
172
172
  if (!this.entry || !this.breakpointsSet)
173
173
  return _;
174
174
  if (this.container && this.renderState) {
@@ -177,15 +177,15 @@ let c = class extends P {
177
177
  }
178
178
  if (this.container) {
179
179
  const r = this.container.get("$settings");
180
- r != null && r.layout && (e = G(
180
+ r != null && r.layout && (t = G(
181
181
  r.layout,
182
182
  this.breakpoints,
183
183
  !!r.trigger
184
- ), e.type === "floating" ? (this.renderRoot.host.classList.add("floating"), this.renderRoot.host.classList.remove("inline")) : (this.renderRoot.host.classList.add("inline"), this.renderRoot.host.classList.remove("floating")), Object.entries(e.styles).forEach(([o, a]) => {
184
+ ), t.type === "floating" ? (this.renderRoot.host.classList.add("floating"), this.renderRoot.host.classList.remove("inline")) : (this.renderRoot.host.classList.add("inline"), this.renderRoot.host.classList.remove("floating")), Object.entries(t.styles).forEach(([o, a]) => {
185
185
  this.renderRoot.host.style.setProperty(o, a);
186
186
  }));
187
187
  }
188
- return this.renderState && (this.renderState === f.hidden ? ((t = this.wrapperRef.value) == null || t.classList.add("hidden"), (s = this.wrapperRef.value) == null || s.classList.remove("expanded")) : ((n = this.wrapperRef.value) == null || n.classList.remove("hidden"), (i = this.wrapperRef.value) == null || i.classList.add("expanded"))), this.applyBranding(), g`
188
+ return this.renderState && (this.renderState === f.hidden ? ((e = this.wrapperRef.value) == null || e.classList.add("hidden"), (s = this.wrapperRef.value) == null || s.classList.remove("expanded")) : ((n = this.wrapperRef.value) == null || n.classList.remove("hidden"), (i = this.wrapperRef.value) == null || i.classList.add("expanded"))), this.applyBranding(), m`
189
189
  <div class="widget-container" ${U(this.wrapperRef)}>
190
190
  <ace-area entry=${this.entry}></ace-area>
191
191
  </div>
@@ -271,25 +271,25 @@ c.styles = R`
271
271
  }
272
272
  }
273
273
  `;
274
- d([
275
- T({ attribute: !1 })
274
+ l([
275
+ N({ attribute: !1 })
276
276
  ], c.prototype, "container", 2);
277
- d([
277
+ l([
278
278
  u()
279
279
  ], c.prototype, "componentPlatform", 2);
280
- d([
280
+ l([
281
281
  u()
282
282
  ], c.prototype, "renderState", 2);
283
- d([
283
+ l([
284
284
  u()
285
285
  ], c.prototype, "breakpoints", 2);
286
- d([
286
+ l([
287
287
  u()
288
288
  ], c.prototype, "breakpointsSet", 2);
289
- d([
289
+ l([
290
290
  u()
291
291
  ], c.prototype, "entry", 2);
292
- c = d([
292
+ c = l([
293
293
  S("ace-widget-wrapper")
294
294
  ], c);
295
295
  /**
@@ -297,21 +297,21 @@ c = d([
297
297
  * Copyright 2021 Google LLC
298
298
  * SPDX-License-Identifier: BSD-3-Clause
299
299
  */
300
- class ee {
301
- constructor(t) {
302
- this.Y = t;
300
+ class tt {
301
+ constructor(e) {
302
+ this.Y = e;
303
303
  }
304
304
  disconnect() {
305
305
  this.Y = void 0;
306
306
  }
307
- reconnect(t) {
308
- this.Y = t;
307
+ reconnect(e) {
308
+ this.Y = e;
309
309
  }
310
310
  deref() {
311
311
  return this.Y;
312
312
  }
313
313
  }
314
- class te {
314
+ class et {
315
315
  constructor() {
316
316
  this.Z = void 0, this.q = void 0;
317
317
  }
@@ -319,11 +319,11 @@ class te {
319
319
  return this.Z;
320
320
  }
321
321
  pause() {
322
- this.Z ?? (this.Z = new Promise((t) => this.q = t));
322
+ this.Z ?? (this.Z = new Promise((e) => this.q = e));
323
323
  }
324
324
  resume() {
325
- var t;
326
- (t = this.q) == null || t.call(this), this.Z = this.q = void 0;
325
+ var e;
326
+ (e = this.q) == null || e.call(this), this.Z = this.q = void 0;
327
327
  }
328
328
  }
329
329
  /**
@@ -331,15 +331,15 @@ class te {
331
331
  * Copyright 2017 Google LLC
332
332
  * SPDX-License-Identifier: BSD-3-Clause
333
333
  */
334
- const C = (e) => !I(e) && typeof e.then == "function", x = 1073741823;
335
- class se extends Y {
334
+ const C = (t) => !I(t) && typeof t.then == "function", x = 1073741823;
335
+ class st extends k {
336
336
  constructor() {
337
- super(...arguments), this._$Cwt = x, this._$Cbt = [], this._$CK = new ee(this), this._$CX = new te();
337
+ super(...arguments), this._$Cwt = x, this._$Cbt = [], this._$CK = new tt(this), this._$CX = new et();
338
338
  }
339
- render(...t) {
340
- return t.find((s) => !C(s)) ?? v;
339
+ render(...e) {
340
+ return e.find((s) => !C(s)) ?? w;
341
341
  }
342
- update(t, s) {
342
+ update(e, s) {
343
343
  const n = this._$Cbt;
344
344
  let i = n.length;
345
345
  this._$Cbt = s;
@@ -348,16 +348,16 @@ class se extends Y {
348
348
  for (let a = 0; a < s.length && !(a > this._$Cwt); a++) {
349
349
  const h = s[a];
350
350
  if (!C(h)) return this._$Cwt = a, h;
351
- a < i && h === n[a] || (this._$Cwt = x, i = 0, Promise.resolve(h).then(async (y) => {
351
+ a < i && h === n[a] || (this._$Cwt = x, i = 0, Promise.resolve(h).then(async (v) => {
352
352
  for (; o.get(); ) await o.get();
353
- const l = r.deref();
354
- if (l !== void 0) {
355
- const $ = l._$Cbt.indexOf(h);
356
- $ > -1 && $ < l._$Cwt && (l._$Cwt = $, l.setValue(y));
353
+ const d = r.deref();
354
+ if (d !== void 0) {
355
+ const y = d._$Cbt.indexOf(h);
356
+ y > -1 && y < d._$Cwt && (d._$Cwt = y, d.setValue(v));
357
357
  }
358
358
  }));
359
359
  }
360
- return v;
360
+ return w;
361
361
  }
362
362
  disconnected() {
363
363
  this._$CK.disconnect(), this._$CX.pause();
@@ -366,49 +366,49 @@ class se extends Y {
366
366
  this._$CK.reconnect(this), this._$CX.resume();
367
367
  }
368
368
  }
369
- const ne = A(se);
370
- var ie = Object.getOwnPropertyDescriptor, re = (e, t, s, n) => {
371
- for (var i = n > 1 ? void 0 : n ? ie(t, s) : t, r = e.length - 1, o; r >= 0; r--)
372
- (o = e[r]) && (i = o(i) || i);
373
- return i;
369
+ const nt = P(st);
370
+ var it = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, ot = (t, e, s, n) => {
371
+ for (var i = n > 1 ? void 0 : n ? rt(e, s) : e, r = t.length - 1, o; r >= 0; r--)
372
+ (o = t[r]) && (i = (n ? o(e, s, i) : o(i)) || i);
373
+ return n && i && it(e, s, i), i;
374
374
  };
375
- const O = j(P);
376
- let w = class extends O {
375
+ const O = T(A);
376
+ let b = class extends O {
377
377
  constructor() {
378
- super(...arguments), this._resolveChildComponent = async (e) => {
378
+ super(...arguments), this._resolveChildComponent = async (t) => {
379
379
  const s = (await this.container.getAsync(
380
380
  "componentResolver"
381
- )).getComponent(e);
381
+ )).getComponent(t);
382
382
  if (s.then)
383
383
  return s.then((n) => n.default);
384
- }, this._resolveAllChildren = async (e) => Promise.all(
385
- e.map(async (t) => {
386
- let s = customElements.get(`ace-${t.type}`);
387
- return s || (s = await this._resolveChildComponent(t.type || "")), {
388
- ...t,
384
+ }, this._resolveAllChildren = async (t) => Promise.all(
385
+ t.map(async (e) => {
386
+ let s = customElements.get(`ace-${e.type}`);
387
+ return s || (s = await this._resolveChildComponent(e.type || "")), {
388
+ ...e,
389
389
  component: s
390
390
  };
391
391
  })
392
392
  );
393
393
  }
394
394
  render() {
395
- var e;
395
+ var t;
396
396
  return this.renderRoot.host.style.setProperty(
397
397
  "--width",
398
398
  this.layout.size === "full" ? "var(--columns, 1)" : `min(${this.layout.size || "var(--columns)"}, var(--columns))`
399
399
  ), this.renderRoot.host.style.setProperty(
400
400
  "--columns",
401
- ((e = this._propertiesProvider.value.columns) == null ? void 0 : e.toString()) || "1"
401
+ ((t = this._propertiesProvider.value.columns) == null ? void 0 : t.toString()) || "1"
402
402
  ), W(
403
403
  this.renderRoot.host,
404
404
  this._propertiesProvider.value
405
- ), g`
406
- ${ne(
405
+ ), m`
406
+ ${nt(
407
407
  this._resolveAllChildren(this._childrenProvider.value).then(
408
- (t) => g`
409
- ${t.map((s) => {
408
+ (e) => m`
409
+ ${e.map((s) => {
410
410
  if (s.type === "area")
411
- return g`<ace-area entry=${s.id}></ace-area>`;
411
+ return m`<ace-area entry=${s.id}></ace-area>`;
412
412
  const n = new s.component();
413
413
  return n.entry = s.id, n;
414
414
  })}
@@ -418,7 +418,7 @@ let w = class extends O {
418
418
  `;
419
419
  }
420
420
  };
421
- w.styles = [
421
+ b.styles = [
422
422
  O.styles || [],
423
423
  R`
424
424
  :host {
@@ -431,13 +431,13 @@ w.styles = [
431
431
  }
432
432
  `
433
433
  ];
434
- w = re([
434
+ b = ot([
435
435
  S("ace-area")
436
- ], w);
437
- const ce = (e, t) => {
436
+ ], b);
437
+ const ht = (t, e) => {
438
438
  const s = new c();
439
- s.container = e, t.appendChild(s);
439
+ s.container = t, e.appendChild(s);
440
440
  };
441
441
  export {
442
- ce as default
442
+ ht as default
443
443
  };