@telia-ace/widget-runtime-flamingo 1.0.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.
Files changed (73) hide show
  1. package/LICENSE.txt +6 -0
  2. package/README.md +3 -0
  3. package/dist/area-65adc6a5.js +50 -0
  4. package/dist/area-65adc6a5.js.map +1 -0
  5. package/dist/component-platform-factory.d.ts +14 -0
  6. package/dist/component-platform-factory.d.ts.map +1 -0
  7. package/dist/components/area/area-component.d.ts +28 -0
  8. package/dist/components/area/area-component.d.ts.map +1 -0
  9. package/dist/components/area/area.d.ts +10 -0
  10. package/dist/components/area/area.d.ts.map +1 -0
  11. package/dist/components/copyright/copyright-component.d.ts +4 -0
  12. package/dist/components/copyright/copyright-component.d.ts.map +1 -0
  13. package/dist/components/copyright/copyright.d.ts +8 -0
  14. package/dist/components/copyright/copyright.d.ts.map +1 -0
  15. package/dist/components/widget-header/widget-header-component.d.ts +4 -0
  16. package/dist/components/widget-header/widget-header-component.d.ts.map +1 -0
  17. package/dist/components/widget-header/widget-header.d.ts +8 -0
  18. package/dist/components/widget-header/widget-header.d.ts.map +1 -0
  19. package/dist/context/children.context.d.ts +5 -0
  20. package/dist/context/children.context.d.ts.map +1 -0
  21. package/dist/context/component-node.context.d.ts +5 -0
  22. package/dist/context/component-node.context.d.ts.map +1 -0
  23. package/dist/context/container.context.d.ts +5 -0
  24. package/dist/context/container.context.d.ts.map +1 -0
  25. package/dist/context/context.context.d.ts +4 -0
  26. package/dist/context/context.context.d.ts.map +1 -0
  27. package/dist/context/layout.context.d.ts +4 -0
  28. package/dist/context/layout.context.d.ts.map +1 -0
  29. package/dist/context/properties.context.d.ts +4 -0
  30. package/dist/context/properties.context.d.ts.map +1 -0
  31. package/dist/controllers/actions-controller.d.ts +11 -0
  32. package/dist/controllers/actions-controller.d.ts.map +1 -0
  33. package/dist/copyright-ef48bb60.js +171 -0
  34. package/dist/copyright-ef48bb60.js.map +1 -0
  35. package/dist/core/create-lit-component.d.ts +12 -0
  36. package/dist/core/create-lit-component.d.ts.map +1 -0
  37. package/dist/core/lock.d.ts +10 -0
  38. package/dist/core/lock.d.ts.map +1 -0
  39. package/dist/index-d589d5e4.js +3834 -0
  40. package/dist/index-d589d5e4.js.map +1 -0
  41. package/dist/index.d.ts +14 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +18 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/query-assigned-elements-a9b1c83a.js +668 -0
  46. package/dist/query-assigned-elements-a9b1c83a.js.map +1 -0
  47. package/dist/render-8726e104.js +255 -0
  48. package/dist/render-8726e104.js.map +1 -0
  49. package/dist/services.d.ts +7 -0
  50. package/dist/services.d.ts.map +1 -0
  51. package/dist/ui/branding.d.ts +2 -0
  52. package/dist/ui/branding.d.ts.map +1 -0
  53. package/dist/ui/component.d.ts +22 -0
  54. package/dist/ui/component.d.ts.map +1 -0
  55. package/dist/ui/determine-slide-direction.d.ts +27 -0
  56. package/dist/ui/determine-slide-direction.d.ts.map +1 -0
  57. package/dist/ui/html-element-handlers.d.ts +19 -0
  58. package/dist/ui/html-element-handlers.d.ts.map +1 -0
  59. package/dist/ui/index.d.ts +2 -0
  60. package/dist/ui/index.d.ts.map +1 -0
  61. package/dist/ui/prepare-dom.d.ts +21 -0
  62. package/dist/ui/prepare-dom.d.ts.map +1 -0
  63. package/dist/ui/render.d.ts +5 -0
  64. package/dist/ui/render.d.ts.map +1 -0
  65. package/dist/ui/view-outlet.d.ts +33 -0
  66. package/dist/ui/view-outlet.d.ts.map +1 -0
  67. package/dist/ui/wrapper.d.ts +14 -0
  68. package/dist/ui/wrapper.d.ts.map +1 -0
  69. package/dist/widget-header-f222904a.js +55 -0
  70. package/dist/widget-header-f222904a.js.map +1 -0
  71. package/dist/widget.d.ts +55 -0
  72. package/dist/widget.d.ts.map +1 -0
  73. package/package.json +53 -0
@@ -0,0 +1,3834 @@
1
+ var Wn = Object.defineProperty, Bn = Object.defineProperties;
2
+ var Un = Object.getOwnPropertyDescriptors;
3
+ var Pe = Object.getOwnPropertySymbols;
4
+ var zn = Object.prototype.hasOwnProperty, Fn = Object.prototype.propertyIsEnumerable;
5
+ var ke = (n, t, e) => t in n ? Wn(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, dt = (n, t) => {
6
+ for (var e in t || (t = {}))
7
+ zn.call(t, e) && ke(n, e, t[e]);
8
+ if (Pe)
9
+ for (var e of Pe(t))
10
+ Fn.call(t, e) && ke(n, e, t[e]);
11
+ return n;
12
+ }, Ce = (n, t) => Bn(n, Un(t));
13
+ var Xt = (n, t, e) => new Promise((r, s) => {
14
+ var i = (c) => {
15
+ try {
16
+ a(e.next(c));
17
+ } catch (h) {
18
+ s(h);
19
+ }
20
+ }, o = (c) => {
21
+ try {
22
+ a(e.throw(c));
23
+ } catch (h) {
24
+ s(h);
25
+ }
26
+ }, a = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(i, o);
27
+ a((e = e.apply(n, t)).next());
28
+ });
29
+ const te = (n, t, e, ...r) => {
30
+ const s = `[${n.get("$environment").name || "webprovisions"}] ${e}`;
31
+ switch (t) {
32
+ case "info":
33
+ console.info(s, ...r);
34
+ break;
35
+ case "warning":
36
+ console.warn(s, ...r);
37
+ break;
38
+ case "error":
39
+ console.error(s, ...r);
40
+ break;
41
+ }
42
+ }, Jn = (n) => {
43
+ const t = n.container || n;
44
+ return {
45
+ info: (e, ...r) => te(t, "info", e, ...r),
46
+ warn: (e, ...r) => te(t, "warning", e, ...r),
47
+ error: (e, ...r) => te(t, "error", e, ...r)
48
+ };
49
+ };
50
+ var Ht = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))(Ht || {}), at = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(at || {});
51
+ const qn = (n, t, e, r) => {
52
+ try {
53
+ const s = new t(e, r);
54
+ return {
55
+ name: n,
56
+ invoke: (i, o) => {
57
+ let a;
58
+ return s[i] && (a = s[i].call(s, o)), Promise.resolve(a);
59
+ },
60
+ getInstance: () => s
61
+ };
62
+ } catch (s) {
63
+ if (s.message && s.message.indexOf("is not a constructor") >= 0)
64
+ return {
65
+ name: n,
66
+ invoke: (i) => {
67
+ let o;
68
+ return i === "initialize" && (o = t(e, r)), Promise.resolve(o);
69
+ },
70
+ getInstance: () => t
71
+ };
72
+ throw s;
73
+ }
74
+ };
75
+ function Se(n, t) {
76
+ return typeof n == "undefined" ? t : n;
77
+ }
78
+ let Kn = class {
79
+ constructor(t = {}) {
80
+ this.part = t;
81
+ }
82
+ createCommand(t, e, r) {
83
+ let s;
84
+ typeof e == "function" ? s = {
85
+ scope: Ht.Widget,
86
+ stage: at.Post,
87
+ defaultArgs: void 0,
88
+ handlerResolver: e
89
+ } : s = {
90
+ scope: Se(e.scope, Ht.Widget),
91
+ stage: Se(e.stage, at.Post),
92
+ defaultArgs: e.defaultArgs,
93
+ handlerResolver: r
94
+ };
95
+ let i = this.part;
96
+ const o = t.split(".");
97
+ return o.forEach((a, c) => {
98
+ c === o.length - 1 ? i[a] || (i[a] = () => s) : i = this.part[a] = this.part[a] || {};
99
+ }), this;
100
+ }
101
+ get() {
102
+ return this.part;
103
+ }
104
+ };
105
+ const ge = (n) => {
106
+ const t = new Kn({});
107
+ return n(t), t.get();
108
+ };
109
+ ge((n) => {
110
+ n.createCommand(
111
+ "types.register",
112
+ { scope: Ht.Implementation, stage: at.Pre },
113
+ (t) => (e, r) => {
114
+ t.container.get("$types")[e] = r;
115
+ }
116
+ ).createCommand(
117
+ "type",
118
+ { stage: at.Pre },
119
+ (t) => (e) => {
120
+ t.container.register("$type", e);
121
+ }
122
+ ).createCommand(
123
+ "settings",
124
+ { stage: at.Pre, defaultArgs: [null] },
125
+ (t) => (e) => {
126
+ t.events.dispatch(
127
+ "settings:change",
128
+ e,
129
+ { bubbles: !0 }
130
+ ), t.container.register("$settings", e);
131
+ }
132
+ ).createCommand(
133
+ "plugin",
134
+ { stage: at.Pre },
135
+ (t) => (e, r, s) => {
136
+ const { container: i } = t;
137
+ let o = null, a = e, c = r;
138
+ typeof e == "string" && (o = e, a = r, c = s);
139
+ const h = (u) => {
140
+ const { transformPluginSettings: l } = t.container.get("$environmentOptions"), d = l ? l(
141
+ c || {},
142
+ o,
143
+ t.container,
144
+ a
145
+ ) : r;
146
+ try {
147
+ const f = qn(
148
+ o,
149
+ a,
150
+ i,
151
+ d
152
+ );
153
+ i.get("$plugins").push(f), u && f.invoke("initialize", null);
154
+ } catch (f) {
155
+ Jn(t).warn("Error when initializing plugin", f);
156
+ }
157
+ };
158
+ t.container.get("$instance") ? h(!0) : t.events.subscribeOnce("widget:instance-created", () => h(!1));
159
+ }
160
+ ).createCommand(
161
+ "container.register",
162
+ (t) => (e, r) => {
163
+ t.container.register(e, r);
164
+ }
165
+ ).createCommand(
166
+ "container.registerAsync",
167
+ (t) => (e, r) => {
168
+ t.container.registerAsync(e, r);
169
+ }
170
+ ).createCommand(
171
+ "container.registerFactory",
172
+ (t) => (e, r) => {
173
+ t.container.registerFactory(e, r);
174
+ }
175
+ ).createCommand(
176
+ "container.touch",
177
+ (t) => (e, r) => {
178
+ t.container.touch(e, r);
179
+ }
180
+ ).createCommand(
181
+ "csp",
182
+ {},
183
+ (t) => (e) => {
184
+ t.container.register("csp", e);
185
+ }
186
+ );
187
+ });
188
+ var sn = /* @__PURE__ */ ((n) => (n.Activating = "activating", n.Loading = "loading", n.Activated = "activated", n.Deactivating = "deactivating", n.Deactivated = "deactivated", n))(sn || {});
189
+ let Yn = class {
190
+ /**
191
+ * Creates a new `Widget` instance.
192
+ * @param container The `Container` instance to base the widget upon.
193
+ */
194
+ constructor(t) {
195
+ this.container = t, this.widget = t.get("$widget"), this.settings = t.get("$settings"), this.events = this.widget.events, this.widget.events.subscribe("settings:change", (e, r) => {
196
+ this.settings = r;
197
+ });
198
+ }
199
+ };
200
+ var Ae = Object.getOwnPropertySymbols, Gn = Object.prototype.hasOwnProperty, Qn = Object.prototype.propertyIsEnumerable, Zn = (n, t) => {
201
+ var e = {};
202
+ for (var r in n)
203
+ Gn.call(n, r) && t.indexOf(r) < 0 && (e[r] = n[r]);
204
+ if (n != null && Ae)
205
+ for (var r of Ae(n))
206
+ t.indexOf(r) < 0 && Qn.call(n, r) && (e[r] = n[r]);
207
+ return e;
208
+ };
209
+ function Xn(n = {}) {
210
+ const t = n, {
211
+ phrase: e = "",
212
+ category: r,
213
+ guideCategory: s,
214
+ contactCategory: i,
215
+ take: o,
216
+ connectionKey: a,
217
+ accordion: c,
218
+ id: h,
219
+ uriName: u,
220
+ sorting: l,
221
+ tag: d,
222
+ tagId: f,
223
+ tagTitle: g
224
+ } = t, E = Zn(t, [
225
+ "phrase",
226
+ "category",
227
+ "guideCategory",
228
+ "contactCategory",
229
+ "take",
230
+ "connectionKey",
231
+ "accordion",
232
+ "id",
233
+ "uriName",
234
+ "sorting",
235
+ "tag",
236
+ "tagId",
237
+ "tagTitle"
238
+ ]), p = {};
239
+ return Object.keys(E).forEach((C) => {
240
+ typeof n[C] == "string" && (p[C] = n[C]);
241
+ }), typeof e == "string" && e.length && (p.phrase = e), e === null && (p.phrase = e), typeof s == "string" && s !== "0" && (p.guideCategory = s), typeof s == "number" && s !== 0 && (p.guideCategory = s), typeof s == "object" && s !== null && (typeof s.id == "string" && s.id !== "0" && (p.guideCategory = s.id), typeof s.id == "number" && s.id !== 0 && (p.guideCategory = s.id)), typeof i == "string" && i !== "0" && (p.contactCategory = i), typeof i == "number" && i !== 0 && (p.contactCategory = i), typeof i == "object" && i !== null && (typeof i.id == "string" && i.id !== "0" && (p.contactCategory = i.id), typeof i.id == "number" && i.id !== 0 && (p.contactCategory = i.id)), typeof r == "string" && r !== "0" && (p.category = r), typeof r == "number" && r !== 0 && (p.category = r), typeof r == "object" && r !== null && (typeof r.id == "string" && r.id !== "0" && (p.category = r.id), typeof r.id == "number" && r.id !== 0 && (p.category = r.id)), h && (p.id = h), u && (+p.category || +p.guideCategory || +p.guide || +p.contactCategory || +p.contactMethod) && (p.uriName = u), a && (p.connectionKey = a), o && (p.take = o), l && (p.sorting = l), typeof c == "string" && c.length > 0 && (p.accordion = c), typeof d == "string" && d !== "0" && (p.tag = d), typeof d == "number" && d !== 0 && (p.tag = d), Array.isArray(d) && d.length && (p.tag = d), (typeof f == "string" || typeof f == "number") && (p.tagId = f), typeof g == "string" && (p.tagTitle = g), typeof p.tag == "string" && (p.tag = p.tag.split(",")), p;
242
+ }
243
+ const Jt = (n, t, ...e) => typeof t == "string" ? n(`[humany] ${t}`, ...e) : n(t, ...e), bt = class {
244
+ constructor() {
245
+ this.keys = [], this.log = (t, ...e) => this.lookup(t, () => bt.log(...e)), this.warn = (t, ...e) => this.lookup(t, () => bt.warn(...e)), this.error = (t, ...e) => this.lookup(t, () => bt.error(...e)), this.info = (t, ...e) => this.lookup(t, () => bt.info(...e));
246
+ }
247
+ lookup(t, e) {
248
+ this.keys.indexOf(t) === -1 && (this.keys.push(t), e());
249
+ }
250
+ };
251
+ let I = bt;
252
+ I.log = (...n) => Jt(console.log, ...n);
253
+ I.warn = (...n) => Jt(console.warn, ...n);
254
+ I.error = (...n) => Jt(console.error, ...n);
255
+ I.info = (...n) => Jt(console.info, ...n);
256
+ const on = (n) => {
257
+ let t = {}, e, r;
258
+ if (typeof n != "object" || n === null)
259
+ return n;
260
+ t = Array.isArray(n) ? [] : {};
261
+ for (r in n)
262
+ e = n[r], t[r] = typeof e == "object" && e !== null ? on(e) : e;
263
+ return t;
264
+ }, tr = on;
265
+ function Ne(n) {
266
+ let t = 0;
267
+ if (n.length === 0)
268
+ return t.toString();
269
+ for (let e = 0; e < n.length; e++) {
270
+ const r = n.charCodeAt(e);
271
+ t = (t << 5) - t + r, t = t & t;
272
+ }
273
+ return t.toString();
274
+ }
275
+ let er = class {
276
+ constructor(t, e) {
277
+ this.lockWarningTime = t, this.lockErrorTime = e, this.tasks = [], this.current = Promise.resolve(), this.next = this.next.bind(this);
278
+ }
279
+ add(t, e, r, s) {
280
+ this.tasks.push({ task: t, resolve: e, reject: r, done: s }), this.next();
281
+ }
282
+ next() {
283
+ this.current = this.current.then(() => {
284
+ const t = this.tasks.shift();
285
+ if (t) {
286
+ let e;
287
+ const r = setTimeout(() => {
288
+ process.env.NODE_ENV !== "production" && I.warn(
289
+ `A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,
290
+ t
291
+ ), e = setTimeout(() => {
292
+ t.reject("lock timeout exceeded");
293
+ }, this.lockErrorTime);
294
+ }, this.lockWarningTime), s = Promise.resolve(t.task()).then((i) => (clearTimeout(r), clearTimeout(e), i));
295
+ return Promise.resolve(s).then(this.next).then(
296
+ () => s.then((i) => {
297
+ t.done(), t.resolve(i);
298
+ })
299
+ ).catch((i) => (t.done(), t.reject(i), this.next()));
300
+ }
301
+ return Promise.resolve();
302
+ });
303
+ }
304
+ };
305
+ const kt = /* @__PURE__ */ new WeakMap();
306
+ function G(n, t = 5e3, e = 1e3) {
307
+ return kt.has(n) || kt.set(n, new er(t, e)), (r) => new Promise((s, i) => {
308
+ const o = kt.get(n);
309
+ o.add(r, s, i, () => {
310
+ o.tasks.length || kt.delete(n);
311
+ });
312
+ });
313
+ }
314
+ const nr = (n, t) => {
315
+ const e = () => t.querySelectorAll("[data-loading=true]").length > 0, r = (() => {
316
+ let s = !1;
317
+ return () => {
318
+ s || (n.get("$widget").events.dispatch("widget:data-loaded", {
319
+ element: t
320
+ }), s = !0);
321
+ };
322
+ })();
323
+ if (!e())
324
+ return r();
325
+ new MutationObserver((s, i) => {
326
+ s.find(
327
+ (o) => o.type === "attributes" && o.attributeName === "data-loading"
328
+ ) && !e() && (i.disconnect(), r());
329
+ }).observe(t, {
330
+ attributes: !0,
331
+ childList: !0,
332
+ subtree: !0
333
+ });
334
+ }, rr = (n, t) => {
335
+ n.get("$widget").container.getAsync("components").then((e) => {
336
+ e.events.subscribeOnce("components:component-model-initialized", () => {
337
+ let r = e.nodes.visible.reduce(
338
+ (i, o) => (!o.name || !o.type || o.type === "view" || o.type === "root" || o.attributes.layout.size === "none" || t.querySelector(`[data-name="${o.name}"]`) || i.push(o.name), i),
339
+ []
340
+ ), s = !1;
341
+ new MutationObserver((i, o) => {
342
+ i.forEach((a) => {
343
+ if (a.addedNodes) {
344
+ const c = Array.from(
345
+ a.addedNodes
346
+ ).reduce((h, u) => {
347
+ const l = u.getAttribute && u.getAttribute("data-name");
348
+ return l && r.indexOf(l) > -1 && h.push(l), h;
349
+ }, []);
350
+ r = r.filter((h) => c.indexOf(h) === -1), !s && r.length === 0 && (s = !0, nr(n, t), o.disconnect());
351
+ }
352
+ });
353
+ }).observe(t, {
354
+ attributes: !1,
355
+ characterData: !1,
356
+ childList: !0,
357
+ subtree: !0,
358
+ attributeOldValue: !1,
359
+ characterDataOldValue: !1
360
+ });
361
+ });
362
+ });
363
+ }, sr = rr, ir = (n = {}) => (Object.keys(n).forEach((t) => {
364
+ (n[t] === null || typeof n[t] == "undefined") && delete n[t];
365
+ }), n), lt = ir, Le = (n, t) => {
366
+ let e = !0;
367
+ return Object.keys(n).length !== Object.keys(t).length || Object.keys(n).some((r) => !Object.keys(t).some((s) => r === s)) ? !1 : (Object.keys(n).forEach((r) => {
368
+ if (e) {
369
+ const s = typeof n[r] == "undefined" ? "" : n[r], i = typeof t[r] == "undefined" ? "" : t[r];
370
+ e = s.toString() === i.toString();
371
+ }
372
+ }), e);
373
+ }, nt = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
374
+ function Pt() {
375
+ return nt() + nt() + "-" + nt() + "-" + nt() + "-" + nt() + "-" + nt() + nt() + nt();
376
+ }
377
+ var or = Object.defineProperty, ar = Object.defineProperties, cr = Object.getOwnPropertyDescriptors, Me = Object.getOwnPropertySymbols, hr = Object.prototype.hasOwnProperty, ur = Object.prototype.propertyIsEnumerable, De = (n, t, e) => t in n ? or(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, lr = (n, t) => {
378
+ for (var e in t || (t = {}))
379
+ hr.call(t, e) && De(n, e, t[e]);
380
+ if (Me)
381
+ for (var e of Me(t))
382
+ ur.call(t, e) && De(n, e, t[e]);
383
+ return n;
384
+ }, dr = (n, t) => ar(n, cr(t));
385
+ class pr {
386
+ constructor(t) {
387
+ const { events: e } = t.get("$widget");
388
+ this.events = e.createChild(this);
389
+ }
390
+ action(t, e, r) {
391
+ this.events.dispatch("data:action", { action: e, value: r, target: t }, { bubbles: !0 });
392
+ }
393
+ subscribe(t, e) {
394
+ return this.events.subscribe(
395
+ "data:action",
396
+ (r, { action: s, value: i, target: o }) => t === o && e(t, s, i)
397
+ );
398
+ }
399
+ }
400
+ const an = (n) => {
401
+ const t = [];
402
+ return [
403
+ (e, r) => {
404
+ t.push(n.subscribe(e, r));
405
+ },
406
+ () => {
407
+ t.forEach((e) => {
408
+ e();
409
+ });
410
+ }
411
+ ];
412
+ };
413
+ let yt = class {
414
+ constructor(t, e = []) {
415
+ this.platform = t, this.rules = e;
416
+ }
417
+ match(t) {
418
+ return this.rules.every((e) => !(e.id && e.id !== t.id || e.type && e.type !== t.type));
419
+ }
420
+ ofType(t) {
421
+ return this.rules.push({ type: t }), this;
422
+ }
423
+ withId(t) {
424
+ return this.rules.push({ id: t }), this;
425
+ }
426
+ select() {
427
+ return new fr(this.platform, this);
428
+ }
429
+ };
430
+ class me {
431
+ constructor(t, e, r) {
432
+ this.platform = t, this.node = e, this.actions = new qt(
433
+ t,
434
+ new yt(t).withId(e.id),
435
+ r
436
+ );
437
+ const [s, i] = an(this.platform.events);
438
+ this.subscribe = s, this.unsubscribe = i;
439
+ }
440
+ properties(t) {
441
+ return t && this.node.touchProperties((e) => t(e)), this.node.attributes.properties;
442
+ }
443
+ context(t) {
444
+ return t && this.subscribe("components:context-changed", (e, { node: r }) => {
445
+ r === this.node && t(this.node.attributes.context);
446
+ }), this.node.attributes.context;
447
+ }
448
+ layout(t) {
449
+ return t && this.subscribe("components:layout-changed", (e, { node: r }) => {
450
+ r === this.node && t(this.node.attributes.layout);
451
+ }), this.node.attributes.layout;
452
+ }
453
+ writeProperties(t, e) {
454
+ this.node.writeProperties(t, e);
455
+ }
456
+ writeContext(t, e) {
457
+ this.node.writeProperties(t, e);
458
+ }
459
+ writeLayout(t, e) {
460
+ this.node.writeLayout(t, e);
461
+ }
462
+ dispose() {
463
+ this.unsubscribe(), this.actions.dispose();
464
+ }
465
+ }
466
+ class fr {
467
+ constructor(t, e, r = !0) {
468
+ this.platform = t, this.target = e, this.clearOnDispose = r, this.removes = [], this.actions = new qt(this.platform, this.target);
469
+ }
470
+ writeProperties(t, e) {
471
+ this.removes.push(
472
+ this.platform.write({
473
+ options: e,
474
+ attributes: { properties: t },
475
+ target: this.target,
476
+ removable: this.clearOnDispose
477
+ })
478
+ );
479
+ }
480
+ writeContext(t, e) {
481
+ this.removes.push(
482
+ this.platform.write({
483
+ options: e,
484
+ attributes: { context: t },
485
+ target: this.target,
486
+ removable: this.clearOnDispose
487
+ })
488
+ );
489
+ }
490
+ writeLayout(t, e) {
491
+ this.removes.push(
492
+ this.platform.write({
493
+ options: e,
494
+ attributes: { layout: t },
495
+ target: this.target,
496
+ removable: this.clearOnDispose
497
+ })
498
+ );
499
+ }
500
+ dispose() {
501
+ this.removes.forEach((t) => {
502
+ t();
503
+ }), this.actions.dispose();
504
+ }
505
+ }
506
+ const gr = (n, t, e) => {
507
+ const r = n.concat(), s = (i, o, a) => {
508
+ let c = !0;
509
+ if (r.length) {
510
+ const h = r.shift(), u = (l, d) => (c = !1, s(l, Object.assign({}, o, d), a));
511
+ return Promise.resolve(h(i, u, a)).then((l) => dr(lr({}, l), {
512
+ cancelled: c
513
+ }));
514
+ }
515
+ return Promise.resolve({ data: i, cancelled: !1, options: o });
516
+ };
517
+ return s(t, {}, e);
518
+ };
519
+ let qt = class {
520
+ constructor(t, e, r) {
521
+ this.platform = t, this.target = e, this.ns = r, this.subscriptions = [], this.create = this.create.bind(this);
522
+ }
523
+ create(t, e = () => {
524
+ }) {
525
+ const r = {
526
+ key: t,
527
+ fn: e,
528
+ target: this.target,
529
+ ns: this.ns
530
+ };
531
+ this.platform.actionsState.handlers.push(r);
532
+ const s = () => {
533
+ const i = this.platform.actionsState.handlers.indexOf(r);
534
+ i > -1 && this.platform.actionsState.handlers.splice(i, 1);
535
+ };
536
+ return this.subscriptions.push(s), s;
537
+ }
538
+ dispatch(t, e) {
539
+ const r = this.platform.nodes.all.concat(
540
+ this.platform.nodes.detached
541
+ ), s = {}, i = this.platform.actionsState.handlers.filter(
542
+ (o) => o.key === t && (!o.ns || !this.ns || o.ns === this.ns)
543
+ );
544
+ return Promise.all(
545
+ i.map((o) => {
546
+ const a = r.filter(
547
+ (h) => o.target.match(h) && this.target.match(h)
548
+ ), c = this.platform.actionsState.watchers.filter((h) => h.key === t && (!h.ns || !this.ns || h.ns === this.ns) && a.some((u) => h.target.match(u))).map((h) => h.fn);
549
+ return Promise.all(
550
+ a.map((h) => {
551
+ const u = new me(
552
+ this.platform,
553
+ h,
554
+ this.ns
555
+ );
556
+ return gr(c, e, u).then((l) => {
557
+ const { data: d = {}, options: f, cancelled: g } = l;
558
+ return Promise.resolve(
559
+ g ? {} : o.fn(d, f, u)
560
+ ).then((E) => {
561
+ s[h.id] = E;
562
+ });
563
+ });
564
+ })
565
+ );
566
+ })
567
+ ).then(() => s);
568
+ }
569
+ watch(t, e) {
570
+ let r = t, s = this.ns;
571
+ const i = t.split(".");
572
+ i.length > 1 && (s = i[0], r = i.splice(1).join("."));
573
+ const o = {
574
+ fn: e,
575
+ target: this.target,
576
+ key: r,
577
+ ns: s
578
+ };
579
+ this.platform.actionsState.watchers.push(o);
580
+ const a = () => {
581
+ const c = this.platform.actionsState.watchers.indexOf(o);
582
+ c > -1 && this.platform.actionsState.watchers.splice(c, 1);
583
+ };
584
+ return this.subscriptions.push(a), a;
585
+ }
586
+ dispose() {
587
+ this.subscriptions.forEach((t) => t());
588
+ }
589
+ };
590
+ ge((n) => {
591
+ n.createCommand("components", (t) => (e) => {
592
+ t.events.subscribeOnce("components:platform-created", (r, { platform: s }) => {
593
+ e.handlers && e.handlers.forEach(([i, o]) => {
594
+ s.addComponentHandler(i, o);
595
+ });
596
+ });
597
+ });
598
+ });
599
+ let de = class {
600
+ constructor(t, e) {
601
+ this.events = t, this.tags = [], this.children = {}, this.changesets = [], this.mountCount = 0, this.id = Pt(), this.type = e, this.attributes = {
602
+ context: {},
603
+ properties: {},
604
+ layout: {},
605
+ tags: []
606
+ }, this.writeLayout({ size: "full", indent: 0 });
607
+ }
608
+ mount(t, e) {
609
+ let r = t.get("mounted-nodes");
610
+ return r || (r = /* @__PURE__ */ new Map(), t.register("mounted-nodes", r)), r.has(this) ? (process.env.NODE_ENV !== "production" && I.error("Trying to mount an already mounted component node.", this), () => {
611
+ }) : (this.events.dispatch("components:node-mounted", { node: this }), this.mountCount === 0 && (this.mountCount = this.mountCount + 1, this.events.dispatch("components:node-enter", { node: this })), () => {
612
+ r.delete(this), this.events.dispatch("components:node-unmounted", { node: this }), this.mountCount = this.mountCount - 1, this.mountCount === 0 && this.events.dispatch("components:node-exit", { node: this });
613
+ });
614
+ }
615
+ appendChild(t, e = "default") {
616
+ if (t.parent) {
617
+ if (t.parent === this)
618
+ return;
619
+ t.parent.removeChild(t);
620
+ }
621
+ t.parent = this, this.children[e] || (this.children[e] = []), this.children[e].push(t), this.events.dispatch("components:node-appended", { node: t });
622
+ }
623
+ prependChild(t, e = "default") {
624
+ if (t.parent) {
625
+ if (t.parent === this)
626
+ return;
627
+ t.parent.removeChild(t);
628
+ }
629
+ t.parent = this, this.children[e] || (this.children[e] = []), this.children[e].unshift(t), this.events.dispatch("components:node-appended", { node: t });
630
+ }
631
+ touchProperties(t, e = {}, r) {
632
+ const s = [{ properties: t }, e];
633
+ return this.changesets.push(s), this.events.dispatch("components:set-properties", { node: this }), () => {
634
+ if (r) {
635
+ const i = this.changesets.indexOf(s);
636
+ i > -1 && (this.changesets.splice(i, 1), this.events.dispatch("components:set-properties", { node: this }));
637
+ }
638
+ };
639
+ }
640
+ writeProperties(t, e = {}, r) {
641
+ const s = [{ properties: t }, e];
642
+ return this.changesets.push(s), this.events.dispatch("components:set-properties", { node: this }), () => {
643
+ if (r) {
644
+ const i = this.changesets.indexOf(s);
645
+ i > -1 && (this.changesets.splice(i, 1), this.events.dispatch("components:set-properties", { node: this }));
646
+ }
647
+ };
648
+ }
649
+ writeLayout(t, e = {}, r) {
650
+ const s = [{ layout: t }, e];
651
+ return this.changesets.push(s), this.events.dispatch("components:set-layout", { node: this }), () => {
652
+ if (!r)
653
+ return;
654
+ const i = this.changesets.indexOf(s);
655
+ i > -1 && (this.changesets.splice(i, 1), this.events.dispatch("components:set-layout", { node: this }));
656
+ };
657
+ }
658
+ writeContext(t, e = {}, r) {
659
+ const s = [{ context: t }, e];
660
+ return this.changesets.push(s), this.events.dispatch("components:set-context", { node: this }), () => {
661
+ if (!r)
662
+ return;
663
+ const i = this.changesets.indexOf(s);
664
+ i > -1 && (this.changesets.splice(i, 1), this.events.dispatch("components:set-context", { node: this }));
665
+ };
666
+ }
667
+ getChildren(t = "default") {
668
+ const e = this.children[t] || [];
669
+ return e.reduce((r, s, i) => {
670
+ const { order: o = i } = s.attributes.layout;
671
+ return r[o] ? r.splice(o, 0, s) : r[o] = s, r;
672
+ }, Array(e.length));
673
+ }
674
+ remove() {
675
+ this.parent && this.parent.removeChild(this);
676
+ }
677
+ removeChild(t) {
678
+ Object.keys(this.children).forEach((e) => {
679
+ const r = this.children[e], s = r.indexOf(t);
680
+ s > -1 && (r.splice(s, 1), this.events.dispatch("components:node-removed", { node: t, parentNode: this }));
681
+ }), delete t.parent;
682
+ }
683
+ };
684
+ const cn = (n, t, e) => {
685
+ for (let r = 0, s = n.length; r < s && e(n[r]) !== !0; r++) {
686
+ const i = t[n[r].id] || "default", o = n[r].getChildren(i);
687
+ cn(o, t, e);
688
+ }
689
+ }, Kt = (n, t, e) => {
690
+ if (e(n) !== !0) {
691
+ const r = t[n.id] || "default", s = n.children[r];
692
+ cn(s, t, e);
693
+ }
694
+ }, Dt = (n, t) => {
695
+ const e = [];
696
+ return Kt(n, t, (r) => {
697
+ e.push(r);
698
+ }), e;
699
+ }, hn = (n, t, e) => {
700
+ let r;
701
+ return Kt(n, t, (s) => {
702
+ if (e(s))
703
+ return r = s, !0;
704
+ }), r;
705
+ };
706
+ let mr = class {
707
+ constructor(t, e, r) {
708
+ this.root = t, this.switches = e, this.all = [], this.visible = [], this.detached = [], r.subscribe("components:node-appended", (s, i) => {
709
+ this.all.push(i.node), this.visible = Dt(t, e);
710
+ }), r.subscribe("components:node-removed", (s, i) => {
711
+ let o = this.all.indexOf(i.node);
712
+ o > -1 && this.all.splice(o, 1), o = this.visible.indexOf(i.node), o > -1 && this.visible.splice(o, 1), this.visible = Dt(t, e);
713
+ }), r.subscribe("components:node-switched", (s, i) => {
714
+ this.visible = Dt(t, e);
715
+ });
716
+ }
717
+ query(t = {}) {
718
+ const e = [];
719
+ return Kt(this.root, this.switches, (r) => {
720
+ Object.keys(t).every((s) => t[s] === r[s]) && e.push(r);
721
+ }), e;
722
+ }
723
+ get(t) {
724
+ return hn(this.root, this.switches, (e) => e.id === t) || this.detached.find((e) => e.id === t);
725
+ }
726
+ }, yr = class {
727
+ constructor() {
728
+ this.handlers = /* @__PURE__ */ new Map();
729
+ }
730
+ add(t, e) {
731
+ this.handlers.set(t, e);
732
+ }
733
+ get(t) {
734
+ return this.handlers.get(t);
735
+ }
736
+ };
737
+ const vr = (n) => {
738
+ let t = n, e = 0;
739
+ for (; t.parent; )
740
+ e = e + 1, t = t.parent;
741
+ return e;
742
+ }, br = (n) => n.map(([t, e]) => [vr(t), t, e]).sort(([t], [e]) => t - e).map(([, t, e]) => [t, e]), ee = (n) => n instanceof Date ? !1 : n && typeof n == "object" && !Array.isArray(n), Q = (n, ...t) => {
743
+ if (!t.length)
744
+ return n;
745
+ const e = t.shift();
746
+ if (ee(n) && ee(e))
747
+ for (const r in e)
748
+ ee(e[r]) ? (n[r] || Object.assign(n, { [r]: {} }), Q(n[r], e[r])) : Object.assign(n, { [r]: e[r] });
749
+ return Q(n, ...t);
750
+ }, wr = (n, t) => !n || n === "all" ? !0 : n.some((e) => t.indexOf(e) > -1), Or = (n, t) => {
751
+ let e = [], r = [], s;
752
+ const i = () => {
753
+ process.env.NODE_ENV !== "production" && console.time("state-processor.flush");
754
+ const a = /* @__PURE__ */ new Map(), c = br(e.map((u, l) => [u, r[l]])), h = (u, l) => {
755
+ var d;
756
+ const f = a.get(u) || {}, g = l.context && !f.context, E = l.properties && !f.properties, p = l.layout && !f.layout;
757
+ a.set(u, {
758
+ context: f.context || g,
759
+ properties: f.properties || E,
760
+ layout: f.layout || p
761
+ }), E && (u.attributes.properties = {}), p && (u.attributes.layout = {}), g && (u.attributes.context = Q({}, (d = u.parent) == null ? void 0 : d.attributes.context));
762
+ const C = [], R = [], B = [];
763
+ if (u.changesets.forEach((_) => {
764
+ const [D, H] = _;
765
+ wr(H.breakpoints, n.breakpoints) && (E && (typeof D.properties == "function" ? C.push(
766
+ D.properties
767
+ ) : Q(u.attributes.properties, D.properties)), p && (typeof D.layout == "function" ? R.push(D.layout) : Q(u.attributes.layout, D.layout)), g && (typeof D.context == "function" ? B.push(D.context) : Q(u.attributes.context, D.context)));
768
+ }), C.forEach((_) => {
769
+ Q(u.attributes.properties, _(u.attributes.properties));
770
+ }), R.forEach((_) => {
771
+ Q(u.attributes.layout, _(u.attributes.layout));
772
+ }), B.forEach((_) => {
773
+ Q(u.attributes.context, _(u.attributes.context));
774
+ }), g || l.recursive) {
775
+ const _ = n.getBranch(u), D = l.recursive ? l : {
776
+ context: !!g
777
+ };
778
+ u.getChildren(_).forEach((H) => {
779
+ h(H, D);
780
+ });
781
+ }
782
+ };
783
+ process.env.NODE_ENV !== "production" && console.timeEnd("state-processor.flush"), c.forEach(([u, l]) => {
784
+ h(u, l);
785
+ }), e = [], r = [], t(a);
786
+ }, o = () => {
787
+ clearTimeout(s), s = setTimeout(i, 0);
788
+ };
789
+ return (a, c) => {
790
+ const h = e.indexOf(a);
791
+ if (h > -1) {
792
+ const u = r[h];
793
+ return c.context && (u.context = !0), c.properties && (u.properties = !0), c.layout && (u.layout = !0), c.recursive && (u.recursive = !0), o();
794
+ }
795
+ return e.push(a), r.push(c), o();
796
+ };
797
+ };
798
+ let Yt = class {
799
+ constructor(t, e = {}) {
800
+ this.providers = e, this.breakpoints = [], this.actionsState = { handlers: [], watchers: [] }, this.switches = {}, this.changesets = [], this.subscriptions = [], this.customComponentHandler = new yr(), this.events = t.events.createChild(this);
801
+ const r = new de(this.events, "root");
802
+ r.name = `root-${t.name}`, this.nodes = new mr(r, this.switches, this.events);
803
+ const s = this.processNode = Or(this, (i) => {
804
+ const o = Array.from(i.keys());
805
+ process.env.NODE_ENV !== "production" && console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
806
+ ${o.map(
807
+ (a) => `${a.name || "<no name>"} (${a.id})
808
+ `
809
+ )}`), o.forEach((a) => {
810
+ const c = i.get(a);
811
+ a.parent && a.parent.type === "root" && this.events.dispatch("components:root-children-changed", { node: a }), c != null && c.context && this.events.dispatch("components:context-changed", { node: a }), c != null && c.properties && this.events.dispatch("components:properties-changed", { node: a }), c != null && c.layout && this.events.dispatch("components:layout-changed", { node: a });
812
+ }), this.events.dispatch("components:component-model-initialized", {}, { bubbles: !0 });
813
+ });
814
+ Promise.all(
815
+ Object.keys(e).map((i) => e[i].load(this))
816
+ ), this.subscriptions.push(
817
+ this.events.subscribe(
818
+ "components:node-appended",
819
+ (i, o) => {
820
+ const { node: a } = o;
821
+ this.changesets.forEach((c) => {
822
+ const { changeset: h, target: u, removes: l } = c, [d, f] = h;
823
+ u.match(o.node) && (d.properties && l.push(a.writeProperties(d.properties, f)), d.context && l.push(a.writeContext(d.context, f)), d.layout && l.push(a.writeLayout(d.layout, f)));
824
+ });
825
+ }
826
+ )
827
+ ), this.subscriptions.push(
828
+ this.events.subscribe(
829
+ "components:node-appended",
830
+ (i, o) => {
831
+ s(o.node, { properties: !0, context: !0 });
832
+ }
833
+ )
834
+ ), this.subscriptions.push(
835
+ this.events.subscribe(
836
+ "components:set-properties",
837
+ (i, o) => {
838
+ s(o.node, { properties: !0 });
839
+ }
840
+ )
841
+ ), this.subscriptions.push(
842
+ this.events.subscribe(
843
+ "components:set-context",
844
+ (i, o) => {
845
+ s(o.node, { properties: !0, context: !0 });
846
+ }
847
+ )
848
+ ), this.subscriptions.push(
849
+ this.events.subscribe(
850
+ "components:set-indent",
851
+ (i, o) => {
852
+ s(o.node, { layout: !0 });
853
+ }
854
+ )
855
+ ), this.subscriptions.push(
856
+ this.events.subscribe(
857
+ "components:set-layout",
858
+ (i, o) => {
859
+ s(o.node, { layout: !0 });
860
+ }
861
+ )
862
+ ), this.subscriptions.push(
863
+ this.events.subscribe("components:node-switched", (i, { node: o, branch: a }) => {
864
+ s(o, {
865
+ layout: !0,
866
+ recursive: !0,
867
+ properties: !0,
868
+ context: !0
869
+ });
870
+ })
871
+ ), this.subscriptions.push(
872
+ this.events.subscribe("components:node-removed", (i, { parentNode: o }) => {
873
+ s(o, { properties: !0 });
874
+ })
875
+ ), this.events.parent && this.events.parent.dispatch("components:platform-created", { platform: this });
876
+ }
877
+ static getInstance(t) {
878
+ return t.getAsync("components");
879
+ }
880
+ addBreakpoint(t) {
881
+ this.breakpoints.indexOf(t) === -1 && (this.breakpoints.push(t), this.processNode(this.nodes.root, {
882
+ context: !0,
883
+ properties: !0,
884
+ layout: !0,
885
+ recursive: !0
886
+ }));
887
+ }
888
+ removeBreakpoint(t) {
889
+ const e = this.breakpoints.indexOf(t);
890
+ e > -1 && (this.breakpoints.splice(e, 1), this.processNode(this.nodes.root, {
891
+ context: !0,
892
+ properties: !0,
893
+ layout: !0,
894
+ recursive: !0
895
+ }));
896
+ }
897
+ setSwitch(t, e) {
898
+ this.switches[t.id] = e, this.events.dispatch("components:node-switched", { node: t, branch: e });
899
+ }
900
+ getBranch(t) {
901
+ return this.switches[t.id];
902
+ }
903
+ /**
904
+ * Creates a `ComponentNode` of the specified type.
905
+ * @param type Type of node.
906
+ */
907
+ createNode(t, e = {}) {
908
+ const r = new de(this.events, t);
909
+ return e.detached && this.nodes.detached.push(r), r;
910
+ }
911
+ components() {
912
+ return new yt(this);
913
+ }
914
+ actions(t, e) {
915
+ return new qt(this, t, e);
916
+ }
917
+ write(t) {
918
+ const { provider: e, target: r, attributes: s, options: i = {}, removable: o } = t, a = t.key || Pt(), c = { changeset: [s, i], target: r, removes: [] };
919
+ if (e) {
920
+ const h = this.providers[e];
921
+ h.write(a, r, s, i), c.removes.push(() => {
922
+ h.remove(a);
923
+ });
924
+ }
925
+ return this.changesets.push(c), this.nodes.all.forEach((h) => {
926
+ if (r.match(h)) {
927
+ let u = () => {
928
+ };
929
+ s.properties && (u = h.writeProperties(s.properties, i, o)), s.context && (u = h.writeContext(s.context, i, o)), s.layout && (u = h.writeContext(s.layout, i, o)), c.removes.push(u);
930
+ }
931
+ }), () => {
932
+ if (o) {
933
+ c.removes.forEach((u) => u());
934
+ const h = this.changesets.indexOf(c);
935
+ h > -1 && this.changesets.splice(h, 1);
936
+ }
937
+ };
938
+ }
939
+ addComponentHandler(t, e) {
940
+ this.customComponentHandler.add(t, e);
941
+ }
942
+ getComponentHandler(t) {
943
+ return this.customComponentHandler.get(t);
944
+ }
945
+ dispose() {
946
+ this.subscriptions.forEach((t) => t());
947
+ }
948
+ };
949
+ const Er = (n) => {
950
+ if (Array.isArray(n)) {
951
+ const [t, ...e] = n;
952
+ return {
953
+ definitionId: t,
954
+ overrides: e
955
+ };
956
+ }
957
+ return {
958
+ definitionId: n,
959
+ overrides: []
960
+ };
961
+ }, Vt = (n, t, e, r, s, i) => {
962
+ e.forEach((o) => {
963
+ const a = Er(o), c = r[a.definitionId];
964
+ if (a.definitionId === "view") {
965
+ const h = n.createNode("view");
966
+ h.name = "view", Object.keys(s).forEach((u) => {
967
+ const l = s[u];
968
+ Vt(n, h, [l.entry], r, s, u);
969
+ }), t.appendChild(h), a.overrides.forEach((u) => {
970
+ u.properties && h.writeProperties(u.properties, {
971
+ breakpoints: u.breakpoints
972
+ }), u.context && h.writeContext(u.context, { breakpoints: u.breakpoints }), u.layout && h.writeLayout(u.layout, { breakpoints: u.breakpoints });
973
+ });
974
+ } else if (n.getComponentHandler(c.type)) {
975
+ const h = n.getComponentHandler(c.type);
976
+ h && h(a, {
977
+ platform: n,
978
+ node: t,
979
+ references: e,
980
+ definitions: r,
981
+ views: s,
982
+ branch: i
983
+ });
984
+ } else {
985
+ const h = r[a.definitionId];
986
+ if (process.env.NODE_ENV !== "production" && !h) {
987
+ I.error(
988
+ `No definition found for component type '${a.definitionId}'.`
989
+ );
990
+ return;
991
+ }
992
+ const u = n.createNode(h.type);
993
+ u.name = a.definitionId, u.tags = h.tags || [], h.properties && u.writeProperties(h.properties), h.context && u.writeContext(h.context), h.layout && u.writeLayout(h.layout), t.appendChild(u, i), a.overrides.forEach((l) => {
994
+ const d = { breakpoints: l.breakpoints };
995
+ l.properties && u.writeProperties(l.properties, d), l.context && u.writeContext(l.context, d), l.layout && u.writeLayout(l.layout, d);
996
+ }), h.children && Vt(n, u, h.children, r, s);
997
+ }
998
+ });
999
+ }, un = (n, t) => {
1000
+ const { entry: e, components: r, breakpoints: s, views: i } = t, o = [];
1001
+ return Object.keys(s).forEach((a) => {
1002
+ const c = s[a], h = window.matchMedia(c);
1003
+ h.matches && n.breakpoints.push(a);
1004
+ const u = (l) => {
1005
+ l.matches ? n.addBreakpoint(a) : n.removeBreakpoint(a);
1006
+ };
1007
+ h.addListener(u), o.push(() => h.removeListener(u));
1008
+ }), Vt(n, n.nodes.root, [e], r, i), () => o.forEach((a) => {
1009
+ a();
1010
+ });
1011
+ }, xr = (n, t) => ({
1012
+ id: n.id,
1013
+ type: n.type,
1014
+ name: n.name,
1015
+ branch: t || "default"
1016
+ }), ln = (n, t, e, r = Pt(), s = {}) => n.getAsync("components").then((i) => {
1017
+ let o;
1018
+ if (typeof t == "string") {
1019
+ const h = new yt(i);
1020
+ h.ofType(t), o = h;
1021
+ } else
1022
+ o = t;
1023
+ const a = {}, c = (h) => {
1024
+ const u = a[h.id];
1025
+ return u ? Promise.resolve(u.controller) : Yt.getInstance(n).then((l) => new me(l, h, r));
1026
+ };
1027
+ i.events.subscribe(
1028
+ "components:node-enter",
1029
+ (h, { node: u }) => {
1030
+ o.match(u) && c(u).then((l) => {
1031
+ Promise.resolve(e(l)).then((d) => {
1032
+ a[u.id] = {
1033
+ dispose: d,
1034
+ controller: l
1035
+ };
1036
+ });
1037
+ });
1038
+ }
1039
+ ), i.events.subscribe(
1040
+ "components:node-exit",
1041
+ (h, { node: u }) => {
1042
+ const l = a[u.id];
1043
+ l && (l.dispose && l.dispose(), s.reuseController || (l.controller.dispose(), delete a[u.id]));
1044
+ }
1045
+ );
1046
+ });
1047
+ class $r {
1048
+ constructor(t) {
1049
+ this.aliases = /* @__PURE__ */ new Map(), this.components = /* @__PURE__ */ new Map(), this.logger = new I();
1050
+ const { events: e } = t.get("$widget");
1051
+ this.events = e;
1052
+ }
1053
+ getComponent(t) {
1054
+ const e = this.aliases.get(t), r = this.components.get(e || t) || null;
1055
+ return process.env.NODE_ENV !== "production" && (r || this.logger.warn(
1056
+ e || t,
1057
+ `Unable to resolve component: "${e || t}". You most likely forgot to register the required plugin for: ${e || t}.`
1058
+ )), r;
1059
+ }
1060
+ registerComponent(t, e) {
1061
+ return this.components.set(t, e), this.events.dispatch("component-resolver:resolve", t), () => {
1062
+ this.components.delete(t);
1063
+ };
1064
+ }
1065
+ registerResolver(t, e) {
1066
+ return this.events.subscribe("component-resolver:resolve", (r, s) => {
1067
+ if (s === t) {
1068
+ const i = this.getComponent(t);
1069
+ e(i);
1070
+ }
1071
+ });
1072
+ }
1073
+ registerAlias(t, e) {
1074
+ return this.aliases.set(t, e), this.events.dispatch("component-resolver:resolve", t), () => {
1075
+ this.aliases.delete(t);
1076
+ };
1077
+ }
1078
+ }
1079
+ var z = /* @__PURE__ */ ((n) => (n.open = "open", n.closed = "closed", n.hidden = "hidden", n))(z || {});
1080
+ const ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1081
+ __proto__: null,
1082
+ ActionResolver: pr,
1083
+ ActionsController: qt,
1084
+ ComponentNode: de,
1085
+ ComponentNodeController: me,
1086
+ ComponentPlatform: Yt,
1087
+ ComponentQuery: yt,
1088
+ ComponentResolver: $r,
1089
+ WidgetRenderState: z,
1090
+ asDescriptor: xr,
1091
+ createChildren: Vt,
1092
+ createComponentModel: un,
1093
+ createEventSubscriber: an,
1094
+ extendComponent: ln,
1095
+ findComponent: hn,
1096
+ findVisibleComponents: Dt,
1097
+ traverseComponents: Kt
1098
+ }, Symbol.toStringTag, { value: "Module" }));
1099
+ function dn(n) {
1100
+ return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
1101
+ }
1102
+ var pn = function() {
1103
+ };
1104
+ process.env.NODE_ENV !== "production" && (pn = function(n, t, e) {
1105
+ var r = arguments.length;
1106
+ e = new Array(r > 2 ? r - 2 : 0);
1107
+ for (var s = 2; s < r; s++)
1108
+ e[s - 2] = arguments[s];
1109
+ if (t === void 0)
1110
+ throw new Error(
1111
+ "`warning(condition, format, ...args)` requires a warning message argument"
1112
+ );
1113
+ if (t.length < 10 || /^[s\W]*$/.test(t))
1114
+ throw new Error(
1115
+ "The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: " + t
1116
+ );
1117
+ if (!n) {
1118
+ var i = 0, o = "Warning: " + t.replace(/%s/g, function() {
1119
+ return e[i++];
1120
+ });
1121
+ typeof console != "undefined" && console.error(o);
1122
+ try {
1123
+ throw new Error(o);
1124
+ } catch (a) {
1125
+ }
1126
+ }
1127
+ });
1128
+ var Pr = pn;
1129
+ const Z = /* @__PURE__ */ dn(Pr);
1130
+ var kr = function(n, t, e, r, s, i, o, a) {
1131
+ if (process.env.NODE_ENV !== "production" && t === void 0)
1132
+ throw new Error("invariant requires an error message argument");
1133
+ if (!n) {
1134
+ var c;
1135
+ if (t === void 0)
1136
+ c = new Error(
1137
+ "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
1138
+ );
1139
+ else {
1140
+ var h = [e, r, s, i, o, a], u = 0;
1141
+ c = new Error(
1142
+ t.replace(/%s/g, function() {
1143
+ return h[u++];
1144
+ })
1145
+ ), c.name = "Invariant Violation";
1146
+ }
1147
+ throw c.framesToPop = 1, c;
1148
+ }
1149
+ }, Cr = kr;
1150
+ const Sr = /* @__PURE__ */ dn(Cr);
1151
+ function Ct(n) {
1152
+ return n.charAt(0) === "/";
1153
+ }
1154
+ function ne(n, t) {
1155
+ for (var e = t, r = e + 1, s = n.length; r < s; e += 1, r += 1)
1156
+ n[e] = n[r];
1157
+ n.pop();
1158
+ }
1159
+ function Ar(n) {
1160
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", e = n && n.split("/") || [], r = t && t.split("/") || [], s = n && Ct(n), i = t && Ct(t), o = s || i;
1161
+ if (n && Ct(n) ? r = e : e.length && (r.pop(), r = r.concat(e)), !r.length)
1162
+ return "/";
1163
+ var a = void 0;
1164
+ if (r.length) {
1165
+ var c = r[r.length - 1];
1166
+ a = c === "." || c === ".." || c === "";
1167
+ } else
1168
+ a = !1;
1169
+ for (var h = 0, u = r.length; u >= 0; u--) {
1170
+ var l = r[u];
1171
+ l === "." ? ne(r, u) : l === ".." ? (ne(r, u), h++) : h && (ne(r, u), h--);
1172
+ }
1173
+ if (!o)
1174
+ for (; h--; h)
1175
+ r.unshift("..");
1176
+ o && r[0] !== "" && (!r[0] || !Ct(r[0])) && r.unshift("");
1177
+ var d = r.join("/");
1178
+ return a && d.substr(-1) !== "/" && (d += "/"), d;
1179
+ }
1180
+ var Nr = function(t) {
1181
+ return t.charAt(0) === "/" ? t : "/" + t;
1182
+ }, fn = function(t, e) {
1183
+ return new RegExp("^" + e + "(\\/|\\?|#|$)", "i").test(t);
1184
+ }, Lr = function(t, e) {
1185
+ return fn(t, e) ? t.substr(e.length) : t;
1186
+ }, Mr = function(t) {
1187
+ return t.charAt(t.length - 1) === "/" ? t.slice(0, -1) : t;
1188
+ }, Dr = function(t) {
1189
+ var e = t || "/", r = "", s = "", i = e.indexOf("#");
1190
+ i !== -1 && (s = e.substr(i), e = e.substr(0, i));
1191
+ var o = e.indexOf("?");
1192
+ return o !== -1 && (r = e.substr(o), e = e.substr(0, o)), {
1193
+ pathname: e,
1194
+ search: r === "?" ? "" : r,
1195
+ hash: s === "#" ? "" : s
1196
+ };
1197
+ }, gn = function(t) {
1198
+ var e = t.pathname, r = t.search, s = t.hash, i = e || "/";
1199
+ return r && r !== "?" && (i += r.charAt(0) === "?" ? r : "?" + r), s && s !== "#" && (i += s.charAt(0) === "#" ? s : "#" + s), i;
1200
+ }, jr = Object.assign || function(n) {
1201
+ for (var t = 1; t < arguments.length; t++) {
1202
+ var e = arguments[t];
1203
+ for (var r in e)
1204
+ Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
1205
+ }
1206
+ return n;
1207
+ }, ct = function(t, e, r, s) {
1208
+ var i = void 0;
1209
+ typeof t == "string" ? (i = Dr(t), i.state = e) : (i = jr({}, t), i.pathname === void 0 && (i.pathname = ""), i.search ? i.search.charAt(0) !== "?" && (i.search = "?" + i.search) : i.search = "", i.hash ? i.hash.charAt(0) !== "#" && (i.hash = "#" + i.hash) : i.hash = "", e !== void 0 && i.state === void 0 && (i.state = e));
1210
+ try {
1211
+ i.pathname = decodeURI(i.pathname);
1212
+ } catch (o) {
1213
+ throw o instanceof URIError ? new URIError('Pathname "' + i.pathname + '" could not be decoded. This is likely caused by an invalid percent-encoding.') : o;
1214
+ }
1215
+ return r && (i.key = r), s ? i.pathname ? i.pathname.charAt(0) !== "/" && (i.pathname = Ar(i.pathname, s.pathname)) : i.pathname = s.pathname : i.pathname || (i.pathname = "/"), i;
1216
+ }, mn = function() {
1217
+ var t = null, e = function(c) {
1218
+ return Z(t == null, "A history supports only one prompt at a time"), t = c, function() {
1219
+ t === c && (t = null);
1220
+ };
1221
+ }, r = function(c, h, u, l) {
1222
+ if (t != null) {
1223
+ var d = typeof t == "function" ? t(c, h) : t;
1224
+ typeof d == "string" ? typeof u == "function" ? u(d, l) : (Z(!1, "A history needs a getUserConfirmation function in order to use a prompt message"), l(!0)) : l(d !== !1);
1225
+ } else
1226
+ l(!0);
1227
+ }, s = [], i = function(c) {
1228
+ var h = !0, u = function() {
1229
+ h && c.apply(void 0, arguments);
1230
+ };
1231
+ return s.push(u), function() {
1232
+ h = !1, s = s.filter(function(l) {
1233
+ return l !== u;
1234
+ });
1235
+ };
1236
+ }, o = function() {
1237
+ for (var c = arguments.length, h = Array(c), u = 0; u < c; u++)
1238
+ h[u] = arguments[u];
1239
+ s.forEach(function(l) {
1240
+ return l.apply(void 0, h);
1241
+ });
1242
+ };
1243
+ return {
1244
+ setPrompt: e,
1245
+ confirmTransitionTo: r,
1246
+ appendListener: i,
1247
+ notifyListeners: o
1248
+ };
1249
+ }, _r = !!(typeof window != "undefined" && window.document && window.document.createElement), je = function(t, e, r) {
1250
+ return t.addEventListener ? t.addEventListener(e, r, !1) : t.attachEvent("on" + e, r);
1251
+ }, _e = function(t, e, r) {
1252
+ return t.removeEventListener ? t.removeEventListener(e, r, !1) : t.detachEvent("on" + e, r);
1253
+ }, Tr = function(t, e) {
1254
+ return e(window.confirm(t));
1255
+ }, Ir = function() {
1256
+ var t = window.navigator.userAgent;
1257
+ return (t.indexOf("Android 2.") !== -1 || t.indexOf("Android 4.0") !== -1) && t.indexOf("Mobile Safari") !== -1 && t.indexOf("Chrome") === -1 && t.indexOf("Windows Phone") === -1 ? !1 : window.history && "pushState" in window.history;
1258
+ }, Rr = function() {
1259
+ return window.navigator.userAgent.indexOf("Trident") === -1;
1260
+ }, Hr = function(t) {
1261
+ return t.state === void 0 && navigator.userAgent.indexOf("CriOS") === -1;
1262
+ }, Te = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1263
+ return typeof n;
1264
+ } : function(n) {
1265
+ return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1266
+ }, Vr = Object.assign || function(n) {
1267
+ for (var t = 1; t < arguments.length; t++) {
1268
+ var e = arguments[t];
1269
+ for (var r in e)
1270
+ Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
1271
+ }
1272
+ return n;
1273
+ }, Ie = "popstate", Re = "hashchange", He = function() {
1274
+ try {
1275
+ return window.history.state || {};
1276
+ } catch (t) {
1277
+ return {};
1278
+ }
1279
+ }, Wr = function() {
1280
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1281
+ Sr(_r, "Browser history needs a DOM");
1282
+ var e = window.history, r = Ir(), s = !Rr(), i = t.forceRefresh, o = i === void 0 ? !1 : i, a = t.getUserConfirmation, c = a === void 0 ? Tr : a, h = t.keyLength, u = h === void 0 ? 6 : h, l = t.basename ? Mr(Nr(t.basename)) : "", d = function(y) {
1283
+ var O = y || {}, L = O.key, M = O.state, F = window.location, J = F.pathname, et = F.search, Y = F.hash, U = J + et + Y;
1284
+ return Z(!l || fn(U, l), 'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "' + U + '" to begin with "' + l + '".'), l && (U = Lr(U, l)), ct(U, M, L);
1285
+ }, f = function() {
1286
+ return Math.random().toString(36).substr(2, u);
1287
+ }, g = mn(), E = function(y) {
1288
+ Vr(P, y), P.length = e.length, g.notifyListeners(P.location, P.action);
1289
+ }, p = function(y) {
1290
+ Hr(y) || B(d(y.state));
1291
+ }, C = function() {
1292
+ B(d(He()));
1293
+ }, R = !1, B = function(y) {
1294
+ if (R)
1295
+ R = !1, E();
1296
+ else {
1297
+ var O = "POP";
1298
+ g.confirmTransitionTo(y, O, c, function(L) {
1299
+ L ? E({ action: O, location: y }) : _(y);
1300
+ });
1301
+ }
1302
+ }, _ = function(y) {
1303
+ var O = P.location, L = H.indexOf(O.key);
1304
+ L === -1 && (L = 0);
1305
+ var M = H.indexOf(y.key);
1306
+ M === -1 && (M = 0);
1307
+ var F = L - M;
1308
+ F && (R = !0, j(F));
1309
+ }, D = d(He()), H = [D.key], x = function(y) {
1310
+ return l + gn(y);
1311
+ }, N = function(y, O) {
1312
+ Z(!((typeof y == "undefined" ? "undefined" : Te(y)) === "object" && y.state !== void 0 && O !== void 0), "You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");
1313
+ var L = "PUSH", M = ct(y, O, f(), P.location);
1314
+ g.confirmTransitionTo(M, L, c, function(F) {
1315
+ if (F) {
1316
+ var J = x(M), et = M.key, Y = M.state;
1317
+ if (r)
1318
+ if (e.pushState({ key: et, state: Y }, null, J), o)
1319
+ window.location.href = J;
1320
+ else {
1321
+ var U = H.indexOf(P.location.key), $e = H.slice(0, U === -1 ? 0 : U + 1);
1322
+ $e.push(M.key), H = $e, E({ action: L, location: M });
1323
+ }
1324
+ else
1325
+ Z(Y === void 0, "Browser history cannot push state in browsers that do not support HTML5 history"), window.location.href = J;
1326
+ }
1327
+ });
1328
+ }, A = function(y, O) {
1329
+ Z(!((typeof y == "undefined" ? "undefined" : Te(y)) === "object" && y.state !== void 0 && O !== void 0), "You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");
1330
+ var L = "REPLACE", M = ct(y, O, f(), P.location);
1331
+ g.confirmTransitionTo(M, L, c, function(F) {
1332
+ if (F) {
1333
+ var J = x(M), et = M.key, Y = M.state;
1334
+ if (r)
1335
+ if (e.replaceState({ key: et, state: Y }, null, J), o)
1336
+ window.location.replace(J);
1337
+ else {
1338
+ var U = H.indexOf(P.location.key);
1339
+ U !== -1 && (H[U] = M.key), E({ action: L, location: M });
1340
+ }
1341
+ else
1342
+ Z(Y === void 0, "Browser history cannot replace state in browsers that do not support HTML5 history"), window.location.replace(J);
1343
+ }
1344
+ });
1345
+ }, j = function(y) {
1346
+ e.go(y);
1347
+ }, W = function() {
1348
+ return j(-1);
1349
+ }, V = function() {
1350
+ return j(1);
1351
+ }, T = 0, m = function(y) {
1352
+ T += y, T === 1 ? (je(window, Ie, p), s && je(window, Re, C)) : T === 0 && (_e(window, Ie, p), s && _e(window, Re, C));
1353
+ }, b = !1, v = function() {
1354
+ var y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, O = g.setPrompt(y);
1355
+ return b || (m(1), b = !0), function() {
1356
+ return b && (b = !1, m(-1)), O();
1357
+ };
1358
+ }, w = function(y) {
1359
+ var O = g.appendListener(y);
1360
+ return m(1), function() {
1361
+ m(-1), O();
1362
+ };
1363
+ }, P = {
1364
+ length: e.length,
1365
+ action: "POP",
1366
+ location: D,
1367
+ createHref: x,
1368
+ push: N,
1369
+ replace: A,
1370
+ go: j,
1371
+ goBack: W,
1372
+ goForward: V,
1373
+ block: v,
1374
+ listen: w
1375
+ };
1376
+ return P;
1377
+ }, Ve = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1378
+ return typeof n;
1379
+ } : function(n) {
1380
+ return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1381
+ }, Br = Object.assign || function(n) {
1382
+ for (var t = 1; t < arguments.length; t++) {
1383
+ var e = arguments[t];
1384
+ for (var r in e)
1385
+ Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
1386
+ }
1387
+ return n;
1388
+ }, We = function(t, e, r) {
1389
+ return Math.min(Math.max(t, e), r);
1390
+ }, Ur = function() {
1391
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = t.getUserConfirmation, r = t.initialEntries, s = r === void 0 ? ["/"] : r, i = t.initialIndex, o = i === void 0 ? 0 : i, a = t.keyLength, c = a === void 0 ? 6 : a, h = mn(), u = function(A) {
1392
+ Br(x, A), x.length = x.entries.length, h.notifyListeners(x.location, x.action);
1393
+ }, l = function() {
1394
+ return Math.random().toString(36).substr(2, c);
1395
+ }, d = We(o, 0, s.length - 1), f = s.map(function(N) {
1396
+ return typeof N == "string" ? ct(N, void 0, l()) : ct(N, void 0, N.key || l());
1397
+ }), g = gn, E = function(A, j) {
1398
+ Z(!((typeof A == "undefined" ? "undefined" : Ve(A)) === "object" && A.state !== void 0 && j !== void 0), "You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");
1399
+ var W = "PUSH", V = ct(A, j, l(), x.location);
1400
+ h.confirmTransitionTo(V, W, e, function(T) {
1401
+ if (T) {
1402
+ var m = x.index, b = m + 1, v = x.entries.slice(0);
1403
+ v.length > b ? v.splice(b, v.length - b, V) : v.push(V), u({
1404
+ action: W,
1405
+ location: V,
1406
+ index: b,
1407
+ entries: v
1408
+ });
1409
+ }
1410
+ });
1411
+ }, p = function(A, j) {
1412
+ Z(!((typeof A == "undefined" ? "undefined" : Ve(A)) === "object" && A.state !== void 0 && j !== void 0), "You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");
1413
+ var W = "REPLACE", V = ct(A, j, l(), x.location);
1414
+ h.confirmTransitionTo(V, W, e, function(T) {
1415
+ T && (x.entries[x.index] = V, u({ action: W, location: V }));
1416
+ });
1417
+ }, C = function(A) {
1418
+ var j = We(x.index + A, 0, x.entries.length - 1), W = "POP", V = x.entries[j];
1419
+ h.confirmTransitionTo(V, W, e, function(T) {
1420
+ T ? u({
1421
+ action: W,
1422
+ location: V,
1423
+ index: j
1424
+ }) : u();
1425
+ });
1426
+ }, R = function() {
1427
+ return C(-1);
1428
+ }, B = function() {
1429
+ return C(1);
1430
+ }, _ = function(A) {
1431
+ var j = x.index + A;
1432
+ return j >= 0 && j < x.entries.length;
1433
+ }, D = function() {
1434
+ var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
1435
+ return h.setPrompt(A);
1436
+ }, H = function(A) {
1437
+ return h.appendListener(A);
1438
+ }, x = {
1439
+ length: f.length,
1440
+ action: "POP",
1441
+ location: f[d],
1442
+ index: d,
1443
+ entries: f,
1444
+ createHref: g,
1445
+ push: E,
1446
+ replace: p,
1447
+ go: C,
1448
+ goBack: R,
1449
+ goForward: B,
1450
+ canGo: _,
1451
+ block: D,
1452
+ listen: H
1453
+ };
1454
+ return x;
1455
+ }, zr = Object.defineProperty, Be = Object.getOwnPropertySymbols, Fr = Object.prototype.hasOwnProperty, Jr = Object.prototype.propertyIsEnumerable, Ue = (n, t, e) => t in n ? zr(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, pt = (n, t) => {
1456
+ for (var e in t || (t = {}))
1457
+ Fr.call(t, e) && Ue(n, e, t[e]);
1458
+ if (Be)
1459
+ for (var e of Be(t))
1460
+ Jr.call(t, e) && Ue(n, e, t[e]);
1461
+ return n;
1462
+ }, St = (n, t, e) => new Promise((r, s) => {
1463
+ var i = (c) => {
1464
+ try {
1465
+ a(e.next(c));
1466
+ } catch (h) {
1467
+ s(h);
1468
+ }
1469
+ }, o = (c) => {
1470
+ try {
1471
+ a(e.throw(c));
1472
+ } catch (h) {
1473
+ s(h);
1474
+ }
1475
+ }, a = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(i, o);
1476
+ a((e = e.apply(n, t)).next());
1477
+ }), k = /* @__PURE__ */ ((n) => (n.Cookie = "cookie", n.Local = "local", n.Session = "session", n))(k || {}), vt = /* @__PURE__ */ ((n) => (n.Tenant = "tenant", n.Implementation = "implementation", n.Widget = "widget", n))(vt || {}), S = /* @__PURE__ */ ((n) => (n.Necessary = "necessary", n.Functional = "functional", n.Analytical = "analytical", n.Marketing = "marketing", n))(S || {});
1478
+ const X = (n, t, e, r = {}) => ze(n, e).then((s) => (process.env.NODE_ENV !== "production" && s && I.warn(
1479
+ `createStorageWriter: Attempted to create storage writer using unallowed category.
1480
+ Key: ${t}
1481
+ Category: ${JSON.stringify(e)}
1482
+ Options: ${JSON.stringify(r)}`
1483
+ ), (i) => (we(n), ze(n, e).then((o) => {
1484
+ if (o) {
1485
+ process.env.NODE_ENV !== "production" && I.warn(
1486
+ `storageWriter: Attempted to write to storage using unallowed category.
1487
+ Key: ${t}
1488
+ Category: ${JSON.stringify(e)}
1489
+ Value: ${JSON.stringify(i)}
1490
+ Options: ${JSON.stringify(r)}`
1491
+ );
1492
+ return;
1493
+ }
1494
+ const {
1495
+ scope: a = vt.Widget,
1496
+ medium: c = k.Session,
1497
+ duration: h
1498
+ } = r, u = Kr();
1499
+ return u[a][t] = be(i, e, h), c === k.Cookie ? Zr(n, u) : ts(n, c, u);
1500
+ })))), K = (n, t, e = k.Session) => (we(n), typeof t == "undefined" ? (process.env.NODE_ENV !== "production" && I.warn("readStorage: Undefined key passed when reading storage. ", t, e), Promise.resolve(void 0)) : e === k.Cookie ? Qr(n).then((r) => Bt(r, t)) : Xr(n, e).then((r) => Bt(r, t))), mt = (n) => !!Object.entries(n).filter(([t, e]) => typeof e != "undefined").length, re = (n) => Object.entries(n).filter(([t, e]) => typeof e != "undefined").forEach(([t, { value: e }]) => {
1501
+ typeof e == "undefined" && delete n[t];
1502
+ }), yn = (n, t) => {
1503
+ const e = {
1504
+ tenant: pt(pt({}, n.tenant), t.tenant),
1505
+ implementation: pt(pt({}, n.implementation), t.implementation),
1506
+ widget: pt(pt({}, n.widget), t.widget)
1507
+ };
1508
+ return re(e.tenant), re(e.implementation), re(e.widget), e;
1509
+ }, qr = (n) => Object.entries(n).reduce((t, e) => {
1510
+ const [r, s] = e;
1511
+ return Object.entries(s).forEach((i) => {
1512
+ const [o, { expiration: a }] = i;
1513
+ a && t.push(a);
1514
+ }), t;
1515
+ }, []).slice().sort((t, e) => new Date(e).valueOf() - new Date(t).valueOf()).shift() || Qt(), Gt = (n) => {
1516
+ const {
1517
+ name: t,
1518
+ implementation: { name: e, tenant: r }
1519
+ } = n.get("$widget");
1520
+ return [
1521
+ `humany_${r}`,
1522
+ `humany_${Ne(r + e)}`,
1523
+ `humany_${Ne(r + e + t)}`
1524
+ ];
1525
+ }, se = (n) => {
1526
+ const t = new RegExp(`(?:^|;)\\s?${n}=(.*?)(?:;|$)`, "i"), e = document.cookie.match(t);
1527
+ return e && e[1] && JSON.parse(e[1]) || void 0;
1528
+ }, ie = (n, t, e) => {
1529
+ const r = `${n}=${JSON.stringify(t).trim()}`, s = `expires=${new Date(e).toUTCString()}`, i = "path=/", o = "SameSite=None;Secure";
1530
+ return document.cookie = `${r}; ${s}; ${i}; ${o}`;
1531
+ }, ve = (n) => {
1532
+ const [t, e, r] = Gt(n), s = se(t) || {}, i = se(e) || {}, o = se(r) || {};
1533
+ return {
1534
+ tenant: s,
1535
+ implementation: i,
1536
+ widget: o
1537
+ };
1538
+ }, vn = (n, t) => {
1539
+ const e = ve(n), r = yn(e, t), [s, i, o] = Gt(n), { tenant: a, implementation: c, widget: h } = r, u = qr(t), l = Qt({ days: -1 });
1540
+ ie(s, a, mt(a) ? u : l), ie(
1541
+ i,
1542
+ c,
1543
+ mt(c) ? u : l
1544
+ ), ie(o, h, mt(h) ? u : l);
1545
+ }, Wt = (n, t) => {
1546
+ const [e, r, s] = Gt(n), i = t.getItem(e) || "{}", o = t.getItem(r) || "{}", a = t.getItem(s) || "{}";
1547
+ return {
1548
+ tenant: JSON.parse(i),
1549
+ implementation: JSON.parse(o),
1550
+ widget: JSON.parse(a)
1551
+ };
1552
+ }, pe = (n, t, e) => {
1553
+ const r = Wt(n, t), s = yn(r, e), [i, o, a] = Gt(n), { tenant: c, implementation: h, widget: u } = s;
1554
+ mt(c) ? t.setItem(i, JSON.stringify(c)) : t.removeItem(i), mt(h) ? t.setItem(o, JSON.stringify(h)) : t.removeItem(o), mt(u) ? t.setItem(a, JSON.stringify(u)) : t.removeItem(a);
1555
+ }, Kr = () => ({ tenant: {}, implementation: {}, widget: {} }), Yr = (n) => n ? !!n && /* @__PURE__ */ new Date() > new Date(n) : !1, Bt = (n, t) => {
1556
+ const e = n.widget[t] || n.implementation[t] || n.tenant[t];
1557
+ return e == null ? void 0 : e.value;
1558
+ }, be = (n, t, e) => e ? {
1559
+ value: n,
1560
+ category: t,
1561
+ expiration: typeof e == "object" ? Qt(e) : e
1562
+ } : {
1563
+ value: n,
1564
+ category: t
1565
+ }, jt = (n, t) => {
1566
+ const e = tr(n);
1567
+ return Object.entries(e).forEach(([r, s]) => {
1568
+ Object.entries(s).forEach(([i, o]) => {
1569
+ const { expiration: a, category: c } = o;
1570
+ (Yr(a) || Gr(t, c)) && (s[i] = be(void 0, c, a));
1571
+ });
1572
+ }), e;
1573
+ }, ze = (n, t) => K(n, "storagePolicy", k.Cookie).then(
1574
+ (e = [S.Necessary]) => !!t && e.indexOf(t) === -1
1575
+ ), Gr = (n = [S.Necessary], t) => !!t && n.indexOf(t) === -1, we = (n) => {
1576
+ const t = ve(n), e = Wt(n, window.localStorage), r = Wt(n, sessionStorage), s = Bt(t, "storagePolicy"), [i, o, a] = [
1577
+ t,
1578
+ e,
1579
+ r
1580
+ ].map((c) => jt(c, s));
1581
+ vn(n, i), pe(n, window.localStorage, o), pe(n, window.sessionStorage, a);
1582
+ }, Qt = (n = { days: 30 }) => {
1583
+ const { days: t = 0, hours: e = 0, minutes: r = 0, seconds: s = 0 } = n, i = /* @__PURE__ */ new Date();
1584
+ return i.setTime(i.getTime() + e * 60 * 60 * 1e3), i.setTime(i.getTime() + t * 24 * 60 * 60 * 1e3), i.setTime(i.getTime() + r * 60 * 1e3), i.setTime(i.getTime() + s * 1e3), i.toISOString();
1585
+ }, Qr = (n) => G(document)(() => ve(n)), Zr = (n, t) => G(document)(() => vn(n, t)), Xr = (n, t) => {
1586
+ const e = t === k.Local ? window.localStorage : window.sessionStorage;
1587
+ return G(e)(() => Wt(n, e));
1588
+ }, ts = (n, t, e) => {
1589
+ const r = t === k.Local ? window.localStorage : window.sessionStorage;
1590
+ return G(r)(() => pe(n, r, e));
1591
+ };
1592
+ class _t {
1593
+ constructor() {
1594
+ this.memory = {
1595
+ tenant: {},
1596
+ implementation: {},
1597
+ widget: {}
1598
+ };
1599
+ }
1600
+ setItem(t, e) {
1601
+ return St(this, arguments, function* (r, s, i = {}) {
1602
+ return G(this)(() => {
1603
+ const o = jt(this.memory, [S.Necessary]), { scope: a = vt.Tenant, expiration: c } = i;
1604
+ o[a][r] = be(
1605
+ s,
1606
+ S.Necessary,
1607
+ (c == null ? void 0 : c.toISOString()) || Qt()
1608
+ ), this.memory = o, process.env.NODE_ENV !== "production" && I.warn(
1609
+ `StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value stored temporarily in memory.
1610
+ Key: ${r}
1611
+ Value: ${JSON.stringify(s)}
1612
+ Options: ${JSON.stringify(i)}
1613
+ Memory: ${JSON.stringify(o)}`
1614
+ );
1615
+ });
1616
+ });
1617
+ }
1618
+ getItem(t) {
1619
+ return St(this, null, function* () {
1620
+ return G(this)(() => {
1621
+ const e = jt(this.memory, [S.Necessary]);
1622
+ process.env.NODE_ENV !== "production" && I.warn(
1623
+ `StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value fetched from legacy memory storage.
1624
+ Key: ${t}
1625
+ Memory: ${JSON.stringify(e)}`
1626
+ );
1627
+ const r = Bt(e, t);
1628
+ return this.memory = e, r;
1629
+ });
1630
+ });
1631
+ }
1632
+ removeItem(t) {
1633
+ return St(this, null, function* () {
1634
+ return G(this)(() => {
1635
+ const e = jt(this.memory, [S.Necessary]);
1636
+ delete e.tenant[t], delete e.implementation[t], delete e.widget[t], this.memory = e, process.env.NODE_ENV !== "production" && I.warn(
1637
+ `StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value removed from memory.
1638
+ Key: ${t}
1639
+ Memory: ${JSON.stringify(e)}`
1640
+ );
1641
+ });
1642
+ });
1643
+ }
1644
+ clear() {
1645
+ return St(this, null, function* () {
1646
+ return Promise.resolve();
1647
+ });
1648
+ }
1649
+ }
1650
+ let es = class {
1651
+ constructor() {
1652
+ this.cookies = new _t(), this.session = new _t(), this.local = new _t();
1653
+ }
1654
+ };
1655
+ const oe = (n, t, e, ...r) => {
1656
+ const s = `[${n.get("$environment").name || "webprovisions"}] ${e}`;
1657
+ switch (t) {
1658
+ case "info":
1659
+ console.info(s, ...r);
1660
+ break;
1661
+ case "warning":
1662
+ console.warn(s, ...r);
1663
+ break;
1664
+ case "error":
1665
+ console.error(s, ...r);
1666
+ break;
1667
+ }
1668
+ }, ns = (n) => {
1669
+ const t = n.container || n;
1670
+ return {
1671
+ info: (e, ...r) => oe(t, "info", e, ...r),
1672
+ warn: (e, ...r) => oe(t, "warning", e, ...r),
1673
+ error: (e, ...r) => oe(t, "error", e, ...r)
1674
+ };
1675
+ };
1676
+ var Ut = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))(Ut || {}), ht = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(ht || {});
1677
+ const rs = (n, t, e, r) => {
1678
+ try {
1679
+ const s = new t(e, r);
1680
+ return {
1681
+ name: n,
1682
+ invoke: (i, o) => {
1683
+ let a;
1684
+ return s[i] && (a = s[i].call(s, o)), Promise.resolve(a);
1685
+ },
1686
+ getInstance: () => s
1687
+ };
1688
+ } catch (s) {
1689
+ if (s.message && s.message.indexOf("is not a constructor") >= 0)
1690
+ return {
1691
+ name: n,
1692
+ invoke: (i) => {
1693
+ let o;
1694
+ return i === "initialize" && (o = t(e, r)), Promise.resolve(o);
1695
+ },
1696
+ getInstance: () => t
1697
+ };
1698
+ throw s;
1699
+ }
1700
+ };
1701
+ function Fe(n, t) {
1702
+ return typeof n == "undefined" ? t : n;
1703
+ }
1704
+ let ss = class {
1705
+ constructor(t = {}) {
1706
+ this.part = t;
1707
+ }
1708
+ createCommand(t, e, r) {
1709
+ let s;
1710
+ typeof e == "function" ? s = {
1711
+ scope: Ut.Widget,
1712
+ stage: ht.Post,
1713
+ defaultArgs: void 0,
1714
+ handlerResolver: e
1715
+ } : s = {
1716
+ scope: Fe(e.scope, Ut.Widget),
1717
+ stage: Fe(e.stage, ht.Post),
1718
+ defaultArgs: e.defaultArgs,
1719
+ handlerResolver: r
1720
+ };
1721
+ let i = this.part;
1722
+ const o = t.split(".");
1723
+ return o.forEach((a, c) => {
1724
+ c === o.length - 1 ? i[a] || (i[a] = () => s) : i = this.part[a] = this.part[a] || {};
1725
+ }), this;
1726
+ }
1727
+ get() {
1728
+ return this.part;
1729
+ }
1730
+ };
1731
+ const bn = (n) => {
1732
+ const t = new ss({});
1733
+ return n(t), t.get();
1734
+ };
1735
+ bn((n) => {
1736
+ n.createCommand(
1737
+ "types.register",
1738
+ { scope: Ut.Implementation, stage: ht.Pre },
1739
+ (t) => (e, r) => {
1740
+ t.container.get("$types")[e] = r;
1741
+ }
1742
+ ).createCommand(
1743
+ "type",
1744
+ { stage: ht.Pre },
1745
+ (t) => (e) => {
1746
+ t.container.register("$type", e);
1747
+ }
1748
+ ).createCommand(
1749
+ "settings",
1750
+ { stage: ht.Pre, defaultArgs: [null] },
1751
+ (t) => (e) => {
1752
+ t.events.dispatch(
1753
+ "settings:change",
1754
+ e,
1755
+ { bubbles: !0 }
1756
+ ), t.container.register("$settings", e);
1757
+ }
1758
+ ).createCommand(
1759
+ "plugin",
1760
+ { stage: ht.Pre },
1761
+ (t) => (e, r, s) => {
1762
+ const { container: i } = t;
1763
+ let o = null, a = e, c = r;
1764
+ typeof e == "string" && (o = e, a = r, c = s);
1765
+ const h = (u) => {
1766
+ const { transformPluginSettings: l } = t.container.get("$environmentOptions"), d = l ? l(
1767
+ c || {},
1768
+ o,
1769
+ t.container,
1770
+ a
1771
+ ) : r;
1772
+ try {
1773
+ const f = rs(
1774
+ o,
1775
+ a,
1776
+ i,
1777
+ d
1778
+ );
1779
+ i.get("$plugins").push(f), u && f.invoke("initialize", null);
1780
+ } catch (f) {
1781
+ ns(t).warn("Error when initializing plugin", f);
1782
+ }
1783
+ };
1784
+ t.container.get("$instance") ? h(!0) : t.events.subscribeOnce("widget:instance-created", () => h(!1));
1785
+ }
1786
+ ).createCommand(
1787
+ "container.register",
1788
+ (t) => (e, r) => {
1789
+ t.container.register(e, r);
1790
+ }
1791
+ ).createCommand(
1792
+ "container.registerAsync",
1793
+ (t) => (e, r) => {
1794
+ t.container.registerAsync(e, r);
1795
+ }
1796
+ ).createCommand(
1797
+ "container.registerFactory",
1798
+ (t) => (e, r) => {
1799
+ t.container.registerFactory(e, r);
1800
+ }
1801
+ ).createCommand(
1802
+ "container.touch",
1803
+ (t) => (e, r) => {
1804
+ t.container.touch(e, r);
1805
+ }
1806
+ ).createCommand(
1807
+ "csp",
1808
+ {},
1809
+ (t) => (e) => {
1810
+ t.container.register("csp", e);
1811
+ }
1812
+ );
1813
+ });
1814
+ bn((n) => {
1815
+ n.createCommand("storage", (t) => (e = {}) => {
1816
+ const { consent: r } = e;
1817
+ if (typeof r != "undefined") {
1818
+ if (typeof r != "number" && typeof r != "string" && !Array.isArray(r)) {
1819
+ process.env.NODE_ENV !== "production" && I.warn(
1820
+ `storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
1821
+ Passed consent: ${JSON.stringify(r)}`
1822
+ );
1823
+ return;
1824
+ }
1825
+ if (Array.isArray(r) && !r.every(
1826
+ (i) => typeof i == "number" || typeof i == "string"
1827
+ )) {
1828
+ process.env.NODE_ENV !== "production" && I.warn(
1829
+ `storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
1830
+ Passed consent: ${JSON.stringify(r)}`
1831
+ );
1832
+ return;
1833
+ }
1834
+ const s = [
1835
+ S.Necessary,
1836
+ S.Functional,
1837
+ S.Analytical,
1838
+ S.Marketing
1839
+ ].filter((i, o, a) => typeof r == "number" ? r > o : typeof r == "string" ? a.indexOf(r) + 1 > o : Array.isArray(r) ? r.findIndex((c) => c === o + 1 || c === i) > -1 : !0);
1840
+ return s.indexOf(S.Necessary) === -1 && (process.env.NODE_ENV !== "production" && I.warn(
1841
+ `storagePolicyConfigurationApi: passed consent does not include category: '${S.Necessary}'. Consent has to atleast include the '${S.Necessary}' category.
1842
+ Passed consent: ${JSON.stringify(r)}`
1843
+ ), s.unshift(S.Necessary)), X(
1844
+ t.container,
1845
+ "storagePolicy",
1846
+ S.Necessary,
1847
+ {
1848
+ medium: k.Cookie,
1849
+ scope: vt.Tenant,
1850
+ duration: { days: 365 }
1851
+ }
1852
+ ).then((i) => i(s)).then(() => {
1853
+ we(t.container), t.events.dispatch("storage:policy-changed", s);
1854
+ });
1855
+ }
1856
+ });
1857
+ });
1858
+ const is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1859
+ __proto__: null,
1860
+ StorageCategory: S,
1861
+ StorageMedium: k,
1862
+ StorageProvider: es,
1863
+ StorageScope: vt,
1864
+ StorageService: _t,
1865
+ createStorageWriter: X,
1866
+ readStorage: K
1867
+ }, Symbol.toStringTag, { value: "Module" }));
1868
+ var os = Object.defineProperty, as = Object.defineProperties, cs = Object.getOwnPropertyDescriptors, zt = Object.getOwnPropertySymbols, wn = Object.prototype.hasOwnProperty, On = Object.prototype.propertyIsEnumerable, Je = (n, t, e) => t in n ? os(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, gt = (n, t) => {
1869
+ for (var e in t || (t = {}))
1870
+ wn.call(t, e) && Je(n, e, t[e]);
1871
+ if (zt)
1872
+ for (var e of zt(t))
1873
+ On.call(t, e) && Je(n, e, t[e]);
1874
+ return n;
1875
+ }, En = (n, t) => as(n, cs(t)), hs = (n, t) => {
1876
+ var e = {};
1877
+ for (var r in n)
1878
+ wn.call(n, r) && t.indexOf(r) < 0 && (e[r] = n[r]);
1879
+ if (n != null && zt)
1880
+ for (var r of zt(n))
1881
+ t.indexOf(r) < 0 && On.call(n, r) && (e[r] = n[r]);
1882
+ return e;
1883
+ };
1884
+ function xn(n) {
1885
+ if (n.__esModule)
1886
+ return n;
1887
+ var t = n.default;
1888
+ if (typeof t == "function") {
1889
+ var e = function r() {
1890
+ if (this instanceof r) {
1891
+ var s = [null];
1892
+ s.push.apply(s, arguments);
1893
+ var i = Function.bind.apply(t, s);
1894
+ return new i();
1895
+ }
1896
+ return t.apply(this, arguments);
1897
+ };
1898
+ e.prototype = t.prototype;
1899
+ } else
1900
+ e = {};
1901
+ return Object.defineProperty(e, "__esModule", { value: !0 }), Object.keys(n).forEach(function(r) {
1902
+ var s = Object.getOwnPropertyDescriptor(n, r);
1903
+ Object.defineProperty(e, r, s.get ? s : {
1904
+ enumerable: !0,
1905
+ get: function() {
1906
+ return n[r];
1907
+ }
1908
+ });
1909
+ }), e;
1910
+ }
1911
+ var $n = function() {
1912
+ };
1913
+ process.env.NODE_ENV !== "production" && ($n = function(n, t, e) {
1914
+ var r = arguments.length;
1915
+ e = new Array(r > 2 ? r - 2 : 0);
1916
+ for (var s = 2; s < r; s++)
1917
+ e[s - 2] = arguments[s];
1918
+ if (t === void 0)
1919
+ throw new Error(
1920
+ "`warning(condition, format, ...args)` requires a warning message argument"
1921
+ );
1922
+ if (t.length < 10 || /^[s\W]*$/.test(t))
1923
+ throw new Error(
1924
+ "The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: " + t
1925
+ );
1926
+ if (!n) {
1927
+ var i = 0, o = "Warning: " + t.replace(/%s/g, function() {
1928
+ return e[i++];
1929
+ });
1930
+ typeof console != "undefined" && console.error(o);
1931
+ try {
1932
+ throw new Error(o);
1933
+ } catch (a) {
1934
+ }
1935
+ }
1936
+ });
1937
+ var us = $n, ls = us, qe = ds(ls);
1938
+ function ds(n) {
1939
+ return n && n.__esModule ? n : { default: n };
1940
+ }
1941
+ var ps = function() {
1942
+ var n = null, t = function(o) {
1943
+ return (0, qe.default)(n == null, "A history supports only one prompt at a time"), n = o, function() {
1944
+ n === o && (n = null);
1945
+ };
1946
+ }, e = function(o, a, c, h) {
1947
+ if (n != null) {
1948
+ var u = typeof n == "function" ? n(o, a) : n;
1949
+ typeof u == "string" ? typeof c == "function" ? c(u, h) : ((0, qe.default)(!1, "A history needs a getUserConfirmation function in order to use a prompt message"), h(!0)) : h(u !== !1);
1950
+ } else
1951
+ h(!0);
1952
+ }, r = [], s = function(o) {
1953
+ var a = !0, c = function() {
1954
+ a && o.apply(void 0, arguments);
1955
+ };
1956
+ return r.push(c), function() {
1957
+ a = !1, r = r.filter(function(h) {
1958
+ return h !== c;
1959
+ });
1960
+ };
1961
+ }, i = function() {
1962
+ for (var o = arguments.length, a = Array(o), c = 0; c < o; c++)
1963
+ a[c] = arguments[c];
1964
+ r.forEach(function(h) {
1965
+ return h.apply(void 0, a);
1966
+ });
1967
+ };
1968
+ return {
1969
+ setPrompt: t,
1970
+ confirmTransitionTo: e,
1971
+ appendListener: s,
1972
+ notifyListeners: i
1973
+ };
1974
+ }, Pn = ps, kn;
1975
+ kn = function(n, t) {
1976
+ return t(window.confirm(n));
1977
+ };
1978
+ function At(n) {
1979
+ return n.charAt(0) === "/";
1980
+ }
1981
+ function ae(n, t) {
1982
+ for (var e = t, r = e + 1, s = n.length; r < s; e += 1, r += 1)
1983
+ n[e] = n[r];
1984
+ n.pop();
1985
+ }
1986
+ function fs(n) {
1987
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", e = n && n.split("/") || [], r = t && t.split("/") || [], s = n && At(n), i = t && At(t), o = s || i;
1988
+ if (n && At(n) ? r = e : e.length && (r.pop(), r = r.concat(e)), !r.length)
1989
+ return "/";
1990
+ var a = void 0;
1991
+ if (r.length) {
1992
+ var c = r[r.length - 1];
1993
+ a = c === "." || c === ".." || c === "";
1994
+ } else
1995
+ a = !1;
1996
+ for (var h = 0, u = r.length; u >= 0; u--) {
1997
+ var l = r[u];
1998
+ l === "." ? ae(r, u) : l === ".." ? (ae(r, u), h++) : h && (ae(r, u), h--);
1999
+ }
2000
+ if (!o)
2001
+ for (; h--; h)
2002
+ r.unshift("..");
2003
+ o && r[0] !== "" && (!r[0] || !At(r[0])) && r.unshift("");
2004
+ var d = r.join("/");
2005
+ return a && d.substr(-1) !== "/" && (d += "/"), d;
2006
+ }
2007
+ const gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2008
+ __proto__: null,
2009
+ default: fs
2010
+ }, Symbol.toStringTag, { value: "Module" })), ms = /* @__PURE__ */ xn(gs);
2011
+ var Ke = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
2012
+ return typeof n;
2013
+ } : function(n) {
2014
+ return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
2015
+ };
2016
+ function Tt(n, t) {
2017
+ if (n === t)
2018
+ return !0;
2019
+ if (n == null || t == null)
2020
+ return !1;
2021
+ if (Array.isArray(n))
2022
+ return Array.isArray(t) && n.length === t.length && n.every(function(c, h) {
2023
+ return Tt(c, t[h]);
2024
+ });
2025
+ var e = typeof n == "undefined" ? "undefined" : Ke(n), r = typeof t == "undefined" ? "undefined" : Ke(t);
2026
+ if (e !== r)
2027
+ return !1;
2028
+ if (e === "object") {
2029
+ var s = n.valueOf(), i = t.valueOf();
2030
+ if (s !== n || i !== t)
2031
+ return Tt(s, i);
2032
+ var o = Object.keys(n), a = Object.keys(t);
2033
+ return o.length !== a.length ? !1 : o.every(function(c) {
2034
+ return Tt(n[c], t[c]);
2035
+ });
2036
+ }
2037
+ return !1;
2038
+ }
2039
+ const ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2040
+ __proto__: null,
2041
+ default: Tt
2042
+ }, Symbol.toStringTag, { value: "Module" })), vs = /* @__PURE__ */ xn(ys);
2043
+ var tt = {}, rt, Cn, fe, xt;
2044
+ tt.__esModule = !0;
2045
+ xt = tt.addLeadingSlash = function(n) {
2046
+ return n.charAt(0) === "/" ? n : "/" + n;
2047
+ };
2048
+ fe = tt.stripLeadingSlash = function(n) {
2049
+ return n.charAt(0) === "/" ? n.substr(1) : n;
2050
+ };
2051
+ var bs = tt.hasBasename = function(n, t) {
2052
+ return new RegExp("^" + t + "(\\/|\\?|#|$)", "i").test(n);
2053
+ };
2054
+ tt.stripBasename = function(n, t) {
2055
+ return bs(n, t) ? n.substr(t.length) : n;
2056
+ };
2057
+ Cn = tt.stripTrailingSlash = function(n) {
2058
+ return n.charAt(n.length - 1) === "/" ? n.slice(0, -1) : n;
2059
+ };
2060
+ tt.parsePath = function(n) {
2061
+ var t = n || "/", e = "", r = "", s = t.indexOf("#");
2062
+ s !== -1 && (r = t.substr(s), t = t.substr(0, s));
2063
+ var i = t.indexOf("?");
2064
+ return i !== -1 && (e = t.substr(i), t = t.substr(0, i)), {
2065
+ pathname: t,
2066
+ search: e === "?" ? "" : e,
2067
+ hash: r === "#" ? "" : r
2068
+ };
2069
+ };
2070
+ rt = tt.createPath = function(n) {
2071
+ var t = n.pathname, e = n.search, r = n.hash, s = t || "/";
2072
+ return e && e !== "?" && (s += e.charAt(0) === "?" ? e : "?" + e), r && r !== "#" && (s += r.charAt(0) === "#" ? r : "#" + r), s;
2073
+ };
2074
+ var Zt, Sn = Zt = void 0, ws = Object.assign || function(n) {
2075
+ for (var t = 1; t < arguments.length; t++) {
2076
+ var e = arguments[t];
2077
+ for (var r in e)
2078
+ Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
2079
+ }
2080
+ return n;
2081
+ }, Os = ms, Es = An(Os), xs = vs, $s = An(xs), Ps = tt;
2082
+ function An(n) {
2083
+ return n && n.__esModule ? n : { default: n };
2084
+ }
2085
+ Zt = function(n, t, e, r) {
2086
+ var s = void 0;
2087
+ typeof n == "string" ? (s = (0, Ps.parsePath)(n), s.state = t) : (s = ws({}, n), s.pathname === void 0 && (s.pathname = ""), s.search ? s.search.charAt(0) !== "?" && (s.search = "?" + s.search) : s.search = "", s.hash ? s.hash.charAt(0) !== "#" && (s.hash = "#" + s.hash) : s.hash = "", t !== void 0 && s.state === void 0 && (s.state = t));
2088
+ try {
2089
+ s.pathname = decodeURI(s.pathname);
2090
+ } catch (i) {
2091
+ throw i instanceof URIError ? new URIError('Pathname "' + s.pathname + '" could not be decoded. This is likely caused by an invalid percent-encoding.') : i;
2092
+ }
2093
+ return e && (s.key = e), r ? s.pathname ? s.pathname.charAt(0) !== "/" && (s.pathname = (0, Es.default)(s.pathname, r.pathname)) : s.pathname = r.pathname : s.pathname || (s.pathname = "/"), s;
2094
+ };
2095
+ Sn = function(n, t) {
2096
+ return n.pathname === t.pathname && n.search === t.search && n.hash === t.hash && n.key === t.key && (0, $s.default)(n.state, t.state);
2097
+ };
2098
+ const Nn = "/", Ln = "./", ks = new RegExp(
2099
+ [
2100
+ // Match escaped characters that would otherwise appear in future matches.
2101
+ // This allows the user to escape special characters that won't transform.
2102
+ "(\\\\.)",
2103
+ // Match Express-style parameters and un-named parameters with a prefix
2104
+ // and optional suffixes. Matches appear as:
2105
+ //
2106
+ // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?"]
2107
+ // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined]
2108
+ "(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"
2109
+ ].join("|"),
2110
+ "g"
2111
+ ), Mn = (n, t) => {
2112
+ const e = [];
2113
+ let r = 0, s = 0, i = "";
2114
+ const o = t && t.delimiter || Nn, a = t && t.delimiters || Ln;
2115
+ let c = !1, h;
2116
+ for (; (h = ks.exec(n)) !== null; ) {
2117
+ const u = h[0], l = h[1], d = h.index;
2118
+ if (i += n.slice(s, d), s = d + u.length, l) {
2119
+ i += l[1], c = !0;
2120
+ continue;
2121
+ }
2122
+ let f = "";
2123
+ const g = n[s], E = h[2], p = h[3], C = h[4], R = h[5];
2124
+ if (!c && i.length) {
2125
+ const N = i.length - 1;
2126
+ a.indexOf(i[N]) > -1 && (f = i[N], i = i.slice(0, N));
2127
+ }
2128
+ i && (e.push(i), i = "", c = !1);
2129
+ const B = f !== "" && g !== void 0 && g !== f, _ = R === "+" || R === "*", D = R === "?" || R === "*", H = f || o, x = p || C;
2130
+ e.push({
2131
+ delimiter: H,
2132
+ optional: D,
2133
+ repeat: _,
2134
+ partial: B,
2135
+ name: E || r++,
2136
+ // tslint:disable-line:no-increment-decrement
2137
+ prefix: f,
2138
+ pattern: x ? As(x) : "[^" + wt(H) + "]+?"
2139
+ });
2140
+ }
2141
+ return (i || s < n.length) && e.push(i + n.substr(s)), e;
2142
+ }, Cs = (n, t) => Ss(Mn(n, t)), Ss = (n) => {
2143
+ const t = new Array(n.length);
2144
+ for (let e = 0; e < n.length; e++)
2145
+ typeof n[e] == "object" && (t[e] = new RegExp("^(?:" + n[e].pattern + ")$"));
2146
+ return function(e, r) {
2147
+ let s = "";
2148
+ const i = r && r.encode || encodeURIComponent;
2149
+ for (let o = 0; o < n.length; o++) {
2150
+ const a = n[o];
2151
+ if (typeof a == "string") {
2152
+ s += a;
2153
+ continue;
2154
+ }
2155
+ const c = e ? e[a.name] : void 0;
2156
+ let h;
2157
+ if (Array.isArray(c)) {
2158
+ if (!a.repeat)
2159
+ throw new TypeError(
2160
+ 'Expected "' + a.name + '" to not repeat, but got array'
2161
+ );
2162
+ if (c.length === 0) {
2163
+ if (a.optional)
2164
+ continue;
2165
+ throw new TypeError('Expected "' + a.name + '" to not be empty');
2166
+ }
2167
+ for (let u = 0; u < c.length; u++) {
2168
+ if (h = i(c[u], a), !t[o].test(h))
2169
+ throw new TypeError(
2170
+ 'Expected all "' + a.name + '" to match "' + a.pattern + '"'
2171
+ );
2172
+ s += (u === 0 ? a.prefix : a.delimiter) + h;
2173
+ }
2174
+ continue;
2175
+ }
2176
+ if (typeof c == "string" || typeof c == "number" || typeof c == "boolean") {
2177
+ if (h = i(String(c), a), !t[o].test(h))
2178
+ throw new TypeError(
2179
+ 'Expected "' + a.name + '" to match "' + a.pattern + '", but got "' + h + '"'
2180
+ );
2181
+ s += a.prefix + h;
2182
+ continue;
2183
+ }
2184
+ if (a.optional) {
2185
+ a.partial && (s += a.prefix);
2186
+ continue;
2187
+ }
2188
+ throw new TypeError(
2189
+ 'Expected "' + a.name + '" to be ' + (a.repeat ? "an array" : "a string")
2190
+ );
2191
+ }
2192
+ return s;
2193
+ };
2194
+ }, wt = (n) => n.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"), As = (n) => n.replace(/([=!:$/()])/g, "\\$1"), Dn = (n) => n && n.sensitive ? "" : "i", Ns = (n, t) => {
2195
+ if (!t)
2196
+ return n;
2197
+ const e = n.source.match(/\((?!\?)/g);
2198
+ if (e)
2199
+ for (let r = 0; r < e.length; r++)
2200
+ t.push({
2201
+ name: r,
2202
+ prefix: "",
2203
+ delimiter: "",
2204
+ optional: !1,
2205
+ repeat: !1,
2206
+ partial: !1,
2207
+ pattern: ""
2208
+ });
2209
+ return n;
2210
+ }, Ls = (n, t, e) => {
2211
+ const r = [];
2212
+ for (let s = 0; s < n.length; s++)
2213
+ r.push(jn(n[s], t, e).source);
2214
+ return new RegExp("(?:" + r.join("|") + ")", Dn(e));
2215
+ }, Ms = (n, t, e) => Ds(Mn(n, e), t, e), Ds = (n, t, e) => {
2216
+ e = e || {};
2217
+ const r = e.strict, s = e.end !== !1, i = wt(e.delimiter || Nn), o = e.delimiters || Ln, a = [].concat(e.endsWith || []).map(wt).concat("$").join("|");
2218
+ let c = "", h = !1;
2219
+ for (let u = 0; u < n.length; u++) {
2220
+ const l = n[u];
2221
+ if (typeof l == "string")
2222
+ c += wt(l), h = u === n.length - 1 && o.indexOf(l[l.length - 1]) > -1;
2223
+ else {
2224
+ const d = wt(l.prefix), f = l.repeat ? "(?:" + l.pattern + ")(?:" + d + "(?:" + l.pattern + "))*" : l.pattern;
2225
+ t && t.push(l), l.optional ? l.partial ? c += d + "(" + f + ")?" : c += "(?:" + d + "(" + f + "))?" : c += d + "(" + f + ")";
2226
+ }
2227
+ }
2228
+ return s ? (r || (c += "(?:" + i + ")?"), c += a === "$" ? "$" : "(?=" + a + ")") : (r || (c += "(?:" + i + "(?=" + a + "))?"), h || (c += "(?=" + i + "|" + a + ")")), new RegExp("^" + c, Dn(e));
2229
+ }, jn = (n, t, e) => n instanceof RegExp ? Ns(n, t || []) : Array.isArray(n) ? Ls(n, t, e) : Ms(n, t, e), Ft = jn;
2230
+ var q = /* @__PURE__ */ ((n) => (n.scopedHash = "scopedHash", n.hash = "hash", n.browser = "browser", n.memory = "memory", n))(q || {}), ot = /* @__PURE__ */ ((n) => (n.storage = "storage", n.path = "path", n.initialPath = "initial", n))(ot || {});
2231
+ const Ot = (n, t) => {
2232
+ const e = [], r = Ft(t, e).exec(n);
2233
+ if (!r)
2234
+ return {};
2235
+ const [s, ...i] = r;
2236
+ return e.reduce((o, a, c) => (o[a.name] = i[c], o), {});
2237
+ }, js = (n) => Object.keys(n).reduce((t, e) => {
2238
+ const r = typeof n[e] == "string" ? n[e].replace("&", "%20") : n[e];
2239
+ let s = `${e}=${r}`;
2240
+ return t.length > 1 && (s = "&".concat(s)), t.concat(s);
2241
+ }, "?"), ce = (n, t) => {
2242
+ const e = t.find((r) => r.name === n);
2243
+ if (!e) {
2244
+ process.env.NODE_ENV !== "production" && I.warn(`Unable to find route with specified name: ${n}`);
2245
+ return;
2246
+ }
2247
+ return e;
2248
+ }, _n = (n) => n.length ? n.slice(1).split("&").map((t) => t.split("=")).reduce((t, e) => {
2249
+ const [r, s] = e.map(encodeURI).map(decodeURIComponent);
2250
+ return En(gt({}, t), { [r]: decodeURIComponent(s).replace("%20", "&") });
2251
+ }, {}) : {}, _s = (n, t) => {
2252
+ const e = t.map((r) => It(n, r)).reduce(
2253
+ (r, s) => {
2254
+ if (s === null)
2255
+ return r;
2256
+ const i = s.split("?")[1];
2257
+ let o = 0;
2258
+ if (i) {
2259
+ const a = _n(`?${i}`);
2260
+ o = Object.keys(a).length;
2261
+ }
2262
+ return !r.path || r.count && o < r.count ? {
2263
+ count: o,
2264
+ path: s
2265
+ } : r;
2266
+ },
2267
+ { count: void 0, path: void 0 }
2268
+ );
2269
+ return e ? e.path : t[0];
2270
+ }, It = (n, t) => {
2271
+ const e = lt(n);
2272
+ if (Array.isArray(t)) {
2273
+ const c = _s(e, t);
2274
+ if (!c)
2275
+ throw new Error("Unable to match path.");
2276
+ return c;
2277
+ }
2278
+ const r = Cs(t);
2279
+ let s = t;
2280
+ try {
2281
+ s = r(e);
2282
+ } catch (c) {
2283
+ return null;
2284
+ }
2285
+ const i = [];
2286
+ Ft(t, i);
2287
+ const o = Object.keys(e).reduce((c, h) => (i.find((u) => u.name === h) || c.push(h), c), []), a = {};
2288
+ return o.forEach((c) => a[c] = e[c]), Object.keys(a).forEach((c) => a[c] === null && delete a[c]), Object.keys(a).length > 0 ? `${s}${js(a)}` : s;
2289
+ }, ft = (n, t) => {
2290
+ let e = n;
2291
+ return e.indexOf("?") > -1 && (e = e.substring(0, e.indexOf("?"))), e.indexOf(";") > -1 && (e = e.substring(0, e.indexOf(";"))), e === "" && (e = "/"), t.reduce((r, s) => {
2292
+ if (Array.isArray(s.path))
2293
+ return s.path.reduce((o, a) => Ft(a, []).exec(e || "") && !o ? e : o, void 0) && !r ? s : r;
2294
+ if (!s.path)
2295
+ return r;
2296
+ const i = [];
2297
+ return Ft(s.path, i).exec(e || "") && !r ? s : r;
2298
+ }, void 0);
2299
+ }, Ts = (n) => {
2300
+ let t = n.get("historyTransitionManager");
2301
+ return t || (t = Pn(), n.parent && n.parent.register("historyTransitionManager", t)), t;
2302
+ }, Et = (n, t = null) => n ? Zt(t ? t(n) : n) : {
2303
+ pathname: "",
2304
+ search: "",
2305
+ hash: ""
2306
+ }, Is = (n, t) => {
2307
+ if (lt(n), lt(t), Object.keys(n).length !== Object.keys(t).length)
2308
+ return !1;
2309
+ if (Object.keys(n).length === 0 && Object.keys(t).length === 0)
2310
+ return !0;
2311
+ let e = !0;
2312
+ return Object.keys(t).forEach((r) => {
2313
+ t[r] !== n[r] && (e = !1);
2314
+ }), e;
2315
+ }, Rs = (n) => {
2316
+ if (typeof n.mode == "string") {
2317
+ if (n.mode === q.memory)
2318
+ return !0;
2319
+ } else if (n.mode[1]) {
2320
+ const [t, { sticky: e }] = n.mode;
2321
+ if (t === q.memory)
2322
+ return typeof e == "undefined" ? !0 : e;
2323
+ }
2324
+ return !1;
2325
+ }, he = (n) => {
2326
+ const { views: t } = n.get("$settings"), e = Object.keys(t).reduce((r, s) => typeof t[s].path == "undefined" ? s : r, void 0);
2327
+ return e ? {
2328
+ name: e,
2329
+ params: {}
2330
+ } : null;
2331
+ }, Ye = "hashchange", Hs = {
2332
+ hashbang: {
2333
+ encodePath: (n) => n.charAt(0) === "!" ? n : "!/" + fe(n),
2334
+ decodePath: (n) => n.charAt(0) === "!" ? n.substr(1) : n
2335
+ },
2336
+ noslash: {
2337
+ encodePath: fe,
2338
+ decodePath: xt
2339
+ },
2340
+ slash: {
2341
+ encodePath: xt,
2342
+ decodePath: xt
2343
+ }
2344
+ }, st = () => {
2345
+ const n = window.location.href, t = n.indexOf("#");
2346
+ return t === -1 ? "" : n.substring(t + 1);
2347
+ }, Ge = (n) => window.location.hash = n, Qe = (n) => {
2348
+ const t = window.location.href.indexOf("#");
2349
+ window.location.replace(
2350
+ window.location.href.slice(0, t >= 0 ? t : 0) + "#" + n
2351
+ );
2352
+ }, Rt = (n = "") => {
2353
+ const t = n.replace(";", "?"), e = [
2354
+ { from: /\;+/gi, to: "&" },
2355
+ { from: /:+/gi, to: "=" }
2356
+ ];
2357
+ let r = t;
2358
+ return e.forEach(({ to: s, from: i }) => {
2359
+ r = r.replace(i, s);
2360
+ }), r;
2361
+ }, Vs = (n = {}) => {
2362
+ const t = window.history, { getUserConfirmation: e = kn, hashType: r = "slash" } = n, s = n.basename ? Cn(xt(n.basename)) : "", { encodePath: i } = Hs[r], o = () => {
2363
+ const m = st(), b = u(m);
2364
+ return Et(b, Rt);
2365
+ }, a = n.transitionManager || Pn(), c = (m) => {
2366
+ Object.assign(T, m), T.length = t.length, a.notifyListeners(T.location, T.action, n.widgetName);
2367
+ };
2368
+ let h = !1;
2369
+ const u = (m) => {
2370
+ const b = (w) => {
2371
+ function P($, y) {
2372
+ const O = {};
2373
+ let L;
2374
+ for (; L = y.exec($); )
2375
+ O[L[1]] = L[2];
2376
+ return O;
2377
+ }
2378
+ return P(w, /([^#?&=]+)=([^&#]*)(?!.*?\#)/gi) || null;
2379
+ }, v = "humany-" + n.widgetName;
2380
+ return b(m)[v];
2381
+ }, l = () => {
2382
+ const m = o(), b = T.location;
2383
+ !h && Sn(b, m) || d(m);
2384
+ }, d = (m) => {
2385
+ if (h)
2386
+ h = !1, c();
2387
+ else {
2388
+ const b = "POP";
2389
+ a.confirmTransitionTo(
2390
+ m,
2391
+ b,
2392
+ e,
2393
+ (v) => {
2394
+ v ? c({ action: b, location: m }) : f(m);
2395
+ }
2396
+ );
2397
+ }
2398
+ }, f = (m) => {
2399
+ const b = T.location;
2400
+ let v = p.lastIndexOf(rt(b));
2401
+ v === -1 && (v = 0);
2402
+ let w = p.lastIndexOf(rt(m));
2403
+ w === -1 && (w = 0);
2404
+ const P = v - w;
2405
+ P && (h = !0, x(P));
2406
+ }, g = st(), E = i(g);
2407
+ g !== E && Qe(E);
2408
+ let p = [];
2409
+ const C = o();
2410
+ C.pathname !== null && p.push(rt(C));
2411
+ const R = (m = "") => {
2412
+ const b = [
2413
+ { from: /\?+/gi, to: ";" },
2414
+ { from: /\&amp;+/gi, to: ";" },
2415
+ { from: /\&+/gi, to: ";" },
2416
+ { from: /=+/gi, to: ":" }
2417
+ ];
2418
+ let v = m;
2419
+ return b.forEach(({ to: w, from: P }) => {
2420
+ v = v.replace(P, w);
2421
+ }), v;
2422
+ }, B = (m, b, v) => {
2423
+ let w = "", P = !1;
2424
+ return m.split("&").forEach(($) => {
2425
+ const y = $.split("="), O = y[0], L = y[1];
2426
+ if (O === b) {
2427
+ if (P = !0, v === null)
2428
+ return;
2429
+ w.length > 0 && (w += "&"), typeof v != "undefined" ? w += O + "=" + v : w += O;
2430
+ } else
2431
+ O && (w.length > 0 && (w += "&"), w += O + "=" + L);
2432
+ }), !P && v !== null && (w.length > 0 && (w += "&"), typeof v != "undefined" ? w += b + "=" + v : w += b), w;
2433
+ }, _ = (m) => {
2434
+ const b = m.pathname, v = R(m.search), w = b + (v ? `;${v}` : ""), P = `humany-${n.widgetName}`, $ = st();
2435
+ return `#${B($, P, w).replace(";;", ";")}`;
2436
+ }, D = (m, b) => {
2437
+ const v = "PUSH", w = Et(m, Rt), P = w.pathname, $ = R(w.search), y = P + ($ ? `${$}` : ""), O = `humany-${n.widgetName}`, L = st(), M = B(L, O, y);
2438
+ a.confirmTransitionTo(w, v, e, (F) => {
2439
+ if (!F)
2440
+ return;
2441
+ const J = rt(w), et = i(M);
2442
+ if (st() !== et) {
2443
+ Ge(et);
2444
+ const Y = p.lastIndexOf(rt(T.location)), U = p.slice(0, Y === -1 ? 0 : Y + 1);
2445
+ U.push(J), p = U, c({ action: v, location: w });
2446
+ } else
2447
+ c();
2448
+ });
2449
+ }, H = (m, b) => {
2450
+ const v = "REPLACE", w = Et(m, Rt);
2451
+ a.confirmTransitionTo(w, v, e, (P) => {
2452
+ if (!P)
2453
+ return;
2454
+ const $ = rt(w), y = i(s + $);
2455
+ st() !== y && Qe(y);
2456
+ const O = p.indexOf(rt(T.location));
2457
+ O !== -1 && (p[O] = $), c({ action: v, location: w });
2458
+ });
2459
+ }, x = (m) => {
2460
+ t.go(m);
2461
+ }, N = () => x(-1), A = () => x(1);
2462
+ let j = 0;
2463
+ const W = (m) => {
2464
+ j += m, j === 1 ? window.addEventListener(Ye, l) : j === 0 && window.removeEventListener(Ye, l);
2465
+ };
2466
+ let V = !1;
2467
+ const T = {
2468
+ createHref: _,
2469
+ createLocation: Et,
2470
+ push: D,
2471
+ replace: H,
2472
+ go: x,
2473
+ goBack: N,
2474
+ goForward: A,
2475
+ block: (m = !1) => {
2476
+ const b = a.setPrompt(m);
2477
+ return V || (W(1), V = !0), () => (V && (V = !1, W(-1)), b());
2478
+ },
2479
+ listen: (m) => {
2480
+ const b = a.appendListener(m);
2481
+ return W(1), () => {
2482
+ W(-1), b();
2483
+ };
2484
+ },
2485
+ stop: () => {
2486
+ const m = st(), b = B(m, `humany-${n.widgetName}`, null), v = i(b);
2487
+ Ge(v);
2488
+ },
2489
+ length: t.length,
2490
+ action: "POP",
2491
+ location: C
2492
+ };
2493
+ return T;
2494
+ }, Tn = Vs, Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2495
+ __proto__: null,
2496
+ decodeSearch: Rt,
2497
+ default: Tn,
2498
+ getHashPath: st
2499
+ }, Symbol.toStringTag, { value: "Module" })), Bs = (n, t) => {
2500
+ const e = (s) => {
2501
+ function i(o, a) {
2502
+ const c = {};
2503
+ let h;
2504
+ for (; h = a.exec(o); )
2505
+ c[h[1]] = h[2];
2506
+ return c;
2507
+ }
2508
+ return i(s, /([^#?&=]+)=([^&#]*)(?!.*?\#)/gi) || null;
2509
+ }, r = `humany-${t}`;
2510
+ return e(n)[r];
2511
+ }, Us = () => {
2512
+ const n = window.location.href, t = n.indexOf("#");
2513
+ return t === -1 ? "" : n.substring(t + 1);
2514
+ }, zs = (n = "") => {
2515
+ const t = n.replace(";", "?"), e = [
2516
+ { from: /\;+/gi, to: "&" },
2517
+ { from: /:+/gi, to: "=" }
2518
+ ];
2519
+ let r = t;
2520
+ return e.forEach(({ to: s, from: i }) => {
2521
+ r = r.replace(i, s);
2522
+ }), r;
2523
+ }, Fs = (n, t = null) => n ? Zt(t ? t(n) : n) : {
2524
+ pathname: "",
2525
+ search: "",
2526
+ hash: ""
2527
+ }, In = (n) => {
2528
+ const t = Us(), e = Bs(t, n);
2529
+ return Fs(e, zs);
2530
+ }, Oe = (n) => {
2531
+ const { name: t } = n.get("$widget");
2532
+ return !!In(t).pathname;
2533
+ };
2534
+ ge((n) => {
2535
+ n.createCommand("routing", (t) => (e) => {
2536
+ const r = {
2537
+ mode: e.mode
2538
+ };
2539
+ e.basePath && (r.basePath = e.basePath), t.container.register("routingSettings", r);
2540
+ });
2541
+ });
2542
+ const Ze = "routeData";
2543
+ class Js {
2544
+ constructor(t, e) {
2545
+ this.container = t, this.steps = [], this.historyListenSubscription = () => {
2546
+ }, this.sticky = !1, this.storageWriter = null, this.widget = t.get("$widget");
2547
+ const r = e, { routes: s } = r, i = hs(r, ["routes"]);
2548
+ this.settings = gt(gt({}, i), t.get("routingSettings")), this.sticky = Rs(this.settings), this.storageMedium = this.sticky ? k.Local : k.Session, X(t, Ze, S.Necessary, {
2549
+ medium: this.storageMedium
2550
+ }).then((o) => this.storageWriter = o), this.routes = s;
2551
+ }
2552
+ initialize() {
2553
+ return this.initialized = this.initialized || this.createHistory().then((t) => {
2554
+ this.history = t, this.location = t.location, this.historyListenSubscription = t.listen(
2555
+ (e, r, s) => this.handleLocationChange(e, s)
2556
+ );
2557
+ });
2558
+ }
2559
+ setMatch(t) {
2560
+ if (this.match = t, this.location) {
2561
+ const e = this.getRouteData(), r = {
2562
+ routeData: e,
2563
+ location: this.location
2564
+ }, s = this.steps[0], i = e.name === (s == null ? void 0 : s.routeData.name), o = Le(
2565
+ e.params,
2566
+ (s == null ? void 0 : s.routeData.params) || {}
2567
+ );
2568
+ (!i || !o) && (this.widget.events.dispatch("router:change", { next: r, previous: s }), this.steps.unshift(r), this.storageWriter && this.storageWriter(r.routeData), this.widget.events.dispatch("router:changed", { previous: s, current: r }));
2569
+ }
2570
+ }
2571
+ onRouteChange(t) {
2572
+ return this.widget.events.subscribe("router:change", t);
2573
+ }
2574
+ isSticky() {
2575
+ return this.sticky;
2576
+ }
2577
+ /**
2578
+ * Generate a formatted path from string
2579
+ * @param routeName Name of route to generate path for
2580
+ * @param params Optional: route params
2581
+ */
2582
+ generate(t, e = {}) {
2583
+ const r = ce(t, this.routes);
2584
+ if (!r || !this.history)
2585
+ throw `No route found for ${t}`;
2586
+ const s = It(e, r.path);
2587
+ if (!s)
2588
+ throw `Unable to generate path for "${t}".`;
2589
+ const i = Et(s, this.settings.decodeSearch);
2590
+ let o = this.history.createHref(i);
2591
+ const { mode: a, basePath: c } = this.settings;
2592
+ return a === "browser" && c && (o = o.replace(c, "")), o.charAt(0) !== "/" && (o = `/${o}`), o;
2593
+ }
2594
+ /**
2595
+ * Navigate to path
2596
+ * @param routeName Route to navigate to
2597
+ * @param params Optional: route params
2598
+ */
2599
+ navigate(t, e = {}) {
2600
+ const r = ce(t, this.routes);
2601
+ if (!r || !this.history)
2602
+ return;
2603
+ const s = It(e, r.path);
2604
+ if (!s)
2605
+ return;
2606
+ const i = this.getRouteData(), o = i && i.name === t && Is(i.params, e);
2607
+ if (this.steps[0] && o)
2608
+ return;
2609
+ const { decodeSearch: a } = this.settings, c = a ? a(s) : s;
2610
+ this.widget.events.dispatch("router:navigate", {
2611
+ decodedPath: c
2612
+ }), c.charAt(0) !== "/" ? this.history.push(`/${c}`) : this.history.push(c);
2613
+ }
2614
+ /**
2615
+ * Return true or false depending
2616
+ * on whether it is possible to navigate backwards
2617
+ */
2618
+ hasBack() {
2619
+ if (this.steps.length > 1)
2620
+ return !0;
2621
+ const t = this.getRouteData(this.settings.initialPath), e = this.getRouteData(), r = e.name === t.name, s = Le(e.params, t.params);
2622
+ return !r || !s;
2623
+ }
2624
+ /**
2625
+ * Navigate to previous route
2626
+ */
2627
+ goBack(t = 1) {
2628
+ if (this.steps.length < 2) {
2629
+ const e = this.getRouteData(this.settings.initialPath);
2630
+ e && e.name && (this.navigate(e.name, e.params), this.steps = []);
2631
+ } else {
2632
+ const e = t >= this.steps.length ? this.steps.length - 1 : t, { routeData: r } = this.steps[e];
2633
+ this.steps = [...this.steps.slice(e + 1)], this.navigate(r.name, Xn(r.params));
2634
+ }
2635
+ }
2636
+ /**
2637
+ * Navigate to next route
2638
+ */
2639
+ goForward() {
2640
+ this.history && this.history.goForward();
2641
+ }
2642
+ /**
2643
+ * Get the current location
2644
+ */
2645
+ current() {
2646
+ return this.location;
2647
+ }
2648
+ /**
2649
+ * Get the initial route. If the defined initial route does not exist,
2650
+ * return the first defined route
2651
+ */
2652
+ getInitialRoute() {
2653
+ const { name: t } = this.getRouteData(this.settings.initialPath);
2654
+ return this.routes.find((r) => r.name === t) || (this.routes.length > 0 ? this.routes[0] : (process.env.NODE_ENV !== "production" && I.warn("Unable to get initial route as no routes are defined."), null));
2655
+ }
2656
+ getRouteData(t) {
2657
+ const e = he(this.container);
2658
+ if (t) {
2659
+ const r = ft(t, this.routes);
2660
+ return r ? {
2661
+ params: lt(Ot(t, r.path)),
2662
+ name: r.name
2663
+ } : e || {
2664
+ name: "",
2665
+ params: {}
2666
+ };
2667
+ }
2668
+ if (this.location) {
2669
+ const { pathname: r, search: s } = this.location;
2670
+ if (this.currentRoute = this.currentRoute || ft(r, this.routes), this.currentRoute) {
2671
+ const { path: i, name: o } = this.currentRoute;
2672
+ this.match || (this.match = {
2673
+ params: Ot(r, i),
2674
+ isExact: !0,
2675
+ path: i,
2676
+ url: r
2677
+ });
2678
+ const a = lt(gt(gt({}, this.match.params), s.length > 0 && _n(s)));
2679
+ return {
2680
+ name: o,
2681
+ params: a
2682
+ };
2683
+ }
2684
+ }
2685
+ return e || {
2686
+ name: "",
2687
+ params: {}
2688
+ };
2689
+ }
2690
+ dispose() {
2691
+ return this.historyListenSubscription(), this.stop();
2692
+ }
2693
+ /**
2694
+ * Setup and load the initial route based on router configuration
2695
+ */
2696
+ setupInitialRoute() {
2697
+ return K(this.container, Ze, this.storageMedium).then(
2698
+ (t) => {
2699
+ if (!this.location || !this.history)
2700
+ return;
2701
+ const { initialPath: e, mode: r } = this.settings;
2702
+ switch ((() => {
2703
+ const s = Oe(this.container);
2704
+ return r === q.browser || s ? ot.path : r === q.memory && t ? ot.storage : ot.initialPath;
2705
+ })()) {
2706
+ case ot.initialPath: {
2707
+ const s = this.getRouteData(e);
2708
+ return s && s.name ? this.navigate(s.name, s.params) : void 0;
2709
+ }
2710
+ case ot.path: {
2711
+ const { pathname: s } = this.location;
2712
+ if (this.currentRoute = ft(s, this.routes), this.currentRoute) {
2713
+ const { path: o } = this.currentRoute;
2714
+ return this.setMatch({
2715
+ params: Ot(s, o),
2716
+ isExact: !0,
2717
+ path: o,
2718
+ url: s
2719
+ });
2720
+ }
2721
+ const i = he(this.container);
2722
+ return i ? this.setMatch({
2723
+ params: {},
2724
+ isExact: !0,
2725
+ path: i.name,
2726
+ url: s
2727
+ }) : void 0;
2728
+ }
2729
+ case ot.storage: {
2730
+ const { pathname: s } = this.location;
2731
+ this.currentRoute = ft(s, this.routes);
2732
+ const { name: i = "", params: o = {} } = t || {}, a = ce(i, this.routes);
2733
+ if (a) {
2734
+ const c = It(o, a.path);
2735
+ if (c)
2736
+ return this.history.push(c), this.location = En(gt({}, this.location), { pathname: c }), this.currentRoute = ft(c, this.routes), this.setMatch({
2737
+ params: o,
2738
+ isExact: !0,
2739
+ path: a.path,
2740
+ url: c
2741
+ });
2742
+ }
2743
+ return;
2744
+ }
2745
+ }
2746
+ }
2747
+ );
2748
+ }
2749
+ start() {
2750
+ return this.setupInitialRoute();
2751
+ }
2752
+ stop() {
2753
+ return this.history && (this.settings.mode === q.scopedHash && this.history.stop(), this.steps = [], this.storageWriter) ? this.storageWriter() : Promise.resolve();
2754
+ }
2755
+ handleLocationChange(t, e) {
2756
+ const { pathname: r } = t, { mode: s } = this.settings;
2757
+ if (r.indexOf("?") > -1 || r.indexOf(";") > -1 || s === q.scopedHash && e !== this.widget.name)
2758
+ return;
2759
+ this.location = t, this.currentRoute = ft(r, this.routes);
2760
+ const i = he(this.container);
2761
+ if (this.currentRoute) {
2762
+ const { path: o } = this.currentRoute;
2763
+ this.setMatch({
2764
+ params: Ot(r, o),
2765
+ isExact: !0,
2766
+ path: o,
2767
+ url: r
2768
+ });
2769
+ } else
2770
+ i && this.setMatch({
2771
+ params: {},
2772
+ isExact: !0,
2773
+ path: i.name,
2774
+ url: r
2775
+ });
2776
+ }
2777
+ createHistory() {
2778
+ return new Promise((t) => {
2779
+ const { mode: e, basePath: r } = this.settings;
2780
+ if (e === q.scopedHash) {
2781
+ const s = this.widget.name, i = Ts(this.container);
2782
+ return Promise.resolve().then(() => Ws).then((o) => {
2783
+ const a = o.default({
2784
+ widgetName: s,
2785
+ transitionManager: i,
2786
+ hashType: "noslash"
2787
+ });
2788
+ return t(a);
2789
+ });
2790
+ }
2791
+ if (e === q.memory)
2792
+ return t(Ur());
2793
+ if (e === q.browser)
2794
+ return t(Wr({ basename: r }));
2795
+ throw "RoutingService: History could not be created.";
2796
+ });
2797
+ }
2798
+ }
2799
+ const qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2800
+ __proto__: null,
2801
+ HistoryMode: q,
2802
+ RoutingService: Js,
2803
+ createHashHistory: Tn,
2804
+ getScopedHashDOMLocation: In,
2805
+ matchParams: Ot,
2806
+ onWidgetUrl: Oe
2807
+ }, Symbol.toStringTag, { value: "Module" })), ue = (n, t, e, ...r) => {
2808
+ const s = `[${n.get("$environment").name || "webprovisions"}] ${e}`;
2809
+ switch (t) {
2810
+ case "info":
2811
+ console.info(s, ...r);
2812
+ break;
2813
+ case "warning":
2814
+ console.warn(s, ...r);
2815
+ break;
2816
+ case "error":
2817
+ console.error(s, ...r);
2818
+ break;
2819
+ }
2820
+ }, Ks = (n) => {
2821
+ const t = n.container || n;
2822
+ return {
2823
+ info: (e, ...r) => ue(t, "info", e, ...r),
2824
+ warn: (e, ...r) => ue(t, "warning", e, ...r),
2825
+ error: (e, ...r) => ue(t, "error", e, ...r)
2826
+ };
2827
+ };
2828
+ var $t = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))($t || {}), it = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(it || {});
2829
+ const Ys = (n, t, e, r) => {
2830
+ try {
2831
+ const s = new t(e, r);
2832
+ return {
2833
+ name: n,
2834
+ invoke: (i, o) => {
2835
+ let a;
2836
+ return s[i] && (a = s[i].call(s, o)), Promise.resolve(a);
2837
+ },
2838
+ getInstance: () => s
2839
+ };
2840
+ } catch (s) {
2841
+ if (s.message && s.message.indexOf("is not a constructor") >= 0)
2842
+ return {
2843
+ name: n,
2844
+ invoke: (i) => {
2845
+ let o;
2846
+ return i === "initialize" && (o = t(e, r)), Promise.resolve(o);
2847
+ },
2848
+ getInstance: () => t
2849
+ };
2850
+ throw s;
2851
+ }
2852
+ };
2853
+ function Xe(n, t) {
2854
+ return typeof n == "undefined" ? t : n;
2855
+ }
2856
+ class Gs {
2857
+ constructor(t = {}) {
2858
+ this.part = t;
2859
+ }
2860
+ createCommand(t, e, r) {
2861
+ let s;
2862
+ typeof e == "function" ? s = {
2863
+ scope: $t.Widget,
2864
+ stage: it.Post,
2865
+ defaultArgs: void 0,
2866
+ handlerResolver: e
2867
+ } : s = {
2868
+ scope: Xe(e.scope, $t.Widget),
2869
+ stage: Xe(e.stage, it.Post),
2870
+ defaultArgs: e.defaultArgs,
2871
+ handlerResolver: r
2872
+ };
2873
+ let i = this.part;
2874
+ const o = t.split(".");
2875
+ return o.forEach((a, c) => {
2876
+ c === o.length - 1 ? i[a] || (i[a] = () => s) : i = this.part[a] = this.part[a] || {};
2877
+ }), this;
2878
+ }
2879
+ get() {
2880
+ return this.part;
2881
+ }
2882
+ }
2883
+ const Rn = (n) => {
2884
+ const t = new Gs({});
2885
+ return n(t), t.get();
2886
+ };
2887
+ Rn((n) => {
2888
+ n.createCommand(
2889
+ "types.register",
2890
+ { scope: $t.Implementation, stage: it.Pre },
2891
+ (t) => (e, r) => {
2892
+ t.container.get("$types")[e] = r;
2893
+ }
2894
+ ).createCommand(
2895
+ "type",
2896
+ { stage: it.Pre },
2897
+ (t) => (e) => {
2898
+ t.container.register("$type", e);
2899
+ }
2900
+ ).createCommand(
2901
+ "settings",
2902
+ { stage: it.Pre, defaultArgs: [null] },
2903
+ (t) => (e) => {
2904
+ t.events.dispatch(
2905
+ "settings:change",
2906
+ e,
2907
+ { bubbles: !0 }
2908
+ ), t.container.register("$settings", e);
2909
+ }
2910
+ ).createCommand(
2911
+ "plugin",
2912
+ { stage: it.Pre },
2913
+ (t) => (e, r, s) => {
2914
+ const { container: i } = t;
2915
+ let o = null, a = e, c = r;
2916
+ typeof e == "string" && (o = e, a = r, c = s);
2917
+ const h = (u) => {
2918
+ const { transformPluginSettings: l } = t.container.get("$environmentOptions"), d = l ? l(
2919
+ c || {},
2920
+ o,
2921
+ t.container,
2922
+ a
2923
+ ) : r;
2924
+ try {
2925
+ const f = Ys(
2926
+ o,
2927
+ a,
2928
+ i,
2929
+ d
2930
+ );
2931
+ i.get("$plugins").push(f), u && f.invoke("initialize", null);
2932
+ } catch (f) {
2933
+ Ks(t).warn("Error when initializing plugin", f);
2934
+ }
2935
+ };
2936
+ t.container.get("$instance") ? h(!0) : t.events.subscribeOnce("widget:instance-created", () => h(!1));
2937
+ }
2938
+ ).createCommand(
2939
+ "container.register",
2940
+ (t) => (e, r) => {
2941
+ t.container.register(e, r);
2942
+ }
2943
+ ).createCommand(
2944
+ "container.registerAsync",
2945
+ (t) => (e, r) => {
2946
+ t.container.registerAsync(e, r);
2947
+ }
2948
+ ).createCommand(
2949
+ "container.registerFactory",
2950
+ (t) => (e, r) => {
2951
+ t.container.registerFactory(e, r);
2952
+ }
2953
+ ).createCommand(
2954
+ "container.touch",
2955
+ (t) => (e, r) => {
2956
+ t.container.touch(e, r);
2957
+ }
2958
+ ).createCommand(
2959
+ "csp",
2960
+ {},
2961
+ (t) => (e) => {
2962
+ t.container.register("csp", e);
2963
+ }
2964
+ );
2965
+ });
2966
+ function Qs(n) {
2967
+ const t = {};
2968
+ return [].filter.call(n.attributes, (e) => /^data-/.test(e.name)).map((e) => e.name).forEach((e) => t[e.substr(5)] = n.getAttribute(e)), t;
2969
+ }
2970
+ const tn = (n, t, e) => {
2971
+ const r = Qs(n);
2972
+ e({
2973
+ sourceDOMElement: n,
2974
+ eventType: t,
2975
+ data: r
2976
+ });
2977
+ };
2978
+ function en(n, t, e) {
2979
+ n.forEach((r) => {
2980
+ r.dataset.attached !== "true" && (t === "load" ? tn(r, t, e) : r.addEventListener(t, (s) => {
2981
+ s.preventDefault(), tn(r, t, e);
2982
+ }), r.dataset.monitored = "true");
2983
+ });
2984
+ }
2985
+ function Zs(n, t, e) {
2986
+ const r = n.container.get("bootstrapping.monitor");
2987
+ r && r.events.subscribe("bootstrap:trigger-elements-updated", (i, o) => {
2988
+ en(
2989
+ o.triggerElements,
2990
+ t,
2991
+ e
2992
+ );
2993
+ });
2994
+ const s = n.container.get("triggerElements");
2995
+ s && en(
2996
+ s,
2997
+ t,
2998
+ e
2999
+ );
3000
+ }
3001
+ Rn((n) => {
3002
+ n.createCommand(
3003
+ "ready",
3004
+ { scope: $t.Implementation, stage: it.Pre },
3005
+ (t) => (e) => {
3006
+ const { container: r } = t, s = r.owner;
3007
+ r.get("bootstrapping").ready ? e(s) : s.events.subscribeOnce("bootstrap:ready", () => {
3008
+ e(s);
3009
+ });
3010
+ }
3011
+ );
3012
+ });
3013
+ const Xs = (n) => {
3014
+ if (n) {
3015
+ const { type: t, content: e } = n;
3016
+ switch (t) {
3017
+ case "FontAwesome":
3018
+ return `<i class="humany-icon fa fa-${e}"></i>`;
3019
+ case "Uri":
3020
+ return `<i class="humany-icon humany-custom-icon" style="background: url(${e}) no-repeat center center;background-size: contain;"></i>`;
3021
+ default:
3022
+ return "";
3023
+ }
3024
+ }
3025
+ }, ti = (n) => {
3026
+ const t = (s, i) => {
3027
+ s && (i ? s.classList.add("humany-tabbing") : s.classList.remove("humany-tabbing"));
3028
+ }, e = (s) => {
3029
+ s.key === "Tab" ? t(n, !0) : s.key === "Enter" && document.activeElement && document.activeElement.classList.contains("humany-trigger") || t(n, !1);
3030
+ }, r = (s) => {
3031
+ document.activeElement && document.activeElement.classList.contains("humany-trigger") && document.activeElement.classList.contains("humany-tabbing") || t(n, !1);
3032
+ };
3033
+ return document.addEventListener("keydown", e), document.addEventListener("click", r), () => {
3034
+ document.removeEventListener("keydown", e), document.removeEventListener("click", r);
3035
+ };
3036
+ };
3037
+ function ei(n, t) {
3038
+ const {
3039
+ symbol: e,
3040
+ widgetName: r,
3041
+ label: s = "",
3042
+ ariaLabel: i = "",
3043
+ tooltip: o = ""
3044
+ } = t;
3045
+ n.classList.add("humany-trigger"), n.classList.add(`humany_${r}`), s.length && n.classList.add("humany-has-text"), i.length && !n.getAttribute("aria-label") && n.setAttribute("aria-label", i), i.length && !n.getAttribute("tabindex") && n.setAttribute("tabindex", "0"), o.length && !n.getAttribute("title") && n.setAttribute("title", o);
3046
+ const a = Xs(e) || "";
3047
+ return n.innerHTML = `${a}
3048
+ <span class="humany-close">
3049
+ <svg width="18" height="9" viewBox="0 0 18 9" fill="none" xmlns="http://www.w3.org/2000/svg">
3050
+ <path d="M9 9C8.81794 9.00045 8.63759 8.96634 8.46939 8.89965C8.3012 8.83295 8.14851 8.735 8.02015 8.61145L0.194523 1.12367C0.068294 0.99862 -0.00155266 0.831133 2.61958e-05 0.657285C0.00160506 0.483436 0.0744832 0.317136 0.202964 0.194202C0.331445 0.0712675 0.505249 0.00153576 0.686941 2.50649e-05C0.868634 -0.00148563 1.04368 0.0653456 1.17437 0.186125L9 7.6739L16.8256 0.186125C16.9563 0.0653456 17.1314 -0.00148563 17.3131 2.50649e-05C17.4948 0.00153576 17.6686 0.0712675 17.797 0.194202C17.9255 0.317136 17.9984 0.483436 18 0.657285C18.0016 0.831133 17.9317 0.99862 17.8055 1.12367L9.97985 8.61145C9.85149 8.735 9.6988 8.83295 9.53061 8.89965C9.36241 8.96634 9.18206 9.00045 9 9Z" fill="white"/>
3051
+ </svg>
3052
+ </span>
3053
+ <span class="humany-loader">
3054
+ <svg viewBox="25 25 50 50">
3055
+ <circle
3056
+ cx="50"
3057
+ cy="50"
3058
+ r="20"
3059
+ fill="none"
3060
+ stroke="#000"
3061
+ stroke-width="2"
3062
+ stroke-miterlimit="10" />
3063
+ </svg>
3064
+ </span>
3065
+ ${s.length ? `<span>${s}</span>` : ""}`, setTimeout(
3066
+ () => n && n.classList.add("humany-rendered")
3067
+ ), ti(n);
3068
+ }
3069
+ function ni(n, t) {
3070
+ n instanceof HTMLElement ? (t && n.setAttribute("title", t), n.classList.remove("humany-active"), n.classList.remove("humany-loading")) : n instanceof Array && n.forEach((e) => {
3071
+ t && e.setAttribute("title", t), e.classList.remove("humany-active"), e.classList.remove("humany-loading");
3072
+ });
3073
+ }
3074
+ function ri(n) {
3075
+ n instanceof HTMLElement ? (n.classList.remove("humany-active"), n.classList.add("humany-loading")) : n instanceof Array && n.forEach((t) => {
3076
+ t.classList.remove("humany-active"), t.classList.add("humany-loading");
3077
+ });
3078
+ }
3079
+ function Hn(n, t) {
3080
+ n instanceof HTMLElement ? (t && n.setAttribute("title", t), n.classList.add("humany-active"), n.classList.remove("humany-loading")) : n instanceof Array && n.forEach((e) => {
3081
+ t && e.setAttribute("title", t), e.classList.add("humany-active"), e.classList.remove("humany-loading");
3082
+ });
3083
+ }
3084
+ var ut = /* @__PURE__ */ ((n) => (n.Inline = "inline", n.Link = "link", n.Badge = "badge", n.Unsupported = "unsupported", n))(ut || {});
3085
+ const si = (n, t) => n && t ? "both" : n ? "widgetDOM" : t ? "triggerDOM" : "none", Vn = (n) => n ? typeof n == "boolean" && n ? "link" : typeof n == "object" && !Array.isArray(n) ? "badge" : "unsupported" : "inline", ii = (n, t, e, r, s = !1) => {
3086
+ var h, u;
3087
+ const i = si(
3088
+ t,
3089
+ e
3090
+ ), o = Vn(r), a = {
3091
+ widgetDOMElement: t ? t.cloneNode(!0) : void 0,
3092
+ triggerDOMElement: e ? e.cloneNode(!0) : void 0
3093
+ }, c = {
3094
+ triggerType: o,
3095
+ cachedOriginals: a,
3096
+ widgetDOMElement: document.createElement("div")
3097
+ };
3098
+ switch (i) {
3099
+ case "both": {
3100
+ c.widgetDOMElement = t || document.createElement("div"), o !== "inline" && (c.triggerDOMElement = e);
3101
+ break;
3102
+ }
3103
+ case "widgetDOM": {
3104
+ if (c.widgetDOMElement = t || document.createElement("div"), o !== "inline") {
3105
+ const l = document.body.appendChild(document.createElement("a"));
3106
+ o === "link" && (l.innerText = n), c.triggerDOMElement = l;
3107
+ }
3108
+ break;
3109
+ }
3110
+ case "triggerDOM": {
3111
+ const l = document.createElement("div");
3112
+ c.widgetDOMElement = l, o === "inline" ? (l.id = (e == null ? void 0 : e.id) || "", s ? (l.style.display = "none", (h = e == null ? void 0 : e.parentNode) == null || h.appendChild(l), c.callback = () => {
3113
+ var d;
3114
+ (d = e == null ? void 0 : e.parentNode) == null || d.replaceChild(
3115
+ l,
3116
+ e
3117
+ ), l.style.display = (e == null ? void 0 : e.style.display) || "block";
3118
+ }) : (u = e == null ? void 0 : e.parentNode) == null || u.replaceChild(
3119
+ l,
3120
+ e
3121
+ ), c.cachedOriginals.widgetDOMElement = e, c.cachedOriginals.triggerDOMElement = void 0) : (c.widgetDOMElement = document.body.appendChild(l), c.triggerDOMElement = e);
3122
+ break;
3123
+ }
3124
+ case "none": {
3125
+ const l = document.body.appendChild(document.createElement("div"));
3126
+ if (c.widgetDOMElement = l, o !== "inline") {
3127
+ const d = document.body.appendChild(document.createElement("a"));
3128
+ o === "link" && (d.innerText = n), c.triggerDOMElement = d;
3129
+ }
3130
+ break;
3131
+ }
3132
+ }
3133
+ return c;
3134
+ }, oi = "modals";
3135
+ class ai {
3136
+ constructor(t, e) {
3137
+ this.options = e, this.unsubscribe = [], this.container = t.createChild(this), this.container.register("widgetDOMElement", this.options.widgetDOMElement), this.container.register(
3138
+ "triggerDOMElement",
3139
+ this.options.triggerDOMElement
3140
+ );
3141
+ const r = this.container.get("$widget");
3142
+ this.options.widgetDOMElement.classList.add("humany-widget"), this.options.widgetDOMElement.classList.add(`humany_${r.name}`);
3143
+ const s = t.get("widgetDOMElements") || [];
3144
+ t.register("widgetDOMElements", [
3145
+ ...s,
3146
+ this.options.widgetDOMElement
3147
+ ]);
3148
+ }
3149
+ /**
3150
+ * Renders the view outlet to the DOM.
3151
+ */
3152
+ render() {
3153
+ const { widgetDOMElement: t, triggerDOMElement: e } = this.options, r = this.container.get("$widget");
3154
+ return t.getAttribute("data-rendered") === "true" ? Promise.resolve() : (e && this.options.triggerType === ut.Badge && ri(e), import("./render-8726e104.js").then((s) => s.default(this.container, t)).then(() => {
3155
+ if (t.setAttribute("data-rendered", "true"), e && this.options.triggerType === ut.Badge) {
3156
+ const i = this.options.triggerOptions.openTooltip;
3157
+ Hn(e, i);
3158
+ }
3159
+ sr(this.container, t);
3160
+ const s = this.container.get("$environment").widgets.all();
3161
+ K(
3162
+ this.container,
3163
+ oi,
3164
+ k.Session
3165
+ ).then((i) => {
3166
+ i && i.forEach((o) => {
3167
+ s.find(
3168
+ (a) => a.name === o.name && a.state === "activated"
3169
+ ) && r.events.dispatch("widget:modal-opened", o);
3170
+ });
3171
+ });
3172
+ }));
3173
+ }
3174
+ renderBadge(t) {
3175
+ const { triggerDOMElement: e } = this.options;
3176
+ if (!e)
3177
+ return;
3178
+ e.getAttribute("role") || e.setAttribute("role", "button");
3179
+ const { name: r } = this.container.get("$widget"), { label: s, symbol: i, ariaLabel: o, closedTooltip: a, openTooltip: c } = t, h = { closedTooltip: a, openTooltip: c };
3180
+ this.options.triggerOptions = h;
3181
+ const u = ei(e, {
3182
+ label: s,
3183
+ symbol: i,
3184
+ ariaLabel: o,
3185
+ widgetName: r,
3186
+ tooltip: a
3187
+ });
3188
+ this.unsubscribe.push(u);
3189
+ }
3190
+ dispose() {
3191
+ return Xt(this, null, function* () {
3192
+ var r, s, i, o;
3193
+ const { triggerDOMElement: t, widgetDOMElement: e } = this.options;
3194
+ this.options.cachedOriginals.widgetDOMElement && e && ((r = e.parentNode) == null || r.replaceChild(
3195
+ this.options.cachedOriginals.widgetDOMElement,
3196
+ e
3197
+ )), this.options.cachedOriginals.triggerDOMElement && t && ((s = t.parentNode) == null || s.replaceChild(
3198
+ this.options.cachedOriginals.triggerDOMElement,
3199
+ t
3200
+ )), this.unsubscribe.forEach((a) => {
3201
+ a();
3202
+ }), (i = e.parentNode) == null || i.removeChild(e), (o = t == null ? void 0 : t.parentNode) == null || o.removeChild(t);
3203
+ });
3204
+ }
3205
+ }
3206
+ const Nt = "changesets", ci = (n) => {
3207
+ const t = { tags: n.tags };
3208
+ return n.context && typeof n.context != "function" && (t.context = n.context), n.properties && typeof n.properties != "function" && (t.properties = n.properties), n.layout && typeof n.layout != "function" && (t.layout = n.layout), t;
3209
+ };
3210
+ class Ee {
3211
+ constructor(t, e) {
3212
+ this.container = t, this.storageWriter = e;
3213
+ }
3214
+ static create(t) {
3215
+ return X(
3216
+ t,
3217
+ Nt,
3218
+ S.Necessary,
3219
+ {
3220
+ medium: k.Local
3221
+ }
3222
+ ).then(
3223
+ (e) => new Ee(t, e)
3224
+ );
3225
+ }
3226
+ write(t, e, r, s) {
3227
+ return G(this)(() => K(
3228
+ this.container,
3229
+ Nt,
3230
+ k.Local
3231
+ ).then((i = {}) => {
3232
+ const { keys: o = [], items: a = {} } = i, c = o.indexOf(t);
3233
+ return c > -1 && o.splice(c, 1), o.push(t), a[t] = {
3234
+ options: s,
3235
+ attributes: ci(r),
3236
+ rules: e.rules
3237
+ }, this.storageWriter({ keys: o, items: a });
3238
+ }));
3239
+ }
3240
+ remove(t) {
3241
+ return G(this)(() => K(
3242
+ this.container,
3243
+ Nt,
3244
+ k.Local
3245
+ ).then((e = {}) => {
3246
+ const { keys: r = [], items: s = {} } = e, i = r.indexOf(t);
3247
+ if (i > -1)
3248
+ return r.splice(i, 1), delete s[t], this.storageWriter(e);
3249
+ }));
3250
+ }
3251
+ load(t) {
3252
+ return G(this)(() => K(
3253
+ this.container,
3254
+ Nt,
3255
+ k.Local
3256
+ ).then((e = {}) => {
3257
+ const { keys: r = [], items: s = {} } = e;
3258
+ r.forEach((i) => {
3259
+ const o = s[i];
3260
+ if (o) {
3261
+ const { rules: a, attributes: c, options: h } = o;
3262
+ t.write({
3263
+ attributes: c,
3264
+ options: h,
3265
+ target: new yt(t, a)
3266
+ });
3267
+ }
3268
+ });
3269
+ }));
3270
+ }
3271
+ }
3272
+ const hi = (n) => {
3273
+ const { container: t } = n;
3274
+ return Ee.create(t).then(
3275
+ (e) => {
3276
+ const r = t.get("$settings"), s = { localStorage: e }, i = new Yt(n, s), o = un(i, r);
3277
+ return n.events.subscribe(
3278
+ "widget:state-change",
3279
+ (a, c) => {
3280
+ c.state === sn.Deactivating && o();
3281
+ }
3282
+ ), i;
3283
+ }
3284
+ );
3285
+ }, ui = (n) => Promise.resolve().then(() => qs).then(
3286
+ ({ RoutingService: t, HistoryMode: e }) => n.get("settings").then((r) => {
3287
+ const {
3288
+ routing: {
3289
+ initialPath: s = "/",
3290
+ mode: i = e.scopedHash,
3291
+ basePath: o
3292
+ },
3293
+ views: a
3294
+ } = r;
3295
+ return new t(n, {
3296
+ initialPath: s,
3297
+ mode: i,
3298
+ routes: Object.keys(a).map((h) => ({
3299
+ name: h,
3300
+ path: a[h].path
3301
+ })),
3302
+ basePath: o
3303
+ });
3304
+ })
3305
+ ), li = (n) => Promise.resolve().then(() => is).then(({ StorageProvider: t }) => new t()), di = (n) => Promise.resolve().then(() => ye).then(({ ActionResolver: t }) => new t(n)), pi = (n) => Promise.resolve().then(() => ye).then(({ ComponentResolver: t }) => new t(n)), fi = (n) => Promise.resolve().then(() => ye).then(() => hi(n.get("$widget"))), le = "$settings", Lt = "open", nn = "activeStickyWidget";
3306
+ class Mi extends Yn {
3307
+ constructor(t) {
3308
+ super(t), this.outlets = /* @__PURE__ */ new Map(), this.activated = void 0, this.subs = [], this.handleBootstrapping = (e) => {
3309
+ const r = {
3310
+ triggerDOMElement: e.sourceDOMElement,
3311
+ withRenderState: "storage"
3312
+ /* Storage */
3313
+ };
3314
+ this.container.get("settings").then((s) => {
3315
+ const { activate: i } = s;
3316
+ (typeof i == "undefined" || i === null || i === !0) && (this.activated = (this.activated || this.widget.activate()).then(
3317
+ () => this.attach(r)
3318
+ ));
3319
+ });
3320
+ }, this.container.registerAsync(
3321
+ "storage",
3322
+ () => li(this.container)
3323
+ ), this.container.registerFactory("settings", () => K(
3324
+ this.container,
3325
+ le,
3326
+ k.Local
3327
+ ).then((e = {}) => dt(dt({}, this.container.get("$settings")), e))), Zs(this, "load", this.handleBootstrapping), this.container.registerAsync(
3328
+ "componentResolver",
3329
+ () => pi(this.container)
3330
+ ), this.container.registerAsync(
3331
+ "router",
3332
+ () => ui(this.container)
3333
+ ), this.container.registerAsync(
3334
+ "actionResolver",
3335
+ () => di(this.container)
3336
+ ), this.container.register("matchMedia", window.matchMedia), this.container.registerAsync(
3337
+ "components",
3338
+ () => fi(this.container)
3339
+ );
3340
+ }
3341
+ initialize() {
3342
+ const t = this.container.getManyAsync(
3343
+ "actionResolver",
3344
+ "router",
3345
+ "components"
3346
+ ), e = this.container.get("csp");
3347
+ return e && (window.webprovisionsEnvironmentVariables || (window.webprovisionsEnvironmentVariables = {}), window.webprovisionsEnvironmentVariables.cspNonce = e.nonce), Promise.all([t, this.container.get("settings")]).then(
3348
+ ([{ actionResolver: r, router: s, components: i }, o]) => {
3349
+ var h;
3350
+ r.subscribe(
3351
+ this.widget.name,
3352
+ (u, l, d) => this.onAction(l, d)
3353
+ );
3354
+ const a = (u) => {
3355
+ i.nodes.query({ type: "view" }).forEach((l) => {
3356
+ i.setSwitch(l, u);
3357
+ });
3358
+ }, c = ((h = s.getInitialRoute()) == null ? void 0 : h.name) || "index";
3359
+ return a(c), this.events.subscribe("widget:data-loaded", (u, { element: l }) => {
3360
+ this.widget.container.get("seoConfiguration") && this.events.dispatch("widget:preloaded-replaced", {
3361
+ element: l
3362
+ });
3363
+ }), this.events.subscribe(
3364
+ "router:change",
3365
+ (u, { previous: l = { routeData: {} }, next: d = { routeData: {} } }) => {
3366
+ const { routeData: f } = l, { routeData: g } = d, E = Object.keys(o.views).reduce(
3367
+ (p, C) => typeof o.views[C].path == "undefined" ? C : p,
3368
+ ""
3369
+ );
3370
+ !g.name && E ? a(E) : a(g.name), lt(f && f.params), lt(g && g.params), this.container.getAsync("actionResolver").then((p) => {
3371
+ p.action(this.widget.name, "routeChange", {
3372
+ next: g,
3373
+ previous: f
3374
+ });
3375
+ });
3376
+ }
3377
+ ), s.initialize();
3378
+ }
3379
+ );
3380
+ }
3381
+ attach(t = {}) {
3382
+ return this.container.get("settings").then(({ trigger: e }) => {
3383
+ var d, f;
3384
+ const {
3385
+ widgetDOMElement: r,
3386
+ key: s = Pt(),
3387
+ triggerDOMElement: i,
3388
+ withRenderState: o
3389
+ } = t, c = Vn(e) === ut.Inline && ((i == null ? void 0 : i.childElementCount) || 0) > 0, h = ii(
3390
+ this.widget.name,
3391
+ r,
3392
+ i,
3393
+ e,
3394
+ c
3395
+ );
3396
+ this.outlets.size < 1 && !o && this.setRenderState("unset");
3397
+ const u = () => {
3398
+ const g = () => E.querySelectorAll("[data-loading=true]").length === 0, [E] = this.widget.container.get("widgetDOMElements"), p = (B, _) => {
3399
+ g() && (h.callback && h.callback(), _.disconnect());
3400
+ }, C = {
3401
+ attributes: !0,
3402
+ subtree: !0,
3403
+ childList: !0
3404
+ };
3405
+ g() && h.callback && h.callback(), new MutationObserver(p).observe(E, C);
3406
+ };
3407
+ c && this.widget.container.getAsync("dataClient").then(({ events: g }) => {
3408
+ g.subscribe(
3409
+ "data-client:fetched",
3410
+ (E, p) => {
3411
+ p.unresolvedQueries === 0 && u();
3412
+ }
3413
+ );
3414
+ });
3415
+ const l = this.getOrCreateViewOutlet(s, h);
3416
+ if (this.outlets.set(s, l), this.widget.events.dispatch("widget:attached", {}, { bubbles: !0 }), h.triggerType === ut.Badge && e && ((d = h.triggerDOMElement) == null || d.setAttribute(
3417
+ "aria-expanded",
3418
+ "false"
3419
+ ), l == null || l.renderBadge(e)), h.triggerType !== ut.Inline && ((f = h.triggerDOMElement) == null || f.addEventListener(
3420
+ "click",
3421
+ (g) => {
3422
+ g.preventDefault(), this.container.get("settings").then(({ trigger: E }) => {
3423
+ l.render().then(() => this.renderState()).then((p) => E && E.action && E.action === "hide" ? p === z.open ? this.hide() : this.open() : p === z.open ? this.close() : this.open());
3424
+ });
3425
+ }
3426
+ )), this.outlets.size > 1)
3427
+ return this.renderState().then((g) => {
3428
+ this.triggerStateIfApplicable(g);
3429
+ });
3430
+ if (o)
3431
+ return o === "storage" ? this.renderState().then((g) => {
3432
+ if (h.triggerType === ut.Inline) {
3433
+ this.triggerStateIfApplicable("open");
3434
+ return;
3435
+ }
3436
+ this.triggerStateIfApplicable(g);
3437
+ }) : this.triggerStateIfApplicable(o);
3438
+ });
3439
+ }
3440
+ detach(t) {
3441
+ if (t) {
3442
+ if (this.outlets.has(t)) {
3443
+ const e = this.outlets.get(t);
3444
+ e == null || e.dispose(), this.outlets.delete(t);
3445
+ return;
3446
+ }
3447
+ process.env.NODE_ENV !== "production" && console.warn(`detach(): Could not find View Outlet with key ${t}`);
3448
+ return;
3449
+ }
3450
+ this.outlets.forEach((e) => {
3451
+ e.dispose();
3452
+ }), this.outlets.clear();
3453
+ }
3454
+ triggerStateIfApplicable(t) {
3455
+ return this.container.getAsync("router").then((e) => {
3456
+ switch (t) {
3457
+ case "closed":
3458
+ this.close();
3459
+ break;
3460
+ case "open":
3461
+ this.open();
3462
+ break;
3463
+ case "hidden":
3464
+ this.hide(), e.start();
3465
+ break;
3466
+ default:
3467
+ return;
3468
+ }
3469
+ });
3470
+ }
3471
+ getOrCreateViewOutlet(t, e) {
3472
+ return this.outlets.has(t) ? this.outlets.get(t) : new ai(this.container, e);
3473
+ }
3474
+ render(t = {}) {
3475
+ if (process.env.NODE_ENV !== "production" && console.warn(
3476
+ "widget.render() is deprecated. Use widget.attach() instead."
3477
+ ), t.open) {
3478
+ const e = Ce(dt({}, t), {
3479
+ withRenderState: "open"
3480
+ /* Open */
3481
+ });
3482
+ return this.attach(e);
3483
+ }
3484
+ return this.attach(t);
3485
+ }
3486
+ activate(t) {
3487
+ t != null && t.override && this.setSettings(() => t.override), t != null && t.apiNotificationPriorityBy && this.container.register(
3488
+ "apiNotificationPriorityBy",
3489
+ t.apiNotificationPriorityBy
3490
+ );
3491
+ }
3492
+ setSettings(t) {
3493
+ return Promise.all([
3494
+ this.container.get("settings"),
3495
+ X(
3496
+ this.container,
3497
+ le,
3498
+ S.Necessary,
3499
+ {
3500
+ medium: k.Local
3501
+ }
3502
+ )
3503
+ ]).then(([e, r]) => Promise.resolve(t(e)).then((s) => r(s).then(() => {
3504
+ const i = dt(dt({}, e), s);
3505
+ return this.widget.events.dispatch("widget:settings-updated", i), i;
3506
+ })));
3507
+ }
3508
+ clearSettings() {
3509
+ return X(
3510
+ this.container,
3511
+ le,
3512
+ S.Necessary,
3513
+ { medium: k.Local }
3514
+ ).then((t) => t()).then(() => this.container.get("settings")).then((t) => {
3515
+ this.widget.events.dispatch("widget:settings-updated", t);
3516
+ });
3517
+ }
3518
+ action({ action: t, value: e }) {
3519
+ return this.container.getAsync("actionResolver").then((r) => {
3520
+ r.action(this.widget.name, t, e);
3521
+ });
3522
+ }
3523
+ renderState() {
3524
+ if (Oe(this.container))
3525
+ return Promise.resolve(z.open);
3526
+ const t = () => K(
3527
+ this.container,
3528
+ Lt,
3529
+ k.Session
3530
+ ).then((r = z.closed) => r), e = () => K(
3531
+ this.container,
3532
+ Lt,
3533
+ k.Session
3534
+ ).then((r = z.closed) => r);
3535
+ return this.container.getAsync("router").then((r) => r.isSticky() ? e().then((s) => s === z.open ? s : t()) : t());
3536
+ }
3537
+ hide() {
3538
+ return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn(
3539
+ "hide(): No-op as no view outlets are registered. Invoke the attach() command first."
3540
+ ), Promise.resolve()) : (this.outlets.forEach((t) => t.render()), this.action({ action: "hide" }).then(() => {
3541
+ this.setTriggerState(!1);
3542
+ }));
3543
+ }
3544
+ open() {
3545
+ return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn(
3546
+ "open(): No-op as no view outlets are registered. Invoke the attach() command first."
3547
+ ), Promise.resolve()) : (this.outlets.forEach((t) => t.render()), this.action({ action: "open" }).then(() => (this.widget.events.dispatch("tracking:widget-rendered", {}), this.onOpen())));
3548
+ }
3549
+ close() {
3550
+ return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn(
3551
+ "close(): No-op as no view outlets are registered. Invoke the attach() command first."
3552
+ ), Promise.resolve()) : this.action({ action: "close" }).then(() => this.onClose());
3553
+ }
3554
+ show() {
3555
+ return process.env.NODE_ENV !== "production" && console.warn(
3556
+ "show(): Command is deprecated and will be removed in the future. Use open() instead."
3557
+ ), this.open();
3558
+ }
3559
+ onAction(t, e) {
3560
+ switch (t) {
3561
+ case "close":
3562
+ case "open":
3563
+ case "hide":
3564
+ const r = t === "open" ? z.open : t === "close" ? z.closed : z.hidden;
3565
+ return this.setRenderState(r).then(() => {
3566
+ this.setTriggerState(r === z.open), r !== z.hidden ? r === z.open ? this.onOpen() : this.onClose() : this.outlets.forEach(
3567
+ (s) => {
3568
+ var i;
3569
+ return (i = s.options.triggerDOMElement) == null ? void 0 : i.setAttribute(
3570
+ "aria-expanded",
3571
+ "false"
3572
+ );
3573
+ }
3574
+ );
3575
+ });
3576
+ }
3577
+ }
3578
+ setRenderState(t) {
3579
+ const { invoke: e, events: r } = this.container.get("$widget");
3580
+ return Promise.all([
3581
+ X(
3582
+ this.container,
3583
+ Lt,
3584
+ S.Necessary,
3585
+ {
3586
+ medium: k.Session
3587
+ }
3588
+ ),
3589
+ X(
3590
+ this.container,
3591
+ Lt,
3592
+ S.Necessary,
3593
+ {
3594
+ medium: k.Local,
3595
+ duration: { minutes: 5 }
3596
+ }
3597
+ ),
3598
+ this.container.getAsync("router"),
3599
+ e("renderState")
3600
+ ]).then(
3601
+ ([s, i, o, a]) => {
3602
+ t === "unset" || !t ? (i(), s()) : (o.isSticky() && i(t), s(t)), r.dispatch("widget:render-state-changed", {
3603
+ previous: a,
3604
+ next: t
3605
+ });
3606
+ }
3607
+ );
3608
+ }
3609
+ onOpen() {
3610
+ return this.container.getAsync("router").then((t) => (this.outlets.forEach(
3611
+ (e) => {
3612
+ var r;
3613
+ return (r = e.options.triggerDOMElement) == null ? void 0 : r.setAttribute(
3614
+ "aria-expanded",
3615
+ "true"
3616
+ );
3617
+ }
3618
+ ), t.start()));
3619
+ }
3620
+ onClose() {
3621
+ const t = this.container.getManyAsync(
3622
+ "router",
3623
+ "components"
3624
+ );
3625
+ return (() => this.container.get("settings").then((r) => {
3626
+ const { activate: s } = this.container.get("$settings");
3627
+ return r.activate !== s ? this.setSettings(() => Promise.resolve({ activate: s })) : Promise.resolve();
3628
+ }))().then(() => t).then(
3629
+ ({
3630
+ router: r,
3631
+ components: s
3632
+ }) => {
3633
+ const i = s.nodes.visible;
3634
+ return this.outlets.forEach(
3635
+ (o) => {
3636
+ var a;
3637
+ return (a = o.options.triggerDOMElement) == null ? void 0 : a.setAttribute(
3638
+ "aria-expanded",
3639
+ "false"
3640
+ );
3641
+ }
3642
+ ), i.filter(
3643
+ (o) => o.attributes.properties.animation && o.attributes.properties.animation !== "none"
3644
+ ).length ? new Promise((o) => {
3645
+ setTimeout(() => {
3646
+ o(r);
3647
+ }, 200);
3648
+ }) : Promise.resolve(r);
3649
+ }
3650
+ ).then((r) => r.stop());
3651
+ }
3652
+ setTriggerState(t) {
3653
+ this.outlets.forEach((e) => {
3654
+ const {
3655
+ options: { triggerDOMElement: r, triggerOptions: s }
3656
+ } = e, { openTooltip: i, closedTooltip: o } = s || {};
3657
+ r && (t ? Hn(r, i) : ni(r, o));
3658
+ });
3659
+ }
3660
+ deactivate() {
3661
+ this.subs.forEach((e) => e());
3662
+ const t = [];
3663
+ return this.outlets.forEach((e) => t.push(e.dispose())), K(
3664
+ this.container,
3665
+ nn,
3666
+ k.Local
3667
+ ).then((e) => e === this.widget.name ? X(
3668
+ this.container,
3669
+ nn,
3670
+ S.Necessary,
3671
+ {
3672
+ medium: k.Local,
3673
+ scope: vt.Implementation
3674
+ }
3675
+ ).then((r) => r()).then(() => Promise.all(t)) : Promise.all(t));
3676
+ }
3677
+ }
3678
+ const xe = (n, t, e, r, s) => n.getAsync("componentResolver").then((i) => (i.registerComponent(t, e), ln(n, t, r || (() => {
3679
+ }), t, s))), Di = (n) => xe(
3680
+ n,
3681
+ "area",
3682
+ import("./area-65adc6a5.js"),
3683
+ (t) => {
3684
+ }
3685
+ ), ji = (n) => xe(
3686
+ n,
3687
+ "widget-header",
3688
+ import("./widget-header-f222904a.js"),
3689
+ (t) => {
3690
+ }
3691
+ ), _i = (n) => xe(
3692
+ n,
3693
+ "copyright",
3694
+ import("./copyright-ef48bb60.js"),
3695
+ (t) => {
3696
+ }
3697
+ );
3698
+ /**
3699
+ * @license
3700
+ * Copyright 2021 Google LLC
3701
+ * SPDX-License-Identifier: BSD-3-Clause
3702
+ */
3703
+ let gi = class extends Event {
3704
+ constructor(t, e, r) {
3705
+ super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.callback = e, this.subscribe = r != null && r;
3706
+ }
3707
+ };
3708
+ /**
3709
+ * @license
3710
+ * Copyright 2021 Google LLC
3711
+ * SPDX-License-Identifier: BSD-3-Clause
3712
+ */
3713
+ /**
3714
+ * @license
3715
+ * Copyright 2021 Google LLC
3716
+ * SPDX-License-Identifier: BSD-3-Clause
3717
+ */
3718
+ class rn {
3719
+ constructor(t, e, r, s) {
3720
+ var i;
3721
+ if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, a) => {
3722
+ this.unsubscribe && (this.unsubscribe !== a && (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, a)), this.unsubscribe = a;
3723
+ }, this.host = t, e.context !== void 0) {
3724
+ const o = e;
3725
+ this.context = o.context, this.callback = o.callback, this.subscribe = (i = o.subscribe) !== null && i !== void 0 && i;
3726
+ } else
3727
+ this.context = e, this.callback = r, this.subscribe = s != null && s;
3728
+ this.host.addController(this);
3729
+ }
3730
+ hostConnected() {
3731
+ this.dispatchRequest();
3732
+ }
3733
+ hostDisconnected() {
3734
+ this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
3735
+ }
3736
+ dispatchRequest() {
3737
+ this.host.dispatchEvent(new gi(this.context, this.t, this.subscribe));
3738
+ }
3739
+ }
3740
+ const Ii = "children", mi = "descriptor", yi = "container", Ri = "context", Hi = "layout", Vi = "properties";
3741
+ class Wi {
3742
+ constructor(t) {
3743
+ (this.host = t).addController(this), new rn(
3744
+ t,
3745
+ yi,
3746
+ (e) => {
3747
+ this._container = e, this.host.requestUpdate();
3748
+ },
3749
+ !0
3750
+ ), new rn(
3751
+ t,
3752
+ mi,
3753
+ (e) => {
3754
+ this._descriptor = e, this.host.requestUpdate();
3755
+ },
3756
+ !0
3757
+ );
3758
+ }
3759
+ hostConnected() {
3760
+ }
3761
+ hostDisconnected() {
3762
+ }
3763
+ dispatch(t, e) {
3764
+ return Xt(this, null, function* () {
3765
+ if (!this._container || !this._descriptor)
3766
+ return;
3767
+ const r = yield Yt.getInstance(
3768
+ this._container
3769
+ ), s = new yt(r).withId(
3770
+ this._descriptor.id
3771
+ );
3772
+ yield r.actions(
3773
+ s,
3774
+ this._descriptor.type || Pt()
3775
+ ).dispatch(t, e);
3776
+ });
3777
+ }
3778
+ }
3779
+ class vi {
3780
+ constructor(t, e) {
3781
+ this.lockWarningTime = t, this.lockErrorTime = e, this.tasks = [], this.current = Promise.resolve(), this.next = this.next.bind(this);
3782
+ }
3783
+ add(t, e, r, s) {
3784
+ this.tasks.push({ task: t, resolve: e, reject: r, done: s }), this.next();
3785
+ }
3786
+ next() {
3787
+ this.current = this.current.then(() => {
3788
+ const t = this.tasks.shift();
3789
+ if (t) {
3790
+ let e;
3791
+ const r = setTimeout(() => {
3792
+ process.env.NODE_ENV, e = setTimeout(() => {
3793
+ t.reject("lock timeout exceeded");
3794
+ }, this.lockErrorTime);
3795
+ }, this.lockWarningTime), s = Promise.resolve(t.task()).then((i) => (clearTimeout(r), clearTimeout(e), i));
3796
+ return Promise.resolve(s).then(this.next).then(
3797
+ () => s.then((i) => {
3798
+ t.done(), t.resolve(i);
3799
+ })
3800
+ ).catch((i) => (t.done(), t.reject(i), this.next()));
3801
+ }
3802
+ return Promise.resolve();
3803
+ });
3804
+ }
3805
+ }
3806
+ const Mt = /* @__PURE__ */ new WeakMap();
3807
+ function Bi(n, t = 5e3, e = 1e3) {
3808
+ return Mt.has(n) || Mt.set(n, new vi(t, e)), (r) => new Promise((s, i) => {
3809
+ const o = Mt.get(n);
3810
+ o.add(r, s, i, () => {
3811
+ o.tasks.length || Mt.delete(n);
3812
+ });
3813
+ });
3814
+ }
3815
+ export {
3816
+ Di as A,
3817
+ _i as C,
3818
+ xr as E,
3819
+ Mi as W,
3820
+ Ri as a,
3821
+ Yt as b,
3822
+ Ii as c,
3823
+ mi as d,
3824
+ yi as e,
3825
+ rn as f,
3826
+ ji as g,
3827
+ Wi as h,
3828
+ xe as i,
3829
+ Bi as j,
3830
+ Hi as l,
3831
+ Vi as p,
3832
+ gi as s
3833
+ };
3834
+ //# sourceMappingURL=index-d589d5e4.js.map