@telia-ace/widget-components-copyright-flamingo 1.1.7-rc.0 → 1.1.7

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,41 +1,22 @@
1
- import { p as y, P as w, h as P, i as _, n as x, t as p, E as f, m as z, x as M, s as L } from "./index-7a32537b.mjs";
1
+ import { p as _, P as z, h as P, i as g, n as x, r as l, E as f, m as M, x as L, s as V } from "./index-0f2db61c.mjs";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
6
  */
7
- const V = (o) => (t) => typeof t == "function" ? ((c, e) => (customElements.define(c, e), e))(o, t) : ((c, e) => {
8
- const { kind: s, elements: i } = e;
9
- return { kind: s, elements: i, finisher(n) {
10
- customElements.define(c, n);
11
- } };
12
- })(o, t);
13
- /**
14
- * @license
15
- * Copyright 2017 Google LLC
16
- * SPDX-License-Identifier: BSD-3-Clause
17
- */
18
- const H = ({ finisher: o, descriptor: t }) => (c, e) => {
19
- var s;
20
- if (e === void 0) {
21
- const i = (s = c.originalKey) !== null && s !== void 0 ? s : c.key, n = t != null ? { kind: "method", placement: "prototype", key: i, descriptor: t(c.key) } : { ...c, key: i };
22
- return o != null && (n.finisher = function(r) {
23
- o(r, i);
24
- }), n;
25
- }
26
- {
27
- const i = c.constructor;
28
- t !== void 0 && Object.defineProperty(c, e, t(e)), o == null || o(i, e);
29
- }
7
+ const H = (i) => (t, c) => {
8
+ c !== void 0 ? c.addInitializer(() => {
9
+ customElements.define(i, t);
10
+ }) : customElements.define(i, t);
30
11
  };
31
12
  /**
32
13
  * @license
33
14
  * Copyright 2021 Google LLC
34
15
  * SPDX-License-Identifier: BSD-3-Clause
35
16
  */
36
- let g = class extends Event {
37
- constructor(t, c, e) {
38
- super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.callback = c, this.subscribe = e != null && e;
17
+ let C = class extends Event {
18
+ constructor(t, c, s) {
19
+ super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.callback = c, this.subscribe = s ?? !1;
39
20
  }
40
21
  };
41
22
  /**
@@ -48,16 +29,15 @@ let g = class extends Event {
48
29
  * Copyright 2021 Google LLC
49
30
  * SPDX-License-Identifier: BSD-3-Clause
50
31
  */
51
- let k = class {
52
- constructor(t, c, e, s) {
53
- var i;
54
- if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (n, r) => {
55
- this.unsubscribe && (this.unsubscribe !== r && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = n, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(n, r)), this.unsubscribe = r;
32
+ let y = class {
33
+ constructor(t, c, s, e) {
34
+ if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, n) => {
35
+ this.unsubscribe && (this.unsubscribe !== n && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, n)), this.unsubscribe = n;
56
36
  }, this.host = t, c.context !== void 0) {
57
- const n = c;
58
- this.context = n.context, this.callback = n.callback, this.subscribe = (i = n.subscribe) !== null && i !== void 0 && i;
37
+ const o = c;
38
+ this.context = o.context, this.callback = o.callback, this.subscribe = o.subscribe ?? !1;
59
39
  } else
60
- this.context = c, this.callback = e, this.subscribe = s != null && s;
40
+ this.context = c, this.callback = s, this.subscribe = e ?? !1;
61
41
  this.host.addController(this);
62
42
  }
63
43
  hostConnected() {
@@ -67,7 +47,7 @@ let k = class {
67
47
  this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
68
48
  }
69
49
  dispatchRequest() {
70
- this.host.dispatchEvent(new g(this.context, this.t, this.subscribe));
50
+ this.host.dispatchEvent(new C(this.context, this.t, this.subscribe));
71
51
  }
72
52
  };
73
53
  /**
@@ -76,12 +56,6 @@ let k = class {
76
56
  * SPDX-License-Identifier: BSD-3-Clause
77
57
  */
78
58
  class D {
79
- constructor(t) {
80
- this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
81
- for (const [c, { disposer: e }] of this.subscriptions)
82
- c(this.o, e);
83
- }, t !== void 0 && (this.value = t);
84
- }
85
59
  get value() {
86
60
  return this.o;
87
61
  }
@@ -89,17 +63,23 @@ class D {
89
63
  this.setValue(t);
90
64
  }
91
65
  setValue(t, c = !1) {
92
- const e = c || !Object.is(t, this.o);
93
- this.o = t, e && this.updateObservers();
66
+ const s = c || !Object.is(t, this.o);
67
+ this.o = t, s && this.updateObservers();
68
+ }
69
+ constructor(t) {
70
+ this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
71
+ for (const [c, { disposer: s }] of this.subscriptions)
72
+ c(this.o, s);
73
+ }, t !== void 0 && (this.value = t);
94
74
  }
95
- addCallback(t, c, e) {
96
- if (!e)
75
+ addCallback(t, c, s) {
76
+ if (!s)
97
77
  return void t(this.value);
98
78
  this.subscriptions.has(t) || this.subscriptions.set(t, { disposer: () => {
99
79
  this.subscriptions.delete(t);
100
80
  }, consumerHost: c });
101
- const { disposer: s } = this.subscriptions.get(t);
102
- t(this.value, s);
81
+ const { disposer: e } = this.subscriptions.get(t);
82
+ t(this.value, e);
103
83
  }
104
84
  clearCallbacks() {
105
85
  this.subscriptions.clear();
@@ -116,18 +96,18 @@ class E extends Event {
116
96
  }
117
97
  }
118
98
  class d extends D {
119
- constructor(t, c, e) {
120
- super(c.context !== void 0 ? c.initialValue : e), this.onContextRequest = (s) => {
121
- const i = s.composedPath()[0];
122
- s.context === this.context && i !== this.host && (s.stopPropagation(), this.addCallback(s.callback, i, s.subscribe));
123
- }, this.onProviderRequest = (s) => {
124
- const i = s.composedPath()[0];
125
- if (s.context !== this.context || i === this.host)
99
+ constructor(t, c, s) {
100
+ super(c.context !== void 0 ? c.initialValue : s), this.onContextRequest = (e) => {
101
+ const o = e.composedPath()[0];
102
+ e.context === this.context && o !== this.host && (e.stopPropagation(), this.addCallback(e.callback, o, e.subscribe));
103
+ }, this.onProviderRequest = (e) => {
104
+ const o = e.composedPath()[0];
105
+ if (e.context !== this.context || o === this.host)
126
106
  return;
127
107
  const n = /* @__PURE__ */ new Set();
128
- for (const [r, { consumerHost: v }] of this.subscriptions)
129
- n.has(r) || (n.add(r), v.dispatchEvent(new g(this.context, r, !0)));
130
- s.stopPropagation();
108
+ for (const [a, { consumerHost: b }] of this.subscriptions)
109
+ n.has(a) || (n.add(a), b.dispatchEvent(new C(this.context, a, !0)));
110
+ e.stopPropagation();
131
111
  }, this.host = t, c.context !== void 0 ? this.context = c.context : this.context = c, this.attachListeners(), this.host.addController(this);
132
112
  }
133
113
  attachListeners() {
@@ -142,17 +122,21 @@ class d extends D {
142
122
  * Copyright 2022 Google LLC
143
123
  * SPDX-License-Identifier: BSD-3-Clause
144
124
  */
145
- function O({ context: o, subscribe: t }) {
146
- return H({ finisher: (c, e) => {
147
- c.addInitializer((s) => {
148
- new k(s, { context: o, callback: (i) => {
149
- s[e] = i;
125
+ function O({ context: i, subscribe: t }) {
126
+ return (c, s) => {
127
+ typeof s == "object" ? s.addInitializer(function() {
128
+ new y(this, { context: i, callback: (e) => {
129
+ this[s.name] = e;
130
+ }, subscribe: t });
131
+ }) : c.constructor.addInitializer((e) => {
132
+ new y(e, { context: i, callback: (o) => {
133
+ e[s] = o;
150
134
  }, subscribe: t });
151
135
  });
152
- } });
136
+ };
153
137
  }
154
- const $ = "children", R = "descriptor", q = "container", j = "context", F = "layout", I = "properties";
155
- class N {
138
+ const k = "children", R = "descriptor", q = "container", $ = "context", j = "layout", F = "properties";
139
+ class I {
156
140
  constructor(t) {
157
141
  (this.host = t).addController(this);
158
142
  }
@@ -169,76 +153,76 @@ class N {
169
153
  async dispatch(t, c) {
170
154
  if (!this._container || !this._descriptor)
171
155
  return;
172
- const e = await y.getInstance(
156
+ const s = await _.getInstance(
173
157
  this._container
174
- ), s = new w(e).withId(
158
+ ), e = new z(s).withId(
175
159
  this._descriptor.id
176
160
  );
177
- await e.actions(
178
- s,
161
+ await s.actions(
162
+ e,
179
163
  this._descriptor.type || P()
180
164
  ).dispatch(t, c);
181
165
  }
182
166
  }
183
- const A = (o) => {
167
+ const N = (i) => {
184
168
  const t = {};
185
- return Object.keys(o).forEach((c) => {
186
- c.indexOf("css-") > -1 && (t[c] = o[c]);
169
+ return Object.keys(i).forEach((c) => {
170
+ c.indexOf("css-") > -1 && (t[c] = i[c]);
187
171
  }), t;
188
- }, S = (o, t) => {
189
- const c = A(t);
190
- Object.entries(c).forEach(([e, s]) => {
191
- o.style.setProperty(e.replace("css-", ""), s);
172
+ }, A = (i, t) => {
173
+ const c = N(t);
174
+ Object.entries(c).forEach(([s, e]) => {
175
+ i.style.setProperty(s.replace("css-", ""), e);
192
176
  });
193
177
  };
194
- var W = Object.defineProperty, B = Object.getOwnPropertyDescriptor, a = (o, t, c, e) => {
195
- for (var s = e > 1 ? void 0 : e ? B(t, c) : t, i = o.length - 1, n; i >= 0; i--)
196
- (n = o[i]) && (s = (e ? n(t, c, s) : n(s)) || s);
197
- return e && s && W(t, c, s), s;
178
+ var S = Object.defineProperty, W = Object.getOwnPropertyDescriptor, h = (i, t, c, s) => {
179
+ for (var e = s > 1 ? void 0 : s ? W(t, c) : t, o = i.length - 1, n; o >= 0; o--)
180
+ (n = i[o]) && (e = (s ? n(t, c, e) : n(e)) || e);
181
+ return s && e && S(t, c, e), e;
198
182
  };
199
- const K = (o) => {
200
- class t extends o {
183
+ const B = (i) => {
184
+ class t extends i {
201
185
  constructor() {
202
186
  super(...arguments), this.entry = "", this._descriptorProvider = new d(
203
187
  this,
204
188
  R,
205
189
  void 0
206
- ), this._childrenProvider = new d(this, $, []), this._propertiesProvider = new d(this, I, {}), this._contextProvider = new d(this, j, {}), this._layoutProvider = new d(this, F, {}), this.actions = new N(this), this.context = {}, this.layout = {}, this.properties = {};
190
+ ), this._childrenProvider = new d(this, k, []), this._propertiesProvider = new d(this, F, {}), this._contextProvider = new d(this, $, {}), this._layoutProvider = new d(this, j, {}), this.actions = new I(this), this.context = {}, this.layout = {}, this.properties = {};
207
191
  }
208
192
  connectedCallback() {
209
- super.connectedCallback(), this.container && (this.actions.setContainer(this.container), y.getInstance(this.container).then(
210
- async (e) => {
211
- var i, n;
212
- const s = e.nodes.get(this.entry);
213
- if (s) {
214
- this._propertyChangeListener = e.events.subscribe(
193
+ super.connectedCallback(), this.container && (this.actions.setContainer(this.container), _.getInstance(this.container).then(
194
+ async (s) => {
195
+ var o, n;
196
+ const e = s.nodes.get(this.entry);
197
+ if (e) {
198
+ this._propertyChangeListener = s.events.subscribe(
215
199
  "components:properties-changed",
216
- (l, h) => {
217
- s.id === h.node.id && this._setProperties(h.node.attributes.properties);
200
+ (p, r) => {
201
+ e.id === r.node.id && this._setProperties(r.node.attributes.properties);
218
202
  }
219
- ), this._contextChangeListener = e.events.subscribe(
203
+ ), this._contextChangeListener = s.events.subscribe(
220
204
  "components:context-changed",
221
- (l, h) => {
222
- s.id === h.node.id && this._setContext(h.node.attributes.context);
205
+ (p, r) => {
206
+ e.id === r.node.id && this._setContext(r.node.attributes.context);
223
207
  }
224
- ), this._layoutChangeListener = e.events.subscribe(
208
+ ), this._layoutChangeListener = s.events.subscribe(
225
209
  "components:layout-changed",
226
- (l, h) => {
227
- s.id === h.node.id && this._setLayout(h.node.attributes.layout);
210
+ (p, r) => {
211
+ e.id === r.node.id && this._setLayout(r.node.attributes.layout);
228
212
  }
229
213
  );
230
- const r = "default";
231
- this._unmountNode = s.mount(this.container), this._setDescriptor(f(s, r)), this._setProperties(s.attributes.properties), this._setContext(s.attributes.context), this._setLayout(this.layout);
232
- const v = s.getChildren(r).map((l) => f(l));
233
- this._childrenProvider.setValue(v);
234
- const m = await this.container.getAsync("componentResolver");
235
- if (((i = this.descriptor) == null ? void 0 : i.type) === "area")
214
+ const a = "default";
215
+ this._unmountNode = e.mount(this.container), this._setDescriptor(f(e, a)), this._setProperties(e.attributes.properties), this._setContext(e.attributes.context), this._setLayout(this.layout);
216
+ const b = e.getChildren(a).map((p) => f(p));
217
+ this._childrenProvider.setValue(b);
218
+ const w = await this.container.getAsync("componentResolver");
219
+ if (((o = this.descriptor) == null ? void 0 : o.type) === "area")
236
220
  return;
237
- const b = m.getComponent(
221
+ const v = w.getComponent(
238
222
  ((n = this.descriptor) == null ? void 0 : n.type) || ""
239
223
  );
240
- b.then && b.then((l) => {
241
- this.component = l.default;
224
+ v.then && v.then((p) => {
225
+ this.component = p.default;
242
226
  });
243
227
  }
244
228
  }
@@ -248,27 +232,27 @@ const K = (o) => {
248
232
  super.disconnectedCallback(), this._propertyChangeListener && this._propertyChangeListener(), this._contextChangeListener && this._contextChangeListener(), this._layoutChangeListener && this._layoutChangeListener(), this._unmountNode && this._unmountNode();
249
233
  }
250
234
  updated() {
251
- this.container && this.actions.setContainer(this.container), z(this.context, this.renderRoot.host), this.renderRoot.host.style.setProperty(
235
+ this.container && this.actions.setContainer(this.container), M(this.context, this.renderRoot.host), this.renderRoot.host.style.setProperty(
252
236
  "--width",
253
237
  this.layout.size === "full" ? "var(--columns, 1)" : `min(${this.layout.size || "var(--columns)"}, var(--columns))`
254
- ), S(this.renderRoot.host, this.properties);
238
+ ), A(this.renderRoot.host, this.properties);
255
239
  }
256
- _setProperties(e) {
257
- this._propertiesProvider.setValue(e), this.properties = e;
240
+ _setProperties(s) {
241
+ this._propertiesProvider.setValue(s), this.properties = s;
258
242
  }
259
- _setContext(e) {
260
- this._contextProvider.setValue(e), this.context = e;
243
+ _setContext(s) {
244
+ this._contextProvider.setValue(s), this.context = s;
261
245
  }
262
- _setLayout(e) {
263
- this._layoutProvider.setValue(e), this.layout = e;
246
+ _setLayout(s) {
247
+ this._layoutProvider.setValue(s), this.layout = s;
264
248
  }
265
- _setDescriptor(e) {
266
- this.descriptor = e, this._descriptorProvider.setValue(e), this.actions.setDescriptor(e);
249
+ _setDescriptor(s) {
250
+ this.descriptor = s, this._descriptorProvider.setValue(s), this.actions.setDescriptor(s);
267
251
  }
268
252
  }
269
253
  return t.styles = [
270
- o.styles ?? [],
271
- _`
254
+ i.styles ?? [],
255
+ g`
272
256
  :host {
273
257
  font-family: var(--font-family);
274
258
  grid-column: span var(--width);
@@ -281,32 +265,32 @@ const K = (o) => {
281
265
  box-sizing: border-box;
282
266
  }
283
267
  `
284
- ], a([
268
+ ], h([
285
269
  O({ context: q }),
286
270
  x({ attribute: !1 })
287
- ], t.prototype, "container", 2), a([
271
+ ], t.prototype, "container", 2), h([
288
272
  x()
289
- ], t.prototype, "entry", 2), a([
290
- p()
291
- ], t.prototype, "descriptor", 2), a([
292
- p()
293
- ], t.prototype, "component", 2), a([
294
- p()
295
- ], t.prototype, "context", 2), a([
296
- p()
297
- ], t.prototype, "layout", 2), a([
298
- p()
273
+ ], t.prototype, "entry", 2), h([
274
+ l()
275
+ ], t.prototype, "descriptor", 2), h([
276
+ l()
277
+ ], t.prototype, "component", 2), h([
278
+ l()
279
+ ], t.prototype, "context", 2), h([
280
+ l()
281
+ ], t.prototype, "layout", 2), h([
282
+ l()
299
283
  ], t.prototype, "properties", 2), t;
300
284
  };
301
- var T = Object.defineProperty, U = Object.getOwnPropertyDescriptor, G = (o, t, c, e) => {
302
- for (var s = e > 1 ? void 0 : e ? U(t, c) : t, i = o.length - 1, n; i >= 0; i--)
303
- (n = o[i]) && (s = (e ? n(t, c, s) : n(s)) || s);
304
- return e && s && T(t, c, s), s;
285
+ var T = Object.defineProperty, U = Object.getOwnPropertyDescriptor, G = (i, t, c, s) => {
286
+ for (var e = s > 1 ? void 0 : s ? U(t, c) : t, o = i.length - 1, n; o >= 0; o--)
287
+ (n = i[o]) && (e = (s ? n(t, c, e) : n(e)) || e);
288
+ return s && e && T(t, c, e), e;
305
289
  };
306
- const C = K(L);
307
- let u = class extends C {
290
+ const m = B(V);
291
+ let u = class extends m {
308
292
  render() {
309
- return M` <div class="copyright">
293
+ return L` <div class="copyright">
310
294
  <a
311
295
  aria-label="Powered by Telia ACE"
312
296
  href="https://ace-showcase.com/marketplace/ace-knowledge/"
@@ -423,8 +407,8 @@ let u = class extends C {
423
407
  }
424
408
  };
425
409
  u.styles = [
426
- C.styles || [],
427
- _`
410
+ m.styles || [],
411
+ g`
428
412
  .copyright {
429
413
  padding: var(--spacing-md);
430
414
  box-shadow: 1px 0px 10px rgba(0, 0, 0, 0.1);
@@ -454,10 +438,10 @@ u.styles = [
454
438
  `
455
439
  ];
456
440
  u = G([
457
- V("ace-copyright")
441
+ H("ace-copyright")
458
442
  ], u);
459
- const Y = u;
443
+ const X = u;
460
444
  export {
461
445
  u as CopyrightComponent,
462
- Y as default
446
+ X as default
463
447
  };
@@ -1,16 +1,12 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-c2c5bd73.js");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-07ac5583.js");/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const f=i=>t=>typeof t=="function"?((c,e)=>(customElements.define(c,e),e))(i,t):((c,e)=>{const{kind:s,elements:o}=e;return{kind:s,elements:o,finisher(n){customElements.define(c,n)}}})(i,t);/**
6
- * @license
7
- * Copyright 2017 Google LLC
8
- * SPDX-License-Identifier: BSD-3-Clause
9
- */const C=({finisher:i,descriptor:t})=>(c,e)=>{var s;if(e===void 0){const o=(s=c.originalKey)!==null&&s!==void 0?s:c.key,n=t!=null?{kind:"method",placement:"prototype",key:o,descriptor:t(c.key)}:{...c,key:o};return i!=null&&(n.finisher=function(h){i(h,o)}),n}{const o=c.constructor;t!==void 0&&Object.defineProperty(c,e,t(e)),i==null||i(o,e)}};/**
5
+ */const C=i=>(t,c)=>{c!==void 0?c.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};/**
10
6
  * @license
11
7
  * Copyright 2021 Google LLC
12
8
  * SPDX-License-Identifier: BSD-3-Clause
13
- */let b=class extends Event{constructor(t,c,e){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=c,this.subscribe=e!=null&&e}};/**
9
+ */let x=class extends Event{constructor(t,c,e){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=c,this.subscribe=e??!1}};/**
14
10
  * @license
15
11
  * Copyright 2021 Google LLC
16
12
  * SPDX-License-Identifier: BSD-3-Clause
@@ -18,19 +14,19 @@
18
14
  * @license
19
15
  * Copyright 2021 Google LLC
20
16
  * SPDX-License-Identifier: BSD-3-Clause
21
- */let g=class{constructor(t,c,e,s){var o;if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(n,h)=>{this.unsubscribe&&(this.unsubscribe!==h&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=n,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(n,h)),this.unsubscribe=h},this.host=t,c.context!==void 0){const n=c;this.context=n.context,this.callback=n.callback,this.subscribe=(o=n.subscribe)!==null&&o!==void 0&&o}else this.context=c,this.callback=e,this.subscribe=s!=null&&s;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new b(this.context,this.t,this.subscribe))}};/**
17
+ */let v=class{constructor(t,c,e,s){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(o,r)=>{this.unsubscribe&&(this.unsubscribe!==r&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=o,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(o,r)),this.unsubscribe=r},this.host=t,c.context!==void 0){const o=c;this.context=o.context,this.callback=o.callback,this.subscribe=o.subscribe??!1}else this.context=c,this.callback=e,this.subscribe=s??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new x(this.context,this.t,this.subscribe))}};/**
22
18
  * @license
23
19
  * Copyright 2021 Google LLC
24
20
  * SPDX-License-Identifier: BSD-3-Clause
25
- */class _{constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[c,{disposer:e}]of this.subscriptions)c(this.o,e)},t!==void 0&&(this.value=t)}get value(){return this.o}set value(t){this.setValue(t)}setValue(t,c=!1){const e=c||!Object.is(t,this.o);this.o=t,e&&this.updateObservers()}addCallback(t,c,e){if(!e)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:c});const{disposer:s}=this.subscriptions.get(t);t(this.value,s)}clearCallbacks(){this.subscriptions.clear()}}/**
21
+ */class g{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,c=!1){const e=c||!Object.is(t,this.o);this.o=t,e&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[c,{disposer:e}]of this.subscriptions)c(this.o,e)},t!==void 0&&(this.value=t)}addCallback(t,c,e){if(!e)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:c});const{disposer:s}=this.subscriptions.get(t);t(this.value,s)}clearCallbacks(){this.subscriptions.clear()}}/**
26
22
  * @license
27
23
  * Copyright 2021 Google LLC
28
24
  * SPDX-License-Identifier: BSD-3-Clause
29
- */class m extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}}class d extends _{constructor(t,c,e){super(c.context!==void 0?c.initialValue:e),this.onContextRequest=s=>{const o=s.composedPath()[0];s.context===this.context&&o!==this.host&&(s.stopPropagation(),this.addCallback(s.callback,o,s.subscribe))},this.onProviderRequest=s=>{const o=s.composedPath()[0];if(s.context!==this.context||o===this.host)return;const n=new Set;for(const[h,{consumerHost:u}]of this.subscriptions)n.has(h)||(n.add(h),u.dispatchEvent(new b(this.context,h,!0)));s.stopPropagation()},this.host=t,c.context!==void 0?this.context=c.context:this.context=c,this.attachListeners(),this.host.addController(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new m(this.context))}}/**
25
+ */class _ extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}}class d extends g{constructor(t,c,e){super(c.context!==void 0?c.initialValue:e),this.onContextRequest=s=>{const o=s.composedPath()[0];s.context===this.context&&o!==this.host&&(s.stopPropagation(),this.addCallback(s.callback,o,s.subscribe))},this.onProviderRequest=s=>{const o=s.composedPath()[0];if(s.context!==this.context||o===this.host)return;const r=new Set;for(const[p,{consumerHost:u}]of this.subscriptions)r.has(p)||(r.add(p),u.dispatchEvent(new x(this.context,p,!0)));s.stopPropagation()},this.host=t,c.context!==void 0?this.context=c.context:this.context=c,this.attachListeners(),this.host.addController(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new _(this.context))}}/**
30
26
  * @license
31
27
  * Copyright 2022 Google LLC
32
28
  * SPDX-License-Identifier: BSD-3-Clause
33
- */function w({context:i,subscribe:t}){return C({finisher:(c,e)=>{c.addInitializer(s=>{new g(s,{context:i,callback:o=>{s[e]=o},subscribe:t})})}})}const P="children",z="descriptor",M="container",L="context",V="layout",H="properties";class k{constructor(t){(this.host=t).addController(this)}hostConnected(){}hostDisconnected(){}setDescriptor(t){this._descriptor=t}setContainer(t){this._container=t}async dispatch(t,c){if(!this._container||!this._descriptor)return;const e=await r.pt.getInstance(this._container),s=new r.P(e).withId(this._descriptor.id);await e.actions(s,this._descriptor.type||r.ht()).dispatch(t,c)}}const D=i=>{const t={};return Object.keys(i).forEach(c=>{c.indexOf("css-")>-1&&(t[c]=i[c])}),t},O=(i,t)=>{const c=D(t);Object.entries(c).forEach(([e,s])=>{i.style.setProperty(e.replace("css-",""),s)})};var E=Object.defineProperty,q=Object.getOwnPropertyDescriptor,p=(i,t,c,e)=>{for(var s=e>1?void 0:e?q(t,c):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,c,s):n(s))||s);return e&&s&&E(t,c,s),s};const R=i=>{class t extends i{constructor(){super(...arguments),this.entry="",this._descriptorProvider=new d(this,z,void 0),this._childrenProvider=new d(this,P,[]),this._propertiesProvider=new d(this,H,{}),this._contextProvider=new d(this,L,{}),this._layoutProvider=new d(this,V,{}),this.actions=new k(this),this.context={},this.layout={},this.properties={}}connectedCallback(){super.connectedCallback(),this.container&&(this.actions.setContainer(this.container),r.pt.getInstance(this.container).then(async e=>{var o,n;const s=e.nodes.get(this.entry);if(s){this._propertyChangeListener=e.events.subscribe("components:properties-changed",(l,a)=>{s.id===a.node.id&&this._setProperties(a.node.attributes.properties)}),this._contextChangeListener=e.events.subscribe("components:context-changed",(l,a)=>{s.id===a.node.id&&this._setContext(a.node.attributes.context)}),this._layoutChangeListener=e.events.subscribe("components:layout-changed",(l,a)=>{s.id===a.node.id&&this._setLayout(a.node.attributes.layout)});const h="default";this._unmountNode=s.mount(this.container),this._setDescriptor(r.Et(s,h)),this._setProperties(s.attributes.properties),this._setContext(s.attributes.context),this._setLayout(this.layout);const u=s.getChildren(h).map(l=>r.Et(l));this._childrenProvider.setValue(u);const y=await this.container.getAsync("componentResolver");if(((o=this.descriptor)==null?void 0:o.type)==="area")return;const v=y.getComponent(((n=this.descriptor)==null?void 0:n.type)||"");v.then&&v.then(l=>{this.component=l.default})}}))}disconnectedCallback(){super.disconnectedCallback(),this._propertyChangeListener&&this._propertyChangeListener(),this._contextChangeListener&&this._contextChangeListener(),this._layoutChangeListener&&this._layoutChangeListener(),this._unmountNode&&this._unmountNode()}updated(){this.container&&this.actions.setContainer(this.container),r.mapBranding(this.context,this.renderRoot.host),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),O(this.renderRoot.host,this.properties)}_setProperties(e){this._propertiesProvider.setValue(e),this.properties=e}_setContext(e){this._contextProvider.setValue(e),this.context=e}_setLayout(e){this._layoutProvider.setValue(e),this.layout=e}_setDescriptor(e){this.descriptor=e,this._descriptorProvider.setValue(e),this.actions.setDescriptor(e)}}return t.styles=[i.styles??[],r.i`
29
+ */function m({context:i,subscribe:t}){return(c,e)=>{typeof e=="object"?e.addInitializer(function(){new v(this,{context:i,callback:s=>{this[e.name]=s},subscribe:t})}):c.constructor.addInitializer(s=>{new v(s,{context:i,callback:o=>{s[e]=o},subscribe:t})})}}const w="children",z="descriptor",P="container",M="context",L="layout",V="properties";class H{constructor(t){(this.host=t).addController(this)}hostConnected(){}hostDisconnected(){}setDescriptor(t){this._descriptor=t}setContainer(t){this._container=t}async dispatch(t,c){if(!this._container||!this._descriptor)return;const e=await n.pt.getInstance(this._container),s=new n.P(e).withId(this._descriptor.id);await e.actions(s,this._descriptor.type||n.ht()).dispatch(t,c)}}const D=i=>{const t={};return Object.keys(i).forEach(c=>{c.indexOf("css-")>-1&&(t[c]=i[c])}),t},E=(i,t)=>{const c=D(t);Object.entries(c).forEach(([e,s])=>{i.style.setProperty(e.replace("css-",""),s)})};var O=Object.defineProperty,k=Object.getOwnPropertyDescriptor,a=(i,t,c,e)=>{for(var s=e>1?void 0:e?k(t,c):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(s=(e?r(t,c,s):r(s))||s);return e&&s&&O(t,c,s),s};const q=i=>{class t extends i{constructor(){super(...arguments),this.entry="",this._descriptorProvider=new d(this,z,void 0),this._childrenProvider=new d(this,w,[]),this._propertiesProvider=new d(this,V,{}),this._contextProvider=new d(this,M,{}),this._layoutProvider=new d(this,L,{}),this.actions=new H(this),this.context={},this.layout={},this.properties={}}connectedCallback(){super.connectedCallback(),this.container&&(this.actions.setContainer(this.container),n.pt.getInstance(this.container).then(async e=>{var o,r;const s=e.nodes.get(this.entry);if(s){this._propertyChangeListener=e.events.subscribe("components:properties-changed",(l,h)=>{s.id===h.node.id&&this._setProperties(h.node.attributes.properties)}),this._contextChangeListener=e.events.subscribe("components:context-changed",(l,h)=>{s.id===h.node.id&&this._setContext(h.node.attributes.context)}),this._layoutChangeListener=e.events.subscribe("components:layout-changed",(l,h)=>{s.id===h.node.id&&this._setLayout(h.node.attributes.layout)});const p="default";this._unmountNode=s.mount(this.container),this._setDescriptor(n.Et(s,p)),this._setProperties(s.attributes.properties),this._setContext(s.attributes.context),this._setLayout(this.layout);const u=s.getChildren(p).map(l=>n.Et(l));this._childrenProvider.setValue(u);const f=await this.container.getAsync("componentResolver");if(((o=this.descriptor)==null?void 0:o.type)==="area")return;const b=f.getComponent(((r=this.descriptor)==null?void 0:r.type)||"");b.then&&b.then(l=>{this.component=l.default})}}))}disconnectedCallback(){super.disconnectedCallback(),this._propertyChangeListener&&this._propertyChangeListener(),this._contextChangeListener&&this._contextChangeListener(),this._layoutChangeListener&&this._layoutChangeListener(),this._unmountNode&&this._unmountNode()}updated(){this.container&&this.actions.setContainer(this.container),n.mapBranding(this.context,this.renderRoot.host),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),E(this.renderRoot.host,this.properties)}_setProperties(e){this._propertiesProvider.setValue(e),this.properties=e}_setContext(e){this._contextProvider.setValue(e),this.context=e}_setLayout(e){this._layoutProvider.setValue(e),this.layout=e}_setDescriptor(e){this.descriptor=e,this._descriptorProvider.setValue(e),this.actions.setDescriptor(e)}}return t.styles=[i.styles??[],n.i`
34
30
  :host {
35
31
  font-family: var(--font-family);
36
32
  grid-column: span var(--width);
@@ -42,7 +38,7 @@
42
38
  * {
43
39
  box-sizing: border-box;
44
40
  }
45
- `],p([w({context:M}),r.n({attribute:!1})],t.prototype,"container",2),p([r.n()],t.prototype,"entry",2),p([r.t()],t.prototype,"descriptor",2),p([r.t()],t.prototype,"component",2),p([r.t()],t.prototype,"context",2),p([r.t()],t.prototype,"layout",2),p([r.t()],t.prototype,"properties",2),t};var j=Object.defineProperty,F=Object.getOwnPropertyDescriptor,$=(i,t,c,e)=>{for(var s=e>1?void 0:e?F(t,c):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,c,s):n(s))||s);return e&&s&&j(t,c,s),s};const x=R(r.s);exports.CopyrightComponent=class extends x{render(){return r.x` <div class="copyright">
41
+ `],a([m({context:P}),n.n({attribute:!1})],t.prototype,"container",2),a([n.n()],t.prototype,"entry",2),a([n.r()],t.prototype,"descriptor",2),a([n.r()],t.prototype,"component",2),a([n.r()],t.prototype,"context",2),a([n.r()],t.prototype,"layout",2),a([n.r()],t.prototype,"properties",2),t};var R=Object.defineProperty,j=Object.getOwnPropertyDescriptor,F=(i,t,c,e)=>{for(var s=e>1?void 0:e?j(t,c):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(s=(e?r(t,c,s):r(s))||s);return e&&s&&R(t,c,s),s};const y=q(n.s);exports.CopyrightComponent=class extends y{render(){return n.x` <div class="copyright">
46
42
  <a
47
43
  aria-label="Powered by Telia ACE"
48
44
  href="https://ace-showcase.com/marketplace/ace-knowledge/"
@@ -155,7 +151,7 @@
155
151
  </g>
156
152
  </svg>
157
153
  </a>
158
- </div>`}};exports.CopyrightComponent.styles=[x.styles||[],r.i`
154
+ </div>`}};exports.CopyrightComponent.styles=[y.styles||[],n.i`
159
155
  .copyright {
160
156
  padding: var(--spacing-md);
161
157
  box-shadow: 1px 0px 10px rgba(0, 0, 0, 0.1);
@@ -182,4 +178,4 @@
182
178
  path {
183
179
  fill: white;
184
180
  }
185
- `];exports.CopyrightComponent=$([f("ace-copyright")],exports.CopyrightComponent);const S=exports.CopyrightComponent;exports.default=S;
181
+ `];exports.CopyrightComponent=F([C("ace-copyright")],exports.CopyrightComponent);const I=exports.CopyrightComponent;exports.default=I;