@telia-ace/widget-types-grid 1.0.30-experimental.2 → 1.0.30-experimental.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,56 +1,72 @@
1
- var we = Object.defineProperty, ve = Object.defineProperties;
2
- var Ee = Object.getOwnPropertyDescriptors;
3
- var W = Object.getOwnPropertySymbols;
4
- var oe = Object.prototype.hasOwnProperty, re = Object.prototype.propertyIsEnumerable;
5
- var ie = (t, e, n) => e in t ? we(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, p = (t, e) => {
1
+ var ve = Object.defineProperty, Ee = Object.defineProperties;
2
+ var Ce = Object.getOwnPropertyDescriptors;
3
+ var G = Object.getOwnPropertySymbols;
4
+ var re = Object.prototype.hasOwnProperty, ae = Object.prototype.propertyIsEnumerable;
5
+ var ie = (t, e, n) => e in t ? ve(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, p = (t, e) => {
6
6
  for (var n in e || (e = {}))
7
- oe.call(e, n) && ie(t, n, e[n]);
8
- if (W)
9
- for (var n of W(e))
10
- re.call(e, n) && ie(t, n, e[n]);
7
+ re.call(e, n) && ie(t, n, e[n]);
8
+ if (G)
9
+ for (var n of G(e))
10
+ ae.call(e, n) && ie(t, n, e[n]);
11
11
  return t;
12
- }, C = (t, e) => ve(t, Ee(e));
13
- var N = (t, e) => {
12
+ }, C = (t, e) => Ee(t, Ce(e));
13
+ var M = (t, e) => {
14
14
  var n = {};
15
- for (var s in t)
16
- oe.call(t, s) && e.indexOf(s) < 0 && (n[s] = t[s]);
17
- if (t != null && W)
18
- for (var s of W(t))
19
- e.indexOf(s) < 0 && re.call(t, s) && (n[s] = t[s]);
15
+ for (var o in t)
16
+ re.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
17
+ if (t != null && G)
18
+ for (var o of G(t))
19
+ e.indexOf(o) < 0 && ae.call(t, o) && (n[o] = t[o]);
20
20
  return n;
21
21
  };
22
- import { Grid as ue, useRouteData as Ce, useRouter as Oe, useProperties as de, useContext as X, useContainer as T, useComponentNode as ee, useScroll as he, transitionComposer as Se, paddedBorderTabStyle as Ae, useComponent as De, useComponentDescriptor as xe, filterCssPropsStyle as Me, Typography as Ne, useComponentPlatform as me, useIsMounted as $e, useColumns as Le, useLayout as ke, ComponentNodeContext as Pe, ComponentPropertyContext as Re, filterCssProps as Ve } from "@telia-ace/widget-ui";
23
- import h, { useState as z, forwardRef as pe, useMemo as _e, Suspense as Ie, useEffect as B } from "react";
24
- import { css as fe, ThemeProvider as ze, useTheme as Be } from "@emotion/react";
25
- import { asDescriptor as ae, ComponentPlatform as Te, createComponentModel as je, ComponentQuery as Ge, WidgetRenderState as O } from "@telia-ace/widget-core";
26
- import P from "@emotion/styled";
27
- import { appendClassNames as K, notifyDataLoaded as We, lock as q, removeNullAndUndefinedValues as ce, uuid as Fe } from "@telia-ace/widget-utilities";
28
- import { TransitionGroup as He, Transition as Ke } from "react-transition-group";
29
- import { Switch as Ue, Route as Q } from "react-router";
30
- import { onWidgetUrl as Ye } from "@telia-ace/widget-routing";
31
- import { readStorage as $, StorageMedium as v, createStorageWriter as V, StorageCategory as _, StorageScope as qe } from "@telia-ace/widget-services";
32
- import { supportBootstrapping as Qe } from "@webprovisions/bootstrapping";
33
- import { WidgetState as Ze, WidgetType as Je } from "@webprovisions/platform";
34
- var J = /* @__PURE__ */ ((t) => (t.back = "back", t.forth = "forth", t))(J || {});
35
- const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[t] > n[e] ? "back" : "forth", et = ({ views: t, location: e, render: n }) => /* @__PURE__ */ h.createElement(
36
- Ue,
22
+ var ce = (t, e, n) => new Promise((o, s) => {
23
+ var i = (a) => {
24
+ try {
25
+ c(n.next(a));
26
+ } catch (l) {
27
+ s(l);
28
+ }
29
+ }, r = (a) => {
30
+ try {
31
+ c(n.throw(a));
32
+ } catch (l) {
33
+ s(l);
34
+ }
35
+ }, c = (a) => a.done ? o(a.value) : Promise.resolve(a.value).then(i, r);
36
+ c((n = n.apply(t, e)).next());
37
+ });
38
+ import { Grid as de, useRouteData as Oe, useRouter as Se, useProperties as he, useContext as ee, useContainer as B, useComponentNode as te, useScroll as me, transitionComposer as Ae, paddedBorderTabStyle as $e, useComponent as xe, useComponentDescriptor as De, filterCssPropsStyle as Me, Typography as Ne, useComponentPlatform as pe, useIsMounted as Le, useColumns as Pe, useLayout as ke, ComponentNodeContext as Re, ComponentPropertyContext as Ve, filterCssProps as _e } from "@telia-ace/widget-ui";
39
+ import h, { useState as T, forwardRef as fe, useMemo as Ie, Suspense as Te, useEffect as z } from "react";
40
+ import { css as ge, ThemeProvider as ze, useTheme as Be } from "@emotion/react";
41
+ import { asDescriptor as J, ComponentPlatform as je, createComponentModel as Fe, ComponentQuery as Ge, WidgetRenderState as O } from "@telia-ace/widget-core";
42
+ import k from "@emotion/styled";
43
+ import { appendClassNames as K, notifyDataLoaded as We, lock as q, removeNullAndUndefinedValues as le, uuid as He } from "@telia-ace/widget-utilities";
44
+ import { TransitionGroup as Ke, Transition as Ue } from "react-transition-group";
45
+ import { Switch as Ye, Route as Q } from "react-router";
46
+ import { onWidgetUrl as qe } from "@telia-ace/widget-routing";
47
+ import { readStorage as N, StorageMedium as v, createStorageWriter as V, StorageCategory as _, StorageScope as Qe } from "@telia-ace/widget-services";
48
+ import { supportBootstrapping as Ze } from "@webprovisions/bootstrapping";
49
+ import { WidgetState as Je, WidgetType as Xe } from "@webprovisions/platform";
50
+ var X = /* @__PURE__ */ ((t) => (t.back = "back", t.forth = "forth", t))(X || {});
51
+ const et = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[t] > n[e] ? "back" : "forth", tt = ({ views: t, location: e, render: n }) => /* @__PURE__ */ h.createElement(
52
+ Ye,
37
53
  {
38
54
  location: e && C(p({}, e), {
39
55
  pathname: e.pathname.split("?")[0]
40
56
  })
41
57
  },
42
58
  [
43
- ...Object.keys(t).filter((s) => !!t[s].path),
44
- ...Object.keys(t).filter((s) => !t[s].path)
45
- ].map((s) => {
46
- const { path: i } = t[s];
47
- return i ? Array.isArray(i) ? i.map((o) => /* @__PURE__ */ h.createElement(Q, { key: s, exact: !0, path: o, render: () => n(s) })) : /* @__PURE__ */ h.createElement(Q, { key: s, exact: !0, path: i, render: () => n(s) }) : /* @__PURE__ */ h.createElement(Q, { key: s, render: () => n(s) });
59
+ ...Object.keys(t).filter((o) => !!t[o].path),
60
+ ...Object.keys(t).filter((o) => !t[o].path)
61
+ ].map((o) => {
62
+ const { path: s } = t[o];
63
+ return s ? Array.isArray(s) ? s.map((i) => /* @__PURE__ */ h.createElement(Q, { key: o, exact: !0, path: i, render: () => n(o) })) : /* @__PURE__ */ h.createElement(Q, { key: o, exact: !0, path: s, render: () => n(o) }) : /* @__PURE__ */ h.createElement(Q, { key: o, render: () => n(o) });
48
64
  })
49
- ), ge = et, tt = P.div`
65
+ ), ye = tt, nt = k.div`
50
66
  position: relative;
51
67
  width: 100%;
52
68
  flex: 1;
53
- `, nt = P(ue)`
69
+ `, ot = k(de)`
54
70
  position: absolute;
55
71
  left: 0;
56
72
  right: 0;
@@ -65,19 +81,19 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
65
81
  "contact-method": 6,
66
82
  conversation: 7
67
83
  }, it = (n) => {
68
- var s = n, { className: t = "" } = s, e = N(s, ["className"]);
69
- const [i, o] = z("index"), [r, c] = z(J.forth), a = Ce(), u = Oe(), d = de(), l = X(), f = T(), m = ee(), { gap: g = "0" } = l, G = d, { columns: b = 1, animation: y = "none", scrollable: E = !1 } = G, A = N(G, ["columns", "animation", "scrollable"]), [j, L] = he(E);
70
- if (!m || !u)
84
+ var o = n, { className: t = "" } = o, e = M(o, ["className"]);
85
+ const [s, i] = T("index"), [r, c] = T(X.forth), a = Oe(), l = Se(), d = he(), u = ee(), f = B(), m = te(), { gap: g = "0" } = u, F = d, { columns: b = 1, animation: y = "none", scrollable: E = !1 } = F, A = M(F, ["columns", "animation", "scrollable"]), [j, L] = me(E);
86
+ if (!m || !l)
71
87
  return null;
72
- const { location: se } = u;
73
- a.name !== i && a.name !== "" && y && (c(Xe(i, a.name, st)), o(a.name));
74
- const { views: D } = f.get("$settings");
75
- if (!Object.keys(D).length)
88
+ const { location: se } = l;
89
+ a.name !== s && a.name !== "" && y && (c(et(s, a.name, st)), i(a.name));
90
+ const { views: $ } = f.get("$settings");
91
+ if (!Object.keys($).length)
76
92
  return null;
77
- const x = (w, M, R) => {
78
- const S = Y(M, R), I = m.getChildren(w)[0];
93
+ const x = (w, D, R) => {
94
+ const S = Y(D, R), I = m.getChildren(w)[0];
79
95
  return /* @__PURE__ */ h.createElement(
80
- nt,
96
+ ot,
81
97
  C(p(C(p(p({}, e), A), {
82
98
  scrollableCss: j,
83
99
  ref: L,
@@ -86,72 +102,72 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
86
102
  }), S), {
87
103
  className: K(t, "humany-view")
88
104
  }),
89
- /* @__PURE__ */ h.createElement(te, { id: I.id, branch: "default" })
105
+ /* @__PURE__ */ h.createElement(ne, { id: I.id, branch: "default" })
90
106
  );
91
- }, Y = (w, M) => {
107
+ }, Y = (w, D) => {
92
108
  if (y === "slide" || y === "fade")
93
109
  return {
94
- animationCss: Se.composeViewTransition(
110
+ animationCss: Ae.composeViewTransition(
95
111
  w,
96
112
  y,
97
- M
113
+ D
98
114
  ),
99
115
  ["data-state"]: w
100
116
  };
101
117
  };
102
- return /* @__PURE__ */ h.createElement(tt, { className: "humany-animated-view" }, /* @__PURE__ */ h.createElement(
103
- He,
118
+ return /* @__PURE__ */ h.createElement(nt, { className: "humany-animated-view" }, /* @__PURE__ */ h.createElement(
119
+ Ke,
104
120
  {
105
121
  component: null,
106
122
  childFactory: (w) => h.cloneElement(w, { direction: r })
107
123
  },
108
124
  /* @__PURE__ */ h.createElement(
109
- Ke,
125
+ Ue,
110
126
  {
111
- key: i,
127
+ key: s,
112
128
  timeout: { enter: 500, exit: 500 },
113
129
  onEnter: (w) => w == null ? void 0 : w.clientHeight,
114
130
  unmountOnExit: !0,
115
- direction: J.forth
131
+ direction: X.forth
116
132
  },
117
- (w, { direction: M }) => /* @__PURE__ */ h.createElement(
118
- ge,
133
+ (w, { direction: D }) => /* @__PURE__ */ h.createElement(
134
+ ye,
119
135
  {
120
- views: D,
136
+ views: $,
121
137
  location: se,
122
- render: (R) => x(R, w, M)
138
+ render: (R) => x(R, w, D)
123
139
  }
124
140
  )
125
141
  )
126
142
  ));
127
- }, ot = it, rt = P(ue)`
143
+ }, rt = it, at = k(de)`
128
144
  ${(t) => !!t.scrollableCss && t.scrollableCss}
129
- `, at = (n) => {
130
- var s = n, { className: t = "" } = s, e = N(s, ["className"]);
131
- const i = de(), o = X(), r = T(), c = ee(), { views: a } = r.get("$settings"), { gap: u = "0" } = o, y = i, { columns: d = 1, animation: l = "none", scrollable: f = !1 } = y, m = N(y, ["columns", "animation", "scrollable"]), [g, b] = he(f);
145
+ `, ct = (n) => {
146
+ var o = n, { className: t = "" } = o, e = M(o, ["className"]);
147
+ const s = he(), i = ee(), r = B(), c = te(), { views: a } = r.get("$settings"), { gap: l = "0" } = i, y = s, { columns: d = 1, animation: u = "none", scrollable: f = !1 } = y, m = M(y, ["columns", "animation", "scrollable"]), [g, b] = me(f);
132
148
  return c ? /* @__PURE__ */ h.createElement(
133
- rt,
149
+ at,
134
150
  C(p(p({}, e), m), {
135
151
  scrollableCss: g,
136
152
  ref: b,
137
153
  columns: d,
138
- gap: u,
154
+ gap: l,
139
155
  className: K(t, "humany-view")
140
156
  }),
141
157
  /* @__PURE__ */ h.createElement(
142
- ge,
158
+ ye,
143
159
  {
144
160
  views: a,
145
161
  render: (E) => {
146
162
  const A = c.getChildren(E)[0];
147
- return /* @__PURE__ */ h.createElement(te, { id: A.id, node: A, branch: "default" });
163
+ return /* @__PURE__ */ h.createElement(ne, { id: A.id, node: A, branch: "default" });
148
164
  }
149
165
  }
150
166
  )
151
167
  ) : null;
152
- }, ct = at, U = (t) => {
168
+ }, lt = ct, U = (t) => {
153
169
  var e, n;
154
- return fe`
170
+ return ge`
155
171
  outline: none;
156
172
  box-sizing: border-box;
157
173
  * {
@@ -174,42 +190,42 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
174
190
  `}
175
191
 
176
192
  &:focus-visible {
177
- ${Ae(t)};
193
+ ${$e(t)};
178
194
  }
179
195
  `;
180
- }, lt = P(ct)`
196
+ }, ut = k(lt)`
181
197
  ${(t) => U(t)}
182
- `, ut = P(ot)`
198
+ `, dt = k(rt)`
183
199
  ${(t) => U(t)}
184
- `, dt = P.div`
200
+ `, ht = k.div`
185
201
  text-align: center;
186
202
  ${(t) => {
187
- var e, n, s;
188
- return typeof ((e = t.theme.colors) == null ? void 0 : e.warning) != "undefined" && fe`
203
+ var e, n, o;
204
+ return typeof ((e = t.theme.colors) == null ? void 0 : e.warning) != "undefined" && ge`
189
205
  color: ${(n = t.theme.colors) == null ? void 0 : n.warning};
190
- border: 2px dashed ${(s = t.theme.colors) == null ? void 0 : s.warning};
206
+ border: 2px dashed ${(o = t.theme.colors) == null ? void 0 : o.warning};
191
207
  `;
192
208
  }}
193
209
  ${(t) => typeof t.theme.borderRadius != "undefined" && `border-radius: ${t.theme.borderRadius};`}
194
210
  ${(t) => U(t)}
195
- `, ht = pe(
196
- (i, s) => {
197
- var o = i, { className: t = "", children: e } = o, n = N(o, ["className", "children"]);
198
- const r = De(), { name: c, type: a, id: u } = xe(), d = _e(() => r ? P(r)`
211
+ `, mt = fe(
212
+ (s, o) => {
213
+ var i = s, { className: t = "", children: e } = i, n = M(i, ["className", "children"]);
214
+ const r = xe(), { name: c, type: a, id: l } = De(), d = Ie(() => r ? k(r)`
199
215
  ${U}
200
216
  ${Me}
201
217
  ` : null, [r]);
202
218
  return typeof r == "undefined" ? null : r === null || d === null ? process.env.NODE_ENV !== "production" ? /* @__PURE__ */ h.createElement(
203
- dt,
219
+ ht,
204
220
  C(p({}, n), {
205
- title: `type: ${a}, definition-id: ${c}, instance-id: ${u}`,
221
+ title: `type: ${a}, definition-id: ${c}, instance-id: ${l}`,
206
222
  className: K(t, "humany-non-resolved-component")
207
223
  }),
208
224
  /* @__PURE__ */ h.createElement(Ne, { variant: "h5" }, "Non Resolved Component Type")
209
- ) : null : /* @__PURE__ */ h.createElement(Ie, { fallback: null }, /* @__PURE__ */ h.createElement(
225
+ ) : null : /* @__PURE__ */ h.createElement(Te, { fallback: null }, /* @__PURE__ */ h.createElement(
210
226
  d,
211
227
  C(p({
212
- ref: s
228
+ ref: o
213
229
  }, n), {
214
230
  className: K(
215
231
  t,
@@ -220,52 +236,52 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
220
236
  e
221
237
  ));
222
238
  }
223
- ), mt = ht, pt = (t) => {
224
- const e = ee(t), n = me(), [s, i] = z({}), o = $e();
225
- return B(() => {
226
- e && o.current && i(e.attributes.properties);
227
- }, [e, t, o]), B(() => {
239
+ ), pt = mt, ft = (t) => {
240
+ const e = te(t), n = pe(), [o, s] = T({}), i = Le();
241
+ return z(() => {
242
+ e && i.current && s(e.attributes.properties);
243
+ }, [e, t, i]), z(() => {
228
244
  if (n) {
229
245
  const r = n.events.subscribe(
230
246
  "components:properties-changed",
231
247
  (c, a) => {
232
- e === a.node && o.current && i(a.node.attributes.properties);
248
+ e === a.node && i.current && s(a.node.attributes.properties);
233
249
  }
234
250
  );
235
251
  return () => {
236
252
  r();
237
253
  };
238
254
  }
239
- }, [n, o, t, e]), s;
240
- }, ft = (t, e) => e ? !0 : typeof t == "string" ? t === "full" : t > 0, gt = pe(
241
- (u, a) => {
242
- var d = u, { className: t = "", id: e, branch: n, node: s, ariaLabel: i, tabIndex: o, context: r } = d, c = N(d, ["className", "id", "branch", "node", "ariaLabel", "tabIndex", "context"]);
243
- const l = me(), f = T(), [m, g] = z(), b = Le(), y = X(e), E = pt(e), { size: A = "none", indent: j = 0 } = ke(e), L = ft(A, s);
244
- if (B(() => {
245
- if (l) {
246
- if (e && !s) {
247
- const S = l.nodes.get(e);
248
- if (S && (g(ae(S, n)), L)) {
255
+ }, [n, i, t, e]), o;
256
+ }, gt = (t, e) => e ? !0 : typeof t == "string" ? t === "full" : t > 0, yt = fe(
257
+ (l, a) => {
258
+ var d = l, { className: t = "", id: e, branch: n, node: o, ariaLabel: s, tabIndex: i, context: r } = d, c = M(d, ["className", "id", "branch", "node", "ariaLabel", "tabIndex", "context"]);
259
+ const u = pe(), f = B(), [m, g] = T(), b = Pe(), y = ee(e), E = ft(e), { size: A = "none", indent: j = 0 } = ke(e), L = gt(A, o);
260
+ if (z(() => {
261
+ if (u) {
262
+ if (e && !o) {
263
+ const S = u.nodes.get(e);
264
+ if (S && (g(J(S, n)), L)) {
249
265
  const I = S.mount(f);
250
266
  return () => {
251
267
  I();
252
268
  };
253
269
  }
254
- } else if (s) {
255
- g(ae(s, n));
256
- const S = s.mount(f);
270
+ } else if (o) {
271
+ g(J(o, n));
272
+ const S = o.mount(f);
257
273
  return () => {
258
274
  S();
259
275
  };
260
276
  }
261
277
  }
262
- }, [l, e, s, L]), !m || !L)
278
+ }, [u, e, o, L]), !m || !L)
263
279
  return null;
264
280
  const R = p(p({}, y), r || {}), {
265
- cardinal: D,
281
+ cardinal: $,
266
282
  fonts: x = {},
267
283
  accessibility: Y = {}
268
- } = R, G = N(R, [
284
+ } = R, F = M(R, [
269
285
  "cardinal",
270
286
  "fonts",
271
287
  "accessibility"
@@ -277,35 +293,35 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
277
293
  medium: x.medium || "1.2em",
278
294
  large: x.large || "1.6em",
279
295
  huge: x.huge || "2.5em"
280
- }, M = C(p({}, G), {
296
+ }, D = C(p({}, F), {
281
297
  fonts: w,
282
298
  accessibility: p({}, Y)
283
299
  });
284
- return typeof D == "number" && (M.sizes = {
285
- cardinal: D,
286
- small: `${D}px`,
287
- normal: `${D * 3}px`,
288
- medium: `${D * 5}px`,
289
- large: `${D * 8}px`
290
- }), /* @__PURE__ */ h.createElement(ze, { theme: M }, /* @__PURE__ */ h.createElement(Pe.Provider, { value: m }, /* @__PURE__ */ h.createElement(Re.Provider, { value: E }, (() => {
300
+ return typeof $ == "number" && (D.sizes = {
301
+ cardinal: $,
302
+ small: `${$}px`,
303
+ normal: `${$ * 3}px`,
304
+ medium: `${$ * 5}px`,
305
+ large: `${$ * 8}px`
306
+ }), /* @__PURE__ */ h.createElement(ze, { theme: D }, /* @__PURE__ */ h.createElement(Re.Provider, { value: m }, /* @__PURE__ */ h.createElement(Ve.Provider, { value: E }, (() => {
291
307
  const S = p({
292
308
  "data-width": A === "full" ? b : Math.min(A, b),
293
309
  "data-indent": j,
294
310
  "data-name": m.name,
295
311
  "data-node-id": m.id,
296
312
  "data-component-type": m.type,
297
- "aria-label": i,
298
- tabIndex: o,
313
+ "aria-label": s,
314
+ tabIndex: i,
299
315
  id: m.id,
300
316
  role: E && E.role
301
317
  }, c);
302
318
  switch (m.type) {
303
319
  case "view":
304
- return typeof E.animation == "string" && E.animation !== "none" ? /* @__PURE__ */ h.createElement(ut, C(p({}, S), { className: t })) : /* @__PURE__ */ h.createElement(lt, C(p({}, S), { className: t }));
320
+ return typeof E.animation == "string" && E.animation !== "none" ? /* @__PURE__ */ h.createElement(dt, C(p({}, S), { className: t })) : /* @__PURE__ */ h.createElement(ut, C(p({}, S), { className: t }));
305
321
  default: {
306
- const I = Ve(E);
322
+ const I = _e(E);
307
323
  return /* @__PURE__ */ h.createElement(
308
- mt,
324
+ pt,
309
325
  C(p(p({
310
326
  ref: a
311
327
  }, S), I), {
@@ -316,52 +332,86 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
316
332
  }
317
333
  })())));
318
334
  }
319
- ), te = gt, yt = ({ builder: t }) => {
320
- const e = T(), [n, s] = z(null);
321
- return B(() => {
322
- e.getAsync("components").then((i) => t(i).then((o) => {
323
- s(o);
335
+ ), ne = yt, bt = ({ builder: t }) => {
336
+ const e = B(), [n, o] = T(null);
337
+ return z(() => {
338
+ e.getAsync("components").then((s) => t(s).then((i) => {
339
+ o(i);
324
340
  }));
325
- }, []), B(() => () => {
326
- n && e.getAsync("components").then((i) => {
327
- i.nodes.detached = i.nodes.detached.filter(
328
- (o) => o.id !== n.id
341
+ }, []), z(() => () => {
342
+ n && e.getAsync("components").then((s) => {
343
+ s.nodes.detached = s.nodes.detached.filter(
344
+ (i) => i.id !== n.id
329
345
  );
330
346
  });
331
- }, [n]), n ? /* @__PURE__ */ h.createElement(te, { id: n.id, node: n, branch: "default" }) : null;
332
- }, bt = yt, wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
347
+ }, [n]), n ? /* @__PURE__ */ h.createElement(ne, { id: n.id, node: n, branch: "default" }) : null;
348
+ }, wt = bt, vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
333
349
  __proto__: null,
334
- default: bt
335
- }, Symbol.toStringTag, { value: "Module" })), vt = h.lazy(() => Promise.resolve().then(() => wt)), Et = ({ showSearch: t = !1 }) => {
336
- const e = Be(), n = T();
350
+ default: wt
351
+ }, Symbol.toStringTag, { value: "Module" })), Et = h.lazy(() => Promise.resolve().then(() => vt)), Ct = ({ showSearch: t = !1 }) => {
352
+ const e = Be(), n = B();
337
353
  return /* @__PURE__ */ h.createElement(h.Suspense, { fallback: null }, /* @__PURE__ */ h.createElement(
338
- vt,
354
+ Et,
339
355
  {
340
- builder: (s) => n.get("settings").then((i) => {
341
- var u;
342
- const { properties: o, context: r } = Object.keys(i.components).reduce(
343
- (d, l) => (i.components[l].type === "not-found" && (d.properties = i.components[l].properties, d.context = i.components[l].context), d),
356
+ builder: (o) => n.get("settings").then((s) => {
357
+ var l;
358
+ const { properties: i, context: r } = Object.keys(s.components).reduce(
359
+ (d, u) => (s.components[u].type === "not-found" && (d.properties = s.components[u].properties, d.context = s.components[u].context), d),
344
360
  { properties: {}, context: {} }
345
361
  );
346
- o.showSearch = t;
347
- const c = s.createNode("area", { detached: !0 });
362
+ i.showSearch = t;
363
+ const c = o.createNode("area", { detached: !0 });
348
364
  if (c.name = "not-found-area", c.writeLayout({
349
365
  size: "full"
350
366
  }), t) {
351
- const d = Object.keys(i.components).reduce(
352
- (f, m) => i.components[m].type === "search" ? i.components[m].properties : f,
367
+ const d = Object.keys(s.components).reduce(
368
+ (f, m) => s.components[m].type === "search" ? s.components[m].properties : f,
353
369
  {}
354
- ), l = s.createNode("search", { detached: !0 });
355
- l.writeLayout({ size: "full" }), l.writeProperties(p({
356
- "css-margin-bottom": ((u = e == null ? void 0 : e.sizes) == null ? void 0 : u.normal) || "15px"
357
- }, d)), c.appendChild(l);
370
+ ), u = o.createNode("search", { detached: !0 });
371
+ u.writeLayout({ size: "full" }), u.writeProperties(p({
372
+ "css-margin-bottom": ((l = e == null ? void 0 : e.sizes) == null ? void 0 : l.normal) || "15px"
373
+ }, d)), c.appendChild(u);
358
374
  }
359
- const a = s.createNode("not-found", { detached: !0 });
360
- return a.writeLayout({ size: "full" }), a.writeProperties(o), a.writeContext(r), c.appendChild(a), c;
375
+ const a = o.createNode("not-found", { detached: !0 });
376
+ return a.writeLayout({ size: "full" }), a.writeProperties(i), a.writeContext(r), c.appendChild(a), c;
361
377
  })
362
378
  }
363
379
  ));
364
- }, Zt = Et, Ct = (t) => {
380
+ }, Xt = Ct, Ot = (t) => `w-${t}`, en = (t, e, n) => ce(void 0, null, function* () {
381
+ const o = n.nodes.get(t);
382
+ if (!e) {
383
+ console.warn("Could not find resolver. Make sure it is registered on the container.");
384
+ return;
385
+ }
386
+ if (!o) {
387
+ console.warn(`Unable to find node with id: ${t}`);
388
+ return;
389
+ }
390
+ const s = J(o);
391
+ if (!(s != null && s.type)) {
392
+ console.warn(`Could not get descriptor for: ${o.name}`);
393
+ return;
394
+ }
395
+ const i = Ot(s.type);
396
+ if (customElements.get(i))
397
+ return;
398
+ const r = e.getComponent(s.type);
399
+ if (!r) {
400
+ console.warn("Component is missing or using incorrect import.");
401
+ return;
402
+ }
403
+ const c = yield r();
404
+ if (!customElements.get(i))
405
+ try {
406
+ customElements.define(i, c.default);
407
+ } catch (a) {
408
+ console.log("error", a);
409
+ }
410
+ return customElements.whenDefined(i).then(() => ({
411
+ nodeId: t,
412
+ tag: i
413
+ }));
414
+ }), St = (t) => {
365
415
  if (t) {
366
416
  const { type: e, content: n } = t;
367
417
  switch (e) {
@@ -373,22 +423,22 @@ const Xe = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
373
423
  return "";
374
424
  }
375
425
  }
376
- }, Ot = (t) => {
377
- const e = (i, o) => {
378
- !i || (o ? i.classList.add("humany-tabbing") : i.classList.remove("humany-tabbing"));
379
- }, n = (i) => {
380
- i.key === "Tab" ? e(t, !0) : i.key === "Enter" && document.activeElement && document.activeElement.classList.contains("humany-trigger") || e(t, !1);
381
- }, s = (i) => {
426
+ }, At = (t) => {
427
+ const e = (s, i) => {
428
+ !s || (i ? s.classList.add("humany-tabbing") : s.classList.remove("humany-tabbing"));
429
+ }, n = (s) => {
430
+ s.key === "Tab" ? e(t, !0) : s.key === "Enter" && document.activeElement && document.activeElement.classList.contains("humany-trigger") || e(t, !1);
431
+ }, o = (s) => {
382
432
  document.activeElement && document.activeElement.classList.contains("humany-trigger") && document.activeElement.classList.contains("humany-tabbing") || e(t, !1);
383
433
  };
384
- return document.addEventListener("keydown", n), document.addEventListener("click", s), () => {
385
- document.removeEventListener("keydown", n), document.removeEventListener("click", s);
434
+ return document.addEventListener("keydown", n), document.addEventListener("click", o), () => {
435
+ document.removeEventListener("keydown", n), document.removeEventListener("click", o);
386
436
  };
387
437
  };
388
- function St(t, e) {
389
- const { symbol: n, widgetName: s, label: i = "", ariaLabel: o = "", tooltip: r = "" } = e;
390
- t.classList.add("humany-trigger"), t.classList.add(`humany_${s}`), i.length && t.classList.add("humany-has-text"), o.length && !t.getAttribute("aria-label") && t.setAttribute("aria-label", o), o.length && !t.getAttribute("tabindex") && t.setAttribute("tabindex", "0"), r.length && !t.getAttribute("title") && t.setAttribute("title", r);
391
- const c = Ct(n) || "";
438
+ function $t(t, e) {
439
+ const { symbol: n, widgetName: o, label: s = "", ariaLabel: i = "", tooltip: r = "" } = e;
440
+ t.classList.add("humany-trigger"), t.classList.add(`humany_${o}`), s.length && t.classList.add("humany-has-text"), i.length && !t.getAttribute("aria-label") && t.setAttribute("aria-label", i), i.length && !t.getAttribute("tabindex") && t.setAttribute("tabindex", "0"), r.length && !t.getAttribute("title") && t.setAttribute("title", r);
441
+ const c = St(n) || "";
392
442
  return t.innerHTML = `${c}
393
443
  <span class="humany-close">
394
444
  <svg width="18" height="9" viewBox="0 0 18 9" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -407,9 +457,9 @@ function St(t, e) {
407
457
  stroke-miterlimit="10" />
408
458
  </svg>
409
459
  </span>
410
- ${i.length ? `<span>${i}</span>` : ""}`, setTimeout(() => t && t.classList.add("humany-rendered")), Ot(t);
460
+ ${s.length ? `<span>${s}</span>` : ""}`, setTimeout(() => t && t.classList.add("humany-rendered")), At(t);
411
461
  }
412
- function At(t, e) {
462
+ function xt(t, e) {
413
463
  t instanceof HTMLElement ? (e && t.setAttribute("title", e), t.classList.remove("humany-active"), t.classList.remove("humany-loading")) : t instanceof Array && t.forEach((n) => {
414
464
  e && n.setAttribute("title", e), n.classList.remove("humany-active"), n.classList.remove("humany-loading");
415
465
  });
@@ -419,18 +469,18 @@ function Dt(t) {
419
469
  e.classList.remove("humany-active"), e.classList.add("humany-loading");
420
470
  });
421
471
  }
422
- function ye(t, e) {
472
+ function be(t, e) {
423
473
  t instanceof HTMLElement ? (e && t.setAttribute("title", e), t.classList.add("humany-active"), t.classList.remove("humany-loading")) : t instanceof Array && t.forEach((n) => {
424
474
  e && n.setAttribute("title", e), n.classList.add("humany-active"), n.classList.remove("humany-loading");
425
475
  });
426
476
  }
427
- var k = /* @__PURE__ */ ((t) => (t.Inline = "inline", t.Link = "link", t.Badge = "badge", t.Unsupported = "unsupported", t))(k || {});
428
- const xt = (t, e) => t && e ? "both" : t ? "widgetDOM" : e ? "triggerDOM" : "none", be = (t) => t ? typeof t == "boolean" && t ? "link" : typeof t == "object" && !Array.isArray(t) ? "badge" : "unsupported" : "inline", Mt = (t, e, n, s, i = !1) => {
429
- var u, d;
430
- const o = xt(
477
+ var P = /* @__PURE__ */ ((t) => (t.Inline = "inline", t.Link = "link", t.Badge = "badge", t.Unsupported = "unsupported", t))(P || {});
478
+ const Mt = (t, e) => t && e ? "both" : t ? "widgetDOM" : e ? "triggerDOM" : "none", we = (t) => t ? typeof t == "boolean" && t ? "link" : typeof t == "object" && !Array.isArray(t) ? "badge" : "unsupported" : "inline", Nt = (t, e, n, o, s = !1) => {
479
+ var l, d;
480
+ const i = Mt(
431
481
  e,
432
482
  n
433
- ), r = be(s), c = {
483
+ ), r = we(o), c = {
434
484
  widgetDOMElement: e ? e.cloneNode(!0) : void 0,
435
485
  triggerDOMElement: n ? n.cloneNode(!0) : void 0
436
486
  }, a = {
@@ -438,35 +488,35 @@ const xt = (t, e) => t && e ? "both" : t ? "widgetDOM" : e ? "triggerDOM" : "non
438
488
  cachedOriginals: c,
439
489
  widgetDOMElement: document.createElement("div")
440
490
  };
441
- switch (o) {
491
+ switch (i) {
442
492
  case "both": {
443
493
  a.widgetDOMElement = e || document.createElement("div"), r !== "inline" && (a.triggerDOMElement = n);
444
494
  break;
445
495
  }
446
496
  case "widgetDOM": {
447
497
  if (a.widgetDOMElement = e || document.createElement("div"), r !== "inline") {
448
- const l = document.body.appendChild(document.createElement("a"));
449
- r === "link" && (l.innerText = t), a.triggerDOMElement = l;
498
+ const u = document.body.appendChild(document.createElement("a"));
499
+ r === "link" && (u.innerText = t), a.triggerDOMElement = u;
450
500
  }
451
501
  break;
452
502
  }
453
503
  case "triggerDOM": {
454
- const l = document.createElement("div");
455
- a.widgetDOMElement = l, r === "inline" ? (l.id = (n == null ? void 0 : n.id) || "", i ? (l.style.display = "none", (u = n == null ? void 0 : n.parentNode) == null || u.appendChild(l), a.callback = () => {
504
+ const u = document.createElement("div");
505
+ a.widgetDOMElement = u, r === "inline" ? (u.id = (n == null ? void 0 : n.id) || "", s ? (u.style.display = "none", (l = n == null ? void 0 : n.parentNode) == null || l.appendChild(u), a.callback = () => {
456
506
  var f;
457
507
  (f = n == null ? void 0 : n.parentNode) == null || f.replaceChild(
458
- l,
508
+ u,
459
509
  n
460
- ), l.style.display = (n == null ? void 0 : n.style.display) || "block";
510
+ ), u.style.display = (n == null ? void 0 : n.style.display) || "block";
461
511
  }) : (d = n == null ? void 0 : n.parentNode) == null || d.replaceChild(
462
- l,
512
+ u,
463
513
  n
464
- ), a.cachedOriginals.widgetDOMElement = n, a.cachedOriginals.triggerDOMElement = void 0) : (a.widgetDOMElement = document.body.appendChild(l), a.triggerDOMElement = n);
514
+ ), a.cachedOriginals.widgetDOMElement = n, a.cachedOriginals.triggerDOMElement = void 0) : (a.widgetDOMElement = document.body.appendChild(u), a.triggerDOMElement = n);
465
515
  break;
466
516
  }
467
517
  case "none": {
468
- const l = document.body.appendChild(document.createElement("div"));
469
- if (a.widgetDOMElement = l, r !== "inline") {
518
+ const u = document.body.appendChild(document.createElement("div"));
519
+ if (a.widgetDOMElement = u, r !== "inline") {
470
520
  const f = document.body.appendChild(document.createElement("a"));
471
521
  r === "link" && (f.innerText = t), a.triggerDOMElement = f;
472
522
  }
@@ -474,36 +524,36 @@ const xt = (t, e) => t && e ? "both" : t ? "widgetDOM" : e ? "triggerDOM" : "non
474
524
  }
475
525
  }
476
526
  return a;
477
- }, Nt = "modals";
478
- class $t {
527
+ }, Lt = "modals";
528
+ class Pt {
479
529
  constructor(e, n) {
480
530
  this.options = n, this.unsubscribe = [], this.container = e.createChild(this), this.container.register("widgetDOMElement", this.options.widgetDOMElement), this.container.register("triggerDOMElement", this.options.triggerDOMElement);
481
- const s = this.container.get("$widget");
482
- this.options.widgetDOMElement.classList.add("humany-widget"), this.options.widgetDOMElement.classList.add(`humany_${s.name}`);
483
- const i = e.get("widgetDOMElements") || [];
531
+ const o = this.container.get("$widget");
532
+ this.options.widgetDOMElement.classList.add("humany-widget"), this.options.widgetDOMElement.classList.add(`humany_${o.name}`);
533
+ const s = e.get("widgetDOMElements") || [];
484
534
  e.register("widgetDOMElements", [
485
- ...i,
535
+ ...s,
486
536
  this.options.widgetDOMElement
487
537
  ]);
488
538
  }
489
539
  render() {
490
- const { widgetDOMElement: e, triggerDOMElement: n } = this.options, s = this.container.get("$widget");
491
- return e.getAttribute("data-rendered") === "true" ? Promise.resolve() : (n && this.options.triggerType === k.Badge && Dt(n), import("./render.b6303746.js").then((i) => i.default(s.name, this.container, e)).then(() => {
492
- if (e.setAttribute("data-rendered", "true"), n && this.options.triggerType === k.Badge) {
493
- const o = this.options.triggerOptions.openTooltip;
494
- ye(n, o);
540
+ const { widgetDOMElement: e, triggerDOMElement: n } = this.options, o = this.container.get("$widget");
541
+ return e.getAttribute("data-rendered") === "true" ? Promise.resolve() : (n && this.options.triggerType === P.Badge && Dt(n), import("./render.6ad0b099.js").then((s) => s.default(o.name, this.container, e)).then(() => {
542
+ if (e.setAttribute("data-rendered", "true"), n && this.options.triggerType === P.Badge) {
543
+ const i = this.options.triggerOptions.openTooltip;
544
+ be(n, i);
495
545
  }
496
546
  We(this.container, e);
497
- const i = this.container.get("$environment").widgets.all();
498
- $(
547
+ const s = this.container.get("$environment").widgets.all();
548
+ N(
499
549
  this.container,
500
- Nt,
550
+ Lt,
501
551
  v.Session
502
- ).then((o) => {
503
- o && o.forEach((r) => {
504
- i.find(
552
+ ).then((i) => {
553
+ i && i.forEach((r) => {
554
+ s.find(
505
555
  (c) => c.name === r.name && c.state === "activated"
506
- ) && s.events.dispatch("widget:modal-opened", r);
556
+ ) && o.events.dispatch("widget:modal-opened", r);
507
557
  });
508
558
  });
509
559
  }));
@@ -513,85 +563,85 @@ class $t {
513
563
  if (!n)
514
564
  return;
515
565
  n.getAttribute("role") || n.setAttribute("role", "button");
516
- const { name: s } = this.container.get("$widget"), { label: i, symbol: o, ariaLabel: r, closedTooltip: c, openTooltip: a } = e, u = { closedTooltip: c, openTooltip: a };
517
- this.options.triggerOptions = u;
518
- const d = St(n, {
519
- label: i,
520
- symbol: o,
566
+ const { name: o } = this.container.get("$widget"), { label: s, symbol: i, ariaLabel: r, closedTooltip: c, openTooltip: a } = e, l = { closedTooltip: c, openTooltip: a };
567
+ this.options.triggerOptions = l;
568
+ const d = $t(n, {
569
+ label: s,
570
+ symbol: i,
521
571
  ariaLabel: r,
522
- widgetName: s,
572
+ widgetName: o,
523
573
  tooltip: c
524
574
  });
525
575
  this.unsubscribe.push(d);
526
576
  }
527
577
  dispose() {
528
578
  return import("./unmount.b0816844.js").then((e) => {
529
- var i, o, r, c;
530
- const { triggerDOMElement: n, widgetDOMElement: s } = this.options;
531
- e.default(s), this.options.cachedOriginals.widgetDOMElement && s && ((i = s.parentNode) == null || i.replaceChild(
579
+ var s, i, r, c;
580
+ const { triggerDOMElement: n, widgetDOMElement: o } = this.options;
581
+ e.default(o), this.options.cachedOriginals.widgetDOMElement && o && ((s = o.parentNode) == null || s.replaceChild(
532
582
  this.options.cachedOriginals.widgetDOMElement,
533
- s
534
- )), this.options.cachedOriginals.triggerDOMElement && n && ((o = n.parentNode) == null || o.replaceChild(
583
+ o
584
+ )), this.options.cachedOriginals.triggerDOMElement && n && ((i = n.parentNode) == null || i.replaceChild(
535
585
  this.options.cachedOriginals.triggerDOMElement,
536
586
  n
537
587
  )), this.unsubscribe.forEach((a) => {
538
588
  a();
539
- }), (r = s.parentNode) == null || r.removeChild(s), (c = n == null ? void 0 : n.parentNode) == null || c.removeChild(n);
589
+ }), (r = o.parentNode) == null || r.removeChild(o), (c = n == null ? void 0 : n.parentNode) == null || c.removeChild(n);
540
590
  });
541
591
  }
542
592
  }
543
- const F = "changesets", Lt = (t) => {
593
+ const W = "changesets", kt = (t) => {
544
594
  const e = { tags: t.tags };
545
595
  return t.context && typeof t.context != "function" && (e.context = t.context), t.properties && typeof t.properties != "function" && (e.properties = t.properties), t.layout && typeof t.layout != "function" && (e.layout = t.layout), e;
546
596
  };
547
- class ne {
597
+ class oe {
548
598
  constructor(e, n) {
549
599
  this.container = e, this.storageWriter = n;
550
600
  }
551
601
  static create(e) {
552
- return V(e, F, _.Necessary, {
602
+ return V(e, W, _.Necessary, {
553
603
  medium: v.Local
554
- }).then((n) => new ne(e, n));
604
+ }).then((n) => new oe(e, n));
555
605
  }
556
- write(e, n, s, i) {
557
- return q(this)(() => $(
606
+ write(e, n, o, s) {
607
+ return q(this)(() => N(
558
608
  this.container,
559
- F,
609
+ W,
560
610
  v.Local
561
- ).then((o = {}) => {
562
- const { keys: r = [], items: c = {} } = o, a = r.indexOf(e);
611
+ ).then((i = {}) => {
612
+ const { keys: r = [], items: c = {} } = i, a = r.indexOf(e);
563
613
  return a > -1 && r.splice(a, 1), r.push(e), c[e] = {
564
- options: i,
565
- attributes: Lt(s),
614
+ options: s,
615
+ attributes: kt(o),
566
616
  rules: n.rules
567
617
  }, this.storageWriter({ keys: r, items: c });
568
618
  }));
569
619
  }
570
620
  remove(e) {
571
- return q(this)(() => $(
621
+ return q(this)(() => N(
572
622
  this.container,
573
- F,
623
+ W,
574
624
  v.Local
575
625
  ).then((n = {}) => {
576
- const { keys: s = [], items: i = {} } = n, o = s.indexOf(e);
577
- if (o > -1)
578
- return s.splice(o, 1), delete i[e], this.storageWriter(n);
626
+ const { keys: o = [], items: s = {} } = n, i = o.indexOf(e);
627
+ if (i > -1)
628
+ return o.splice(i, 1), delete s[e], this.storageWriter(n);
579
629
  }));
580
630
  }
581
631
  load(e) {
582
- return q(this)(() => $(
632
+ return q(this)(() => N(
583
633
  this.container,
584
- F,
634
+ W,
585
635
  v.Local
586
636
  ).then((n = {}) => {
587
- const { keys: s = [], items: i = {} } = n;
588
- s.forEach((o) => {
589
- const r = i[o];
637
+ const { keys: o = [], items: s = {} } = n;
638
+ o.forEach((i) => {
639
+ const r = s[i];
590
640
  if (r) {
591
- const { rules: c, attributes: a, options: u } = r;
641
+ const { rules: c, attributes: a, options: l } = r;
592
642
  e.write({
593
643
  attributes: a,
594
- options: u,
644
+ options: l,
595
645
  target: new Ge(e, c)
596
646
  });
597
647
  }
@@ -599,50 +649,50 @@ class ne {
599
649
  }));
600
650
  }
601
651
  }
602
- const kt = (t) => {
652
+ const Rt = (t) => {
603
653
  const { container: e } = t;
604
- return ne.create(e).then((n) => {
605
- const s = e.get("$settings"), i = { localStorage: n }, o = new Te(t, i), r = je(o, s);
654
+ return oe.create(e).then((n) => {
655
+ const o = e.get("$settings"), s = { localStorage: n }, i = new je(t, s), r = Fe(i, o);
606
656
  return t.events.subscribe("widget:state-change", (c, a) => {
607
- a.state === Ze.Deactivating && r();
608
- }), o;
657
+ a.state === Je.Deactivating && r();
658
+ }), i;
609
659
  });
610
- }, Pt = (t) => import("@telia-ace/widget-routing").then(({ RoutingService: e, HistoryMode: n }) => t.get("settings").then((s) => {
660
+ }, Vt = (t) => import("@telia-ace/widget-routing").then(({ RoutingService: e, HistoryMode: n }) => t.get("settings").then((o) => {
611
661
  const {
612
- routing: { initialPath: i = "/", mode: o = n.scopedHash, basePath: r },
662
+ routing: { initialPath: s = "/", mode: i = n.scopedHash, basePath: r },
613
663
  views: c
614
- } = s;
664
+ } = o;
615
665
  return new e(t, {
616
- initialPath: i,
617
- mode: o,
618
- routes: Object.keys(c).map((u) => ({
619
- name: u,
620
- path: c[u].path
666
+ initialPath: s,
667
+ mode: i,
668
+ routes: Object.keys(c).map((l) => ({
669
+ name: l,
670
+ path: c[l].path
621
671
  })),
622
672
  basePath: r
623
673
  });
624
- })), Rt = (t) => import("@telia-ace/widget-services").then(({ StorageProvider: e }) => new e()), Vt = (t) => import("@telia-ace/widget-core").then(({ ActionResolver: e }) => new e(t)), _t = (t) => import("@telia-ace/widget-core").then(({ ComponentResolver: e }) => new e(t)), It = (t) => import("@telia-ace/widget-core").then(({ ComponentPlatform: e, createComponentModel: n }) => kt(t.get("$widget"))), Z = "$settings", H = "open", le = "activeStickyWidget";
625
- class Jt extends Je {
674
+ })), _t = (t) => import("@telia-ace/widget-services").then(({ StorageProvider: e }) => new e()), It = (t) => import("@telia-ace/widget-core").then(({ ActionResolver: e }) => new e(t)), Tt = (t) => import("@telia-ace/widget-core").then(({ ComponentResolver: e }) => new e(t)), zt = (t) => import("@telia-ace/widget-core").then(({ ComponentPlatform: e, createComponentModel: n }) => Rt(t.get("$widget"))), Z = "$settings", H = "open", ue = "activeStickyWidget";
675
+ class tn extends Xe {
626
676
  constructor(e) {
627
677
  super(e), this.outlets = /* @__PURE__ */ new Map(), this.activated = void 0, this.subs = [], this.handleBootstrapping = (n) => {
628
- const s = {
678
+ const o = {
629
679
  triggerDOMElement: n.sourceDOMElement,
630
680
  withRenderState: "storage"
631
681
  };
632
- this.container.get("settings").then((i) => {
633
- const { activate: o } = i;
634
- (typeof o == "undefined" || o === null || o === !0) && (this.activated = (this.activated || this.widget.activate()).then(
635
- () => this.attach(s)
682
+ this.container.get("settings").then((s) => {
683
+ const { activate: i } = s;
684
+ (typeof i == "undefined" || i === null || i === !0) && (this.activated = (this.activated || this.widget.activate()).then(
685
+ () => this.attach(o)
636
686
  ));
637
687
  });
638
- }, this.container.registerAsync("storage", () => Rt(this.container)), this.container.registerFactory("settings", () => $(
688
+ }, this.container.registerAsync("storage", () => _t(this.container)), this.container.registerFactory("settings", () => N(
639
689
  this.container,
640
690
  Z,
641
691
  v.Local
642
- ).then((n = {}) => p(p({}, this.container.get("$settings")), n))), Qe(this, "load", this.handleBootstrapping), this.container.registerAsync(
692
+ ).then((n = {}) => p(p({}, this.container.get("$settings")), n))), Ze(this, "load", this.handleBootstrapping), this.container.registerAsync(
643
693
  "componentResolver",
644
- () => _t(this.container)
645
- ), this.container.registerAsync("router", () => Pt(this.container)), this.container.registerAsync("actionResolver", () => Vt(this.container)), this.container.register("matchMedia", window.matchMedia), this.container.registerAsync("components", () => It(this.container));
694
+ () => Tt(this.container)
695
+ ), this.container.registerAsync("router", () => Vt(this.container)), this.container.registerAsync("actionResolver", () => It(this.container)), this.container.register("matchMedia", window.matchMedia), this.container.registerAsync("components", () => zt(this.container));
646
696
  }
647
697
  initialize() {
648
698
  const e = this.container.getManyAsync(
@@ -651,33 +701,33 @@ class Jt extends Je {
651
701
  "components"
652
702
  );
653
703
  return Promise.all([e, this.container.get("settings")]).then(
654
- ([{ actionResolver: n, router: s, components: i }, o]) => {
704
+ ([{ actionResolver: n, router: o, components: s }, i]) => {
655
705
  var a;
656
706
  n.subscribe(
657
707
  this.widget.name,
658
- (u, d, l) => this.onAction(d, l)
708
+ (l, d, u) => this.onAction(d, u)
659
709
  );
660
- const r = (u) => {
661
- i.nodes.query({ type: "view" }).forEach((d) => {
662
- i.setSwitch(d, u);
710
+ const r = (l) => {
711
+ s.nodes.query({ type: "view" }).forEach((d) => {
712
+ s.setSwitch(d, l);
663
713
  });
664
- }, c = ((a = s.getInitialRoute()) == null ? void 0 : a.name) || "index";
665
- return r(c), this.events.subscribe("widget:data-loaded", (u, { element: d }) => {
714
+ }, c = ((a = o.getInitialRoute()) == null ? void 0 : a.name) || "index";
715
+ return r(c), this.events.subscribe("widget:data-loaded", (l, { element: d }) => {
666
716
  this.widget.container.get("seoConfiguration") && this.events.dispatch("widget:preloaded-replaced", {
667
717
  element: d
668
718
  });
669
719
  }), this.events.subscribe(
670
720
  "router:change",
671
- (u, { previous: d = { routeData: {} }, next: l = { routeData: {} } }) => {
672
- const { routeData: f } = d, { routeData: m } = l, g = Object.keys(o.views).reduce((b, y) => typeof o.views[y].path == "undefined" ? y : b, "");
673
- !m.name && g ? r(g) : r(m.name), ce(f && f.params), ce(m && m.params), this.container.getAsync("actionResolver").then((b) => {
721
+ (l, { previous: d = { routeData: {} }, next: u = { routeData: {} } }) => {
722
+ const { routeData: f } = d, { routeData: m } = u, g = Object.keys(i.views).reduce((b, y) => typeof i.views[y].path == "undefined" ? y : b, "");
723
+ !m.name && g ? r(g) : r(m.name), le(f && f.params), le(m && m.params), this.container.getAsync("actionResolver").then((b) => {
674
724
  b.action(this.widget.name, "routeChange", {
675
725
  next: m,
676
726
  previous: f
677
727
  });
678
728
  });
679
729
  }
680
- ), s.initialize();
730
+ ), o.initialize();
681
731
  }
682
732
  );
683
733
  }
@@ -685,37 +735,37 @@ class Jt extends Je {
685
735
  return this.container.get("settings").then(({ trigger: n }) => {
686
736
  var f, m;
687
737
  const {
688
- widgetDOMElement: s,
689
- key: i = Fe(),
690
- triggerDOMElement: o,
738
+ widgetDOMElement: o,
739
+ key: s = He(),
740
+ triggerDOMElement: i,
691
741
  withRenderState: r
692
- } = e, a = be(n) === k.Inline && ((o == null ? void 0 : o.childElementCount) || 0) > 0, u = Mt(
742
+ } = e, a = we(n) === P.Inline && ((i == null ? void 0 : i.childElementCount) || 0) > 0, l = Nt(
693
743
  this.widget.name,
694
- s,
695
744
  o,
745
+ i,
696
746
  n,
697
747
  a
698
748
  );
699
749
  this.outlets.size < 1 && !r && this.setRenderState("unset");
700
750
  const d = () => {
701
751
  const g = () => b.querySelectorAll("[data-loading=true]").length === 0, [b] = this.widget.container.get("widgetDOMElements"), y = (j, L) => {
702
- g() && (u.callback && u.callback(), L.disconnect());
752
+ g() && (l.callback && l.callback(), L.disconnect());
703
753
  }, E = {
704
754
  attributes: !0,
705
755
  subtree: !0,
706
756
  childList: !0
707
757
  };
708
- g() && u.callback && u.callback(), new MutationObserver(y).observe(b, E);
758
+ g() && l.callback && l.callback(), new MutationObserver(y).observe(b, E);
709
759
  };
710
760
  a && this.widget.container.getAsync("dataClient").then(({ events: g }) => {
711
761
  g.subscribe("data-client:fetched", (b, y) => {
712
762
  y.unresolvedQueries === 0 && d();
713
763
  });
714
764
  });
715
- const l = this.getOrCreateViewOutlet(i, u);
716
- if (this.outlets.set(i, l), this.widget.events.dispatch("widget:attached", {}, { bubbles: !0 }), u.triggerType === k.Badge && n && ((f = u.triggerDOMElement) == null || f.setAttribute("aria-expanded", "false"), l == null || l.renderBadge(n)), u.triggerType !== k.Inline && ((m = u.triggerDOMElement) == null || m.addEventListener("click", (g) => {
765
+ const u = this.getOrCreateViewOutlet(s, l);
766
+ if (this.outlets.set(s, u), this.widget.events.dispatch("widget:attached", {}, { bubbles: !0 }), l.triggerType === P.Badge && n && ((f = l.triggerDOMElement) == null || f.setAttribute("aria-expanded", "false"), u == null || u.renderBadge(n)), l.triggerType !== P.Inline && ((m = l.triggerDOMElement) == null || m.addEventListener("click", (g) => {
717
767
  g.preventDefault(), this.container.get("settings").then(({ trigger: b }) => {
718
- l.render().then(() => this.renderState()).then((y) => b && b.action && b.action === "hide" ? y === O.open ? this.hide() : this.open() : y === O.open ? this.close() : this.open());
768
+ u.render().then(() => this.renderState()).then((y) => b && b.action && b.action === "hide" ? y === O.open ? this.hide() : this.open() : y === O.open ? this.close() : this.open());
719
769
  });
720
770
  })), this.outlets.size > 1)
721
771
  return this.renderState().then((g) => {
@@ -723,7 +773,7 @@ class Jt extends Je {
723
773
  });
724
774
  if (r)
725
775
  return r === "storage" ? this.renderState().then((g) => {
726
- if (u.triggerType === k.Inline) {
776
+ if (l.triggerType === P.Inline) {
727
777
  this.triggerStateIfApplicable("open");
728
778
  return;
729
779
  }
@@ -763,7 +813,7 @@ class Jt extends Je {
763
813
  });
764
814
  }
765
815
  getOrCreateViewOutlet(e, n) {
766
- return this.outlets.has(e) ? this.outlets.get(e) : new $t(this.container, n);
816
+ return this.outlets.has(e) ? this.outlets.get(e) : new Pt(this.container, n);
767
817
  }
768
818
  render(e = {}) {
769
819
  if (process.env.NODE_ENV !== "production" && console.warn("widget.render() is deprecated. Use widget.attach() instead."), e.open) {
@@ -783,9 +833,9 @@ class Jt extends Je {
783
833
  V(this.container, Z, _.Necessary, {
784
834
  medium: v.Local
785
835
  })
786
- ]).then(([n, s]) => Promise.resolve(e(n)).then((i) => s(i).then(() => {
787
- const o = p(p({}, n), i);
788
- return this.widget.events.dispatch("widget:settings-updated", o), o;
836
+ ]).then(([n, o]) => Promise.resolve(e(n)).then((s) => o(s).then(() => {
837
+ const i = p(p({}, n), s);
838
+ return this.widget.events.dispatch("widget:settings-updated", i), i;
789
839
  })));
790
840
  }
791
841
  clearSettings() {
@@ -799,23 +849,23 @@ class Jt extends Je {
799
849
  });
800
850
  }
801
851
  action({ action: e, value: n }) {
802
- return this.container.getAsync("actionResolver").then((s) => {
803
- s.action(this.widget.name, e, n);
852
+ return this.container.getAsync("actionResolver").then((o) => {
853
+ o.action(this.widget.name, e, n);
804
854
  });
805
855
  }
806
856
  renderState() {
807
- if (Ye(this.container))
857
+ if (qe(this.container))
808
858
  return Promise.resolve(O.open);
809
- const e = () => $(
859
+ const e = () => N(
810
860
  this.container,
811
861
  H,
812
862
  v.Session
813
- ).then((s = O.closed) => s), n = () => $(
863
+ ).then((o = O.closed) => o), n = () => N(
814
864
  this.container,
815
865
  H,
816
866
  v.Session
817
- ).then((s = O.closed) => s);
818
- return this.container.getAsync("router").then((s) => s.isSticky() ? n().then((i) => i === O.open ? i : e()) : e());
867
+ ).then((o = O.closed) => o);
868
+ return this.container.getAsync("router").then((o) => o.isSticky() ? n().then((s) => s === O.open ? s : e()) : e());
819
869
  }
820
870
  hide() {
821
871
  return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn(
@@ -844,19 +894,19 @@ class Jt extends Je {
844
894
  case "close":
845
895
  case "open":
846
896
  case "hide":
847
- const s = e === "open" ? O.open : e === "close" ? O.closed : O.hidden;
848
- return this.setRenderState(s).then(() => {
849
- this.setTriggerState(s === O.open), s !== O.hidden ? s === O.open ? this.onOpen() : this.onClose() : this.outlets.forEach(
850
- (i) => {
851
- var o;
852
- return (o = i.options.triggerDOMElement) == null ? void 0 : o.setAttribute("aria-expanded", "false");
897
+ const o = e === "open" ? O.open : e === "close" ? O.closed : O.hidden;
898
+ return this.setRenderState(o).then(() => {
899
+ this.setTriggerState(o === O.open), o !== O.hidden ? o === O.open ? this.onOpen() : this.onClose() : this.outlets.forEach(
900
+ (s) => {
901
+ var i;
902
+ return (i = s.options.triggerDOMElement) == null ? void 0 : i.setAttribute("aria-expanded", "false");
853
903
  }
854
904
  );
855
905
  });
856
906
  }
857
907
  }
858
908
  setRenderState(e) {
859
- const { invoke: n, events: s } = this.container.get("$widget");
909
+ const { invoke: n, events: o } = this.container.get("$widget");
860
910
  return Promise.all([
861
911
  V(this.container, H, _.Necessary, {
862
912
  medium: v.Session
@@ -867,8 +917,8 @@ class Jt extends Je {
867
917
  }),
868
918
  this.container.getAsync("router"),
869
919
  n("renderState")
870
- ]).then(([i, o, r, c]) => {
871
- e === "unset" || !e ? (o(), i()) : (r.isSticky() && o(e), i(e)), s.dispatch("widget:render-state-changed", {
920
+ ]).then(([s, i, r, c]) => {
921
+ e === "unset" || !e ? (i(), s()) : (r.isSticky() && i(e), s(e)), o.dispatch("widget:render-state-changed", {
872
922
  previous: c,
873
923
  next: e
874
924
  });
@@ -877,69 +927,70 @@ class Jt extends Je {
877
927
  onOpen() {
878
928
  return this.container.getAsync("router").then((e) => (this.outlets.forEach(
879
929
  (n) => {
880
- var s;
881
- return (s = n.options.triggerDOMElement) == null ? void 0 : s.setAttribute("aria-expanded", "true");
930
+ var o;
931
+ return (o = n.options.triggerDOMElement) == null ? void 0 : o.setAttribute("aria-expanded", "true");
882
932
  }
883
933
  ), e.start()));
884
934
  }
885
935
  onClose() {
886
936
  const e = this.container.getManyAsync("router", "components");
887
- return (() => this.container.get("settings").then((s) => {
888
- const { activate: i } = this.container.get("$settings");
889
- return s.activate !== i ? this.setSettings(() => Promise.resolve({ activate: i })) : Promise.resolve();
937
+ return (() => this.container.get("settings").then((o) => {
938
+ const { activate: s } = this.container.get("$settings");
939
+ return o.activate !== s ? this.setSettings(() => Promise.resolve({ activate: s })) : Promise.resolve();
890
940
  }))().then(() => e).then(
891
941
  ({
892
- router: s,
893
- components: i
942
+ router: o,
943
+ components: s
894
944
  }) => {
895
- const o = i.nodes.visible;
945
+ const i = s.nodes.visible;
896
946
  return this.outlets.forEach(
897
947
  (r) => {
898
948
  var c;
899
949
  return (c = r.options.triggerDOMElement) == null ? void 0 : c.setAttribute("aria-expanded", "false");
900
950
  }
901
- ), o.filter(
951
+ ), i.filter(
902
952
  (r) => r.attributes.properties.animation && r.attributes.properties.animation !== "none"
903
953
  ).length ? new Promise((r) => {
904
954
  setTimeout(() => {
905
- r(s);
955
+ r(o);
906
956
  }, 200);
907
- }) : Promise.resolve(s);
957
+ }) : Promise.resolve(o);
908
958
  }
909
- ).then((s) => s.stop());
959
+ ).then((o) => o.stop());
910
960
  }
911
961
  setTriggerState(e) {
912
962
  this.outlets.forEach((n) => {
913
963
  const {
914
- options: { triggerDOMElement: s, triggerOptions: i }
915
- } = n, { openTooltip: o, closedTooltip: r } = i || {};
916
- s && (e ? ye(s, o) : At(s, r));
964
+ options: { triggerDOMElement: o, triggerOptions: s }
965
+ } = n, { openTooltip: i, closedTooltip: r } = s || {};
966
+ o && (e ? be(o, i) : xt(o, r));
917
967
  });
918
968
  }
919
969
  deactivate() {
920
970
  this.subs.forEach((n) => n());
921
971
  const e = [];
922
- return this.outlets.forEach((n) => e.push(n.dispose())), $(
972
+ return this.outlets.forEach((n) => e.push(n.dispose())), N(
923
973
  this.container,
924
- le,
974
+ ue,
925
975
  v.Local
926
976
  ).then((n) => n === this.widget.name ? V(
927
977
  this.container,
928
- le,
978
+ ue,
929
979
  _.Necessary,
930
980
  {
931
981
  medium: v.Local,
932
- scope: qe.Implementation
982
+ scope: Qe.Implementation
933
983
  }
934
- ).then((s) => s()).then(() => Promise.all(e)) : Promise.all(e));
984
+ ).then((o) => o()).then(() => Promise.all(e)) : Promise.all(e));
935
985
  }
936
986
  }
937
987
  export {
938
- te as Component,
939
- bt as DetachedComponent,
940
- Jt as GridWidget,
941
- Zt as NotFound,
942
- Jt as Widget,
943
- U as genericComponentStyling
988
+ ne as Component,
989
+ wt as DetachedComponent,
990
+ tn as GridWidget,
991
+ Xt as NotFound,
992
+ tn as Widget,
993
+ U as genericComponentStyling,
994
+ en as resolveComponent
944
995
  };
945
996
  //# sourceMappingURL=index.js.map