@telia-ace/widget-core-flamingo 1.0.14
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE.txt +6 -0
- package/README.md +3 -0
- package/dist/action-resolver.d.ts +9 -0
- package/dist/action-resolver.d.ts.map +1 -0
- package/dist/bootstrap.d.ts +16 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/component-platform/actions-controller.d.ts +41 -0
- package/dist/component-platform/actions-controller.d.ts.map +1 -0
- package/dist/component-platform/changeset-provider.d.ts +9 -0
- package/dist/component-platform/changeset-provider.d.ts.map +1 -0
- package/dist/component-platform/component-configuration-api.d.ts +3 -0
- package/dist/component-platform/component-configuration-api.d.ts.map +1 -0
- package/dist/component-platform/component-controller.d.ts +39 -0
- package/dist/component-platform/component-controller.d.ts.map +1 -0
- package/dist/component-platform/component-node-collection.d.ts +19 -0
- package/dist/component-platform/component-node-collection.d.ts.map +1 -0
- package/dist/component-platform/component-node.d.ts +64 -0
- package/dist/component-platform/component-node.d.ts.map +1 -0
- package/dist/component-platform/component-platform.d.ts +55 -0
- package/dist/component-platform/component-platform.d.ts.map +1 -0
- package/dist/component-platform/component-query.d.ts +17 -0
- package/dist/component-platform/component-query.d.ts.map +1 -0
- package/dist/component-platform/create-component-model.d.ts +37 -0
- package/dist/component-platform/create-component-model.d.ts.map +1 -0
- package/dist/component-platform/custom-component-handler.d.ts +22 -0
- package/dist/component-platform/custom-component-handler.d.ts.map +1 -0
- package/dist/component-platform/descriptor.d.ts +9 -0
- package/dist/component-platform/descriptor.d.ts.map +1 -0
- package/dist/component-platform/extend-component.d.ts +9 -0
- package/dist/component-platform/extend-component.d.ts.map +1 -0
- package/dist/component-platform/index.d.ts +19 -0
- package/dist/component-platform/index.d.ts.map +1 -0
- package/dist/component-platform/queries.d.ts +7 -0
- package/dist/component-platform/queries.d.ts.map +1 -0
- package/dist/component-platform/state-processor.d.ts +13 -0
- package/dist/component-platform/state-processor.d.ts.map +1 -0
- package/dist/component-resolver.d.ts +15 -0
- package/dist/component-resolver.d.ts.map +1 -0
- package/dist/environment.d.ts +49 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/event-subscriber.d.ts +8 -0
- package/dist/event-subscriber.d.ts.map +1 -0
- package/dist/implementation.d.ts +8 -0
- package/dist/implementation.d.ts.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2076 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +8 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/types/configuration.d.ts +87 -0
- package/dist/types/configuration.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/ui.d.ts +49 -0
- package/dist/types/ui.d.ts.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/widget-type.d.ts +8 -0
- package/dist/widget-type.d.ts.map +1 -0
- package/package.json +48 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/action-resolver.ts","../../../node_modules/.pnpm/@webprovisions+bootstrapping@1.0.13/node_modules/@webprovisions/bootstrapping/dist/index.js","../../../node_modules/.pnpm/@webprovisions+platform@1.1.4/node_modules/@webprovisions/platform/dist/index.js","../src/bootstrap.ts","../src/event-subscriber.ts","../src/component-platform/component-query.ts","../src/component-platform/component-controller.ts","../src/component-platform/actions-controller.ts","../src/component-platform/component-configuration-api.ts","../../../node_modules/.pnpm/@telia-ace+widget-utilities@1.0.16/node_modules/@telia-ace/widget-utilities/dist/index.js","../src/component-platform/component-node.ts","../src/component-platform/queries.ts","../src/component-platform/component-node-collection.ts","../src/component-platform/custom-component-handler.ts","../src/component-platform/state-processor.ts","../src/component-platform/component-platform.ts","../src/component-platform/create-component-model.ts","../src/component-platform/descriptor.ts","../src/component-platform/extend-component.ts","../src/component-resolver.ts","../src/version.ts","../src/environment.ts","../src/implementation.ts","../src/plugin.ts","../src/types/configuration.ts","../src/widget-type.ts"],"sourcesContent":["import {\r\n Container,\r\n EventManager,\r\n EventSubscriptionCancellation,\r\n Widget,\r\n} from '@webprovisions/platform';\r\n\r\nexport type Action = (origin: string, action: string, value?: any) => void;\r\n\r\nexport default class ActionResolver {\r\n private events: EventManager;\r\n\r\n constructor(container: Container) {\r\n const { events }: Widget = container.get('$widget');\r\n this.events = events.createChild(this);\r\n }\r\n\r\n action(target: string, action: string, value: any): void {\r\n this.events.dispatch(\r\n 'data:action',\r\n { action, value, target },\r\n { bubbles: true }\r\n );\r\n }\r\n\r\n subscribe(origin: string, fn: Action): EventSubscriptionCancellation {\r\n return this.events.subscribe(\r\n 'data:action',\r\n (_e, { action, value, target }) =>\r\n origin === target && fn(origin, action, value)\r\n );\r\n }\r\n}\r\n","const f = (n, t, e, ...r) => {\n const o = `[${n.get(\"$environment\").name || \"webprovisions\"}] ${e}`;\n switch (t) {\n case \"info\":\n console.info(o, ...r);\n break;\n case \"warning\":\n console.warn(o, ...r);\n break;\n case \"error\":\n console.error(o, ...r);\n break;\n }\n}, E = (n) => {\n const t = n.container || n;\n return {\n info: (e, ...r) => f(t, \"info\", e, ...r),\n warn: (e, ...r) => f(t, \"warning\", e, ...r),\n error: (e, ...r) => f(t, \"error\", e, ...r)\n };\n}, b = (n, t) => {\n if (!t)\n return !0;\n if (typeof t == \"string\") {\n const e = t.split(\",\");\n for (let r = 0, o = e.length; r < o; r++) {\n const i = e[r].trim();\n if (i === n || i === \"*\")\n return !0;\n }\n }\n return t instanceof Array ? t.indexOf(n) > -1 : !1;\n}, x = (n, t) => {\n if (typeof t == \"function\")\n return t(n);\n const e = typeof t == \"string\" ? q(t) : t;\n return !(!b(n.tenant || \"\", e.tenant || \"\") || !b(n.name, e.implementation || \"\"));\n}, I = (n) => (t) => x(t, n), h = (n) => n instanceof Array && n.length === 1 ? n[0] : n, q = (n) => {\n const t = {}, e = n.split(\":\");\n return e.length === 1 ? t.implementation = h(e[0].split(\",\")) : (t.tenant = h(e[0].split(\",\")), t.implementation = h(e[1].split(\",\"))), t;\n};\nvar m = /* @__PURE__ */ ((n) => (n.Implementation = \"implementation\", n.Widget = \"widget\", n))(m || {}), g = /* @__PURE__ */ ((n) => (n.Pre = \"pre\", n.Post = \"post\", n))(g || {});\nconst L = (n, t, e, r) => {\n try {\n const o = new t(e, r);\n return {\n name: n,\n invoke: (i, s) => {\n let a;\n return o[i] && (a = o[i].call(o, s)), Promise.resolve(a);\n },\n getInstance: () => o\n };\n } catch (o) {\n if (o.message && o.message.indexOf(\"is not a constructor\") >= 0)\n return {\n name: n,\n invoke: (i) => {\n let s;\n return i === \"initialize\" && (s = t(e, r)), Promise.resolve(s);\n },\n getInstance: () => t\n };\n throw o;\n }\n};\nfunction y(n, t) {\n return typeof n == \"undefined\" ? t : n;\n}\nclass O {\n constructor(t = {}) {\n this.part = t;\n }\n createCommand(t, e, r) {\n let o;\n typeof e == \"function\" ? o = {\n scope: m.Widget,\n stage: g.Post,\n defaultArgs: void 0,\n handlerResolver: e\n } : o = {\n scope: y(e.scope, m.Widget),\n stage: y(e.stage, g.Post),\n defaultArgs: e.defaultArgs,\n handlerResolver: r\n };\n let i = this.part;\n const s = t.split(\".\");\n return s.forEach((a, c) => {\n c === s.length - 1 ? i[a] || (i[a] = () => o) : i = this.part[a] = this.part[a] || {};\n }), this;\n }\n get() {\n return this.part;\n }\n}\nconst A = (n) => {\n const t = new O({});\n return n(t), t.get();\n};\nA((n) => {\n n.createCommand(\n \"types.register\",\n { scope: m.Implementation, stage: g.Pre },\n (t) => (e, r) => {\n t.container.get(\"$types\")[e] = r;\n }\n ).createCommand(\n \"type\",\n { stage: g.Pre },\n (t) => (e) => {\n t.container.register(\"$type\", e);\n }\n ).createCommand(\n \"settings\",\n { stage: g.Pre, defaultArgs: [null] },\n (t) => (e) => {\n t.events.dispatch(\n \"settings:change\",\n e,\n { bubbles: !0 }\n ), t.container.register(\"$settings\", e);\n }\n ).createCommand(\n \"plugin\",\n { stage: g.Pre },\n (t) => (e, r, o) => {\n const { container: i } = t;\n let s = null, a = e, c = r;\n typeof e == \"string\" && (s = e, a = r, c = o);\n const u = (l) => {\n const { transformPluginSettings: p } = t.container.get(\"$environmentOptions\"), k = p ? p(\n c || {},\n s,\n t.container,\n a\n ) : r;\n try {\n const d = L(\n s,\n a,\n i,\n k\n );\n i.get(\"$plugins\").push(d), l && d.invoke(\"initialize\", null);\n } catch (d) {\n E(t).warn(\"Error when initializing plugin\", d);\n }\n };\n t.container.get(\"$instance\") ? u(!0) : t.events.subscribeOnce(\"widget:instance-created\", () => u(!1));\n }\n ).createCommand(\n \"container.register\",\n (t) => (e, r) => {\n t.container.register(e, r);\n }\n ).createCommand(\n \"container.registerAsync\",\n (t) => (e, r) => {\n t.container.registerAsync(e, r);\n }\n ).createCommand(\n \"container.registerFactory\",\n (t) => (e, r) => {\n t.container.registerFactory(e, r);\n }\n ).createCommand(\n \"container.touch\",\n (t) => (e, r) => {\n t.container.touch(e, r);\n }\n ).createCommand(\n \"csp\",\n {},\n (t) => (e) => {\n t.container.register(\"csp\", e);\n }\n );\n});\nfunction S(n, t, e) {\n return Array.from(n.querySelectorAll(\n `div[id^=\"${t}_\"], div[id^=\"${t}:\"]`\n )).map((o) => {\n if (o.id.substr(0, 7) === `${t}_`)\n return { widgetName: o.id.substr(7), element: o };\n const { 3: i } = o.id.split(\":\");\n return { widgetName: i, element: o };\n });\n}\nconst W = (n) => {\n const t = n.map((e) => e.replace(/\\./g, \"\\\\.\")).join(\"|\");\n return new RegExp(\"^((http[s]?:)?//)?(\" + t + \")/([^\\\\s]+)\");\n}, R = (n) => n.href;\nfunction M(n, t) {\n const e = W(t), r = (i) => {\n const s = e.exec(R(i));\n return s ? {\n element: i,\n widget: s[4]\n } : null;\n };\n return Array.from(n.querySelectorAll(\"a\")).map((i) => r(i)).filter((i) => !!i).map((i) => ({\n element: i.element,\n widgetName: i.widget\n }));\n}\nfunction P(n) {\n return n.filter((t, e, r) => r.indexOf(t) === e);\n}\nclass N {\n constructor(t) {\n this.container = t.container, this.events = t.events;\n }\n watch(t) {\n const e = this.container.get(\"triggerElements\") || [], r = P(e.concat(t));\n this.container.register(\"triggerElements\", r), this.events.dispatch(\n \"bootstrap:trigger-elements-updated\",\n { triggerElements: r },\n { bubbles: !0 }\n );\n }\n}\nfunction C(n, ...t) {\n return n.implementation.events.subscribe(\"widget:create-instance\", (e, r) => {\n if (e.target === n) {\n let o = n.container.get(\"bootstrapping.monitor\");\n o || (o = new N(n), n.container.register(\"bootstrapping.monitor\", o)), o.watch(t);\n }\n }), n.load();\n}\nfunction $(n, t = document) {\n var s;\n const e = n.bindings, r = [].concat(\n M(t, e),\n S(t, ((s = n.environment) == null ? void 0 : s.name) || \"\")\n ), i = P(r.map(({ widgetName: a }) => a)).reduce((a, c) => {\n const u = n.widgets.get(c);\n if (!u)\n return process.env.NODE_ENV !== \"production\" && E(n).warn(`A trigger element for \"${c}\" was found but no widget with that name is available on the implementation (\"${n.name}\"). Make sure this is not a mistake.`), a;\n const l = r.filter((p) => p.widgetName === c).map((p) => p.element);\n return a.push(C(u, ...l)), a;\n }, []);\n return Promise.all(i);\n}\nfunction z() {\n return new Promise((n) => {\n document.readyState === \"loading\" ? document.addEventListener(\"DOMContentLoaded\", () => n()) : n();\n });\n}\nconst D = (n, t) => {\n const e = n;\n e.scan = (o) => $(e, o), e.bindings = t, e.attach = (o, ...i) => C(o, ...i);\n const { environment: r } = e;\n return typeof r.configure == \"undefined\" && (r.configure = (o, i) => {\n let s, a;\n i ? (s = o, a = i) : (s = \"*\", a = o), r.implementations.query(s).forEach((c) => c.configure(a)), r.events.subscribe(\"implementation:created\", (c, u) => {\n const { implementation: l } = u;\n I(s)(l) && l.configure(a);\n });\n }), e;\n};\nfunction B(n, t, e = () => [], r) {\n const o = { ready: !1 };\n n.container.register(\"bootstrapping\", o);\n const i = D(n, t);\n return z().then(() => {\n n.configure((...s) => {\n e().forEach((a) => a(...s));\n });\n }).then(() => $(i, r())).then(() => (o.ready = !0, n.events.dispatch(\"bootstrap:ready\", {}), i));\n}\nfunction _(n) {\n const t = {};\n return [].filter.call(n.attributes, (e) => /^data-/.test(e.name)).map((e) => e.name).forEach((e) => t[e.substr(5)] = n.getAttribute(e)), t;\n}\nconst v = (n, t, e) => {\n const r = _(n);\n e({\n sourceDOMElement: n,\n eventType: t,\n data: r\n });\n};\nfunction w(n, t, e) {\n n.forEach((r) => {\n r.dataset.attached !== \"true\" && (t === \"load\" ? v(r, t, e) : r.addEventListener(t, (o) => {\n o.preventDefault(), v(r, t, e);\n }), r.dataset.monitored = \"true\");\n });\n}\nfunction U(n, t, e) {\n const r = n.container.get(\"bootstrapping.monitor\");\n r && r.events.subscribe(\"bootstrap:trigger-elements-updated\", (i, s) => {\n w(\n s.triggerElements,\n t,\n e\n );\n });\n const o = n.container.get(\"triggerElements\");\n o && w(\n o,\n t,\n e\n );\n}\nconst j = (n, t, e) => {\n const r = n.split(\":\"), o = r[0], i = r.length > 1 ? r[1] : \"*\";\n return (t === \"*\" || o === t) && (e === \"*\" || i === e);\n};\nfunction V(n, t = \"*\", e = \"*\") {\n return n.filter((r) => {\n const o = r[0], i = r[1];\n return typeof o == \"string\" && typeof i == \"function\" ? j(o, t, e) : !1;\n }).map((r) => r[1]);\n}\nconst F = A((n) => {\n n.createCommand(\n \"ready\",\n { scope: m.Implementation, stage: g.Pre },\n (t) => (e) => {\n const { container: r } = t, o = r.owner;\n r.get(\"bootstrapping\").ready ? e(o) : o.events.subscribeOnce(\"bootstrap:ready\", () => {\n e(o);\n });\n }\n );\n});\nexport {\n F as ConfigurationApi,\n B as bootstrapImplementation,\n V as parseConfigurationHandlers,\n U as supportBootstrapping\n};\n//# sourceMappingURL=index.js.map\n","const z = /* @__PURE__ */ new WeakMap();\nfunction b() {\n return (s) => (z.has(s) || z.set(s, {}), z.get(s));\n}\nconst I = (s, t, e, ...n) => {\n const o = `[${s.get(\"$environment\").name || \"webprovisions\"}] ${e}`;\n switch (t) {\n case \"info\":\n console.info(o, ...n);\n break;\n case \"warning\":\n console.warn(o, ...n);\n break;\n case \"error\":\n console.error(o, ...n);\n break;\n }\n}, u = (s) => {\n const t = s.container || s;\n return {\n info: (e, ...n) => I(t, \"info\", e, ...n),\n warn: (e, ...n) => I(t, \"warning\", e, ...n),\n error: (e, ...n) => I(t, \"error\", e, ...n)\n };\n}, c = b(), M = (() => {\n let s = 0;\n return () => ++s;\n})(), _ = (s, t, e) => {\n const n = c(s).touchQueue.get(t);\n n && n.forEach((i) => {\n i(e, s);\n });\n};\nclass G {\n constructor(t, e, n, i) {\n this.key = t, this.factory = e, this.parent = n, this.container = i, this.id = M(), this.resolved = !1, this.constructed = !1, this.async = !0;\n }\n resolve() {\n if (!this.constructed) {\n const t = this.factory(this.parent, this.container);\n return this.constructed = !0, this.value = Promise.resolve(t).then((e) => (this.resolved = !0, _(this.container, this.key, e), e));\n }\n return this.value;\n }\n}\nclass J {\n constructor(t, e, n, i) {\n this.key = t, this.value = e, this.parent = n, this.container = i, this.id = M(), this.async = !1, this.resolved = !1, this.constructed = !0, this.resolve = () => (this.resolved = !0, _(this.container, this.key, this.value), this.value);\n }\n}\nclass X {\n constructor(t, e, n, i) {\n this.key = t, this.value = e, this.parent = n, this.container = i, this.id = M(), this.async = !1, this.resolved = !1, this.constructed = !1, this.resolve = () => {\n this.resolved = !0, this.constructed = !0;\n const r = this.value(this.parent, this.container);\n return _(this.container, this.key, this.value), r;\n };\n }\n}\nclass W {\n /**\n * Creates a new instance of `Container`.\n * @param owner The object owning this inctance.\n * @param name Optional name for the container.\n * @param parent Parent container this should be a child of.\n */\n constructor(t, e, n) {\n this.owner = t, this.name = e, this.parent = n, c(this).resolvers = /* @__PURE__ */ new Map(), c(this).touchQueue = /* @__PURE__ */ new Map(), c(this).children = [];\n }\n /**\n * Deletes an existing resolver by its unique id.\n * @param id Resolver id.\n */\n delete(t) {\n const e = c(this).resolvers, i = Array.from(e.values()).find((r) => r.id === t);\n return i ? (c(this).touchQueue.delete(i.key), Promise.resolve(e.delete(i.key))) : this.parent ? this.parent.delete(t) : Promise.resolve(!1);\n }\n /**\n * Clears the `Container` and any child containers by deleteing all registered resolvers.\n */\n clear() {\n const t = c(this).resolvers, e = Array.from(t.values());\n return Promise.all(e.map((n) => {\n if (n.constructed)\n return Promise.resolve(n.resolve()).then((i) => {\n if (i !== null && typeof i == \"object\" && typeof i.dispose == \"function\")\n return i.dispose.call(i, this, n);\n });\n })).then(() => {\n e.forEach((n) => this.delete(n.id)), c(this).children.forEach((n) => n.clear());\n });\n }\n /**\n * Detaches this `Container` instance from its parent, allowing it to be garbage-collected.\n */\n detach() {\n if (this.parent) {\n const t = c(this.parent).children, e = t.indexOf(this);\n e > -1 && (t.splice(e, 1), delete this.parent);\n }\n }\n /**\n * Provides a way of touching a value in the `Container` without forcing it to be resolved.\n * @param key Key of the resolved value to touch.\n * @param handler Handler function for touching the resolved value.\n */\n touch(t, e) {\n const i = c(this).resolvers.get(t);\n if (i && i.constructed)\n Promise.resolve(i.resolve()).then((o) => {\n e(o, this);\n });\n else {\n const o = c(this).touchQueue;\n let a = o.get(t);\n a || (a = [], o.set(t, a)), a.push(e);\n }\n return this.parent && !i ? this.parent.touch(t, e) : Promise.resolve();\n }\n /**\n * Registers an asynchronous resolver.\n * @param key Key of the resolver.\n * @param factory Value factory.\n */\n registerAsync(t, e) {\n const n = c(this).resolvers.get(t);\n n && !n.async && process.env.NODE_ENV !== \"production\" && u(this).warn(`Mismatching resolver type. You are registering an async resolver with a key ('${t}') previously used by a non-async resolver.`);\n const i = new G(t, e, n, this);\n return c(this).resolvers.set(t, i), i.id;\n }\n /**\n * Registers a factory resolver for constructing the value to be resolved.\n * @param key Key of the resolver.\n * @param factory Value factory.\n */\n registerFactory(t, e) {\n const n = c(this).resolvers.get(t);\n n && n.async && process.env.NODE_ENV !== \"production\" && u(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${t}') previously used by an async resolver.`);\n const i = new X(t, e, n, this);\n return c(this).resolvers.set(t, i), i.id;\n }\n /**\n * Registers an synchronous resolver.\n * @param key Key of the resolver.\n * @param value Value.\n */\n register(t, e) {\n const n = c(this).resolvers.get(t);\n n && n.async && process.env.NODE_ENV !== \"production\" && u(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${t}') previously used by an async resolver.`);\n const i = new J(t, e, n, this);\n return c(this).resolvers.set(t, i), i.id;\n }\n /**\n * Gets the value for a synchronous resolver.\n * @param key Key of resolver to get.\n */\n get(t) {\n const e = c(this).resolvers.get(t);\n if (e)\n return e.async && process.env.NODE_ENV !== \"production\" && u(this).warn(`You are retrieving an async value (with key '${t}') by the non-async function 'container.get(key)'. This will not be supported in future versions. Use 'container.getAsync(key) instead.'`), e.resolve();\n if (this.parent)\n return this.parent.get(t);\n }\n /**\n * Gets the value for a asynchronous resolver.\n * @param key Key of resolver to get.\n */\n getAsync(t) {\n const e = c(this).resolvers.get(t);\n if (e) {\n if (!e.async)\n throw process.env.NODE_ENV !== \"production\" && u(this).warn(`You are retrieving a non-async value (with key '${t}') by the async function 'container.getAsync(key)'.Use 'container.get(key) instead.'`), \"Mismatching resolver type\";\n return e.resolve();\n }\n return this.parent ? this.parent.getAsync(t) : Promise.resolve(void 0);\n }\n getMany(...t) {\n const e = {};\n return t.forEach((n) => e[n] = this.get(n)), e;\n }\n getManyAsync(...t) {\n const e = {};\n return Promise.all(t.map((n) => this.getAsync(n).then((i) => e[n] = i))).then(() => e);\n }\n createChild(t, e) {\n const n = new W(t, e, this);\n return c(this).children.push(n), n;\n }\n}\nclass L {\n /**\n * \n * @param type Type of event.\n * @param target The target of the event, which will handle the default behavour.\n * @param cancelable Whether the event is cancelable by calling preventDefault().\n * @param bubbles Whether the event will bubble up the parent hierarchy.\n */\n constructor(t, e, n = !1, i = !1) {\n this.type = t, this.target = e, this.cancelable = !!n, this.bubbles = !!i, this.defaultPrevented = !1;\n }\n /**\n * Cancels the default behaviour (if the event is cancelable).\n */\n preventDefault() {\n this.cancelable && (this.defaultPrevented = !0);\n }\n}\nconst p = b(), q = (s, t) => [].concat(\n p(s).listenerLookup.get(t.toLowerCase()) || [],\n p(s).listenerLookup.get(\"*\") || []\n), F = (s, t, e, n) => {\n let i, r;\n return t instanceof L ? (i = t, r = t.type) : (i = new L(t, s.target, !!e.cancelable, !!e.bubbles), r = t), { event: i, type: r, async: n };\n};\nclass D {\n /**\n * Creates a new Event Manager instance.\n * @param target The target of events dispatched from this Event Manager instance.\n * @param parent Parent Event Manager instance.\n */\n constructor(t, e) {\n this.target = t, this.parent = e, p(this).listenerLookup = /* @__PURE__ */ new Map(), p(this).children = [];\n }\n /**\n * Clears registered event listeners in this `EventManager` as well as in any children.\n */\n clear() {\n p(this).listenerLookup.clear(), p(this).children.forEach((t) => t.clear());\n }\n /**\n * Detaches this `EventManager` instance from its parent, allowing it to be garbage-collected.\n */\n detach() {\n if (this.parent) {\n const t = p(this.parent).children, e = t.indexOf(this);\n e > -1 && t.splice(e, 1);\n }\n }\n /**\n * Creates an event subscription by registering an listener for an event type.\n * @param type Event type to subscribe to.\n * @param listener Listener for the event.\n */\n subscribe(t, e, n) {\n const i = p(this).listenerLookup, r = t.toLowerCase();\n return i.has(r) || i.set(r, []), i.get(r).push(e), () => this.unsubscribe(t, e);\n }\n /**\n * Similar to `subscribe()` but immediately removes the subscription after the first call.\n * @param type Event type to subscribe to.\n * @param listener Listener for the event.\n */\n subscribeOnce(t, e) {\n const n = this.subscribe(t, (i, r) => (n(), e(i, r)));\n }\n /**\n * Removes a listener for the specified event type.\n * @param type Event type to remove subscription for.\n * @param listener Event listener to remove.\n */\n unsubscribe(t, e) {\n const n = p(this).listenerLookup.get(t.toLowerCase());\n if (n) {\n const i = n.indexOf(e);\n i > -1 && n.splice(i, 1);\n }\n }\n /**\n * Dispatches an asynchonous event to registered event listeners.\n * @param eventOrType Event type or Event object to dispatch.\n * @param data Optional data to be passed to event listeners.\n * @param options Optional event options used if first parameter is an event type.\n */\n dispatchAsync(t, e, n = {}) {\n const { event: i, type: r } = F(this, t, n, !0), o = q(this, r);\n let a = 0;\n const l = o.length;\n let h = Promise.resolve();\n for (a = 0; a < l; a++)\n ((m) => {\n h = h.then((y) => y ? Promise.resolve(!0) : Promise.resolve(m(i, e)).then(() => i.defaultPrevented));\n })(o[a]);\n return h.then((m) => !m && i.bubbles && this.parent ? this.parent.dispatchAsync(i, e) : m);\n }\n /**\n * Dispatches an event to registered event listeners.\n * @param eventOrType Event type or Event object to dispatch.\n * @param data Optional data to be passed to event listeners.\n * @param options Optional event options used if first parameter is an event type.\n */\n dispatch(t, e, n = {}) {\n const { event: i, type: r } = F(this, t, n, !1), o = q(this, r);\n let a = 0;\n const l = o.length;\n let h = !1;\n for (a = 0; a < l; a++)\n if (o[a](i, e), i.defaultPrevented) {\n h = !0;\n break;\n }\n return !h && i.bubbles && this.parent && (h = this.parent.dispatch(i, e)), h;\n }\n /**\n * Creates a child instance to the current Event manager.\n */\n createChild(t) {\n const e = new D(t, this);\n return p(this).children.push(e), e;\n }\n}\nconst P = (s, t, e) => {\n const i = s.get(\"$plugins\").map((r) => {\n try {\n return r.invoke(t, e);\n } catch (o) {\n u(s).error(\"An error occured when invoking a plugin.\", r, o);\n }\n });\n return Promise.all(i);\n};\nclass Z {\n constructor(t) {\n this.widget = t.get(\"$widget\"), this.events = this.widget.events, this.container = this.widget.container, this.initialized = null, this.activated = null, this.initialize = this.initialize.bind(this), this.activate = this.activate.bind(this), this.deactivate = this.deactivate.bind(this), this.invoke = this.invoke.bind(this), this.createInstance();\n }\n createInstance() {\n if (!this.widget.container.get(\"$instance\")) {\n const t = this.widget.container.get(\"$types\"), e = this.widget.container.get(\"$type\");\n !e && u(this).error(\"Unable to create widget. No type is specified.\");\n const n = t[e];\n !n && u(this).error(`Unable to create widget. Type '${e}' is not registered.`), this.widget.events.dispatch(\"widget:create-instance\", {}, { bubbles: !0 });\n try {\n this.widget.container.register(\n \"$instance\",\n new n(this.container)\n );\n } catch (i) {\n u(this).error(\"Unable to create widget type.\", i);\n }\n this.widget.events.dispatch(\"widget:instance-created\", {}, { bubbles: !0 });\n }\n }\n /**\n * The initialization is performed before the widget is activated but after it's configured\n * and thus all required services are available. This hook is a good place to bind events that\n * should trigger activation (e.g. click on \"trigger links\" or routing events)\n * @param {object} data Custom initialization data passed to the widget.\n */\n initialize(t) {\n return this.initialized = this.initialized || (() => {\n const e = this.container.get(\"$instance\"), n = e.initialize || (() => {\n });\n return this.initialized = Promise.resolve(n.call(e, t)).then(() => P(this.container, \"initialize\", t)).then(() => {\n });\n })();\n }\n /**\n * The activation is where the widget is actually created and rendered.\n * Activation can be initialized from the outside or from an event originated\n * in the \"initialize\" hook.\n * @param {object} data Custom activation data passed to the widget.\n */\n activate(t) {\n return (this.initialized || this.initialize()).then(() => {\n this.activated = this.activated || (() => P(this.container, \"activate\").then(() => {\n const n = this.container.get(\"$instance\");\n return this.activated = n.activate(t);\n }))();\n });\n }\n deactivate() {\n const t = this.container.get(\"$instance\"), e = t.deactivate || (() => {\n });\n return P(this.container, \"deactivate\").then(() => Promise.resolve(e.call(t))).then(() => {\n this.initialized = null, this.activated = null;\n }).then(() => {\n });\n }\n /**\n * Invokes a command on the widget component.\n * @param command Name of command\n * @param args Command arguments\n */\n invoke(t, ...e) {\n return P(this.container, \"invoke\", { command: t, args: e }).then(() => {\n const n = this.container.get(\"$instance\");\n if (n[t])\n return n[t].apply(n, e);\n const i = n.invoke;\n if (i)\n return i.call(n, t, ...e);\n });\n }\n}\nconst w = (s, t) => {\n if (!t)\n return !0;\n if (typeof t == \"string\") {\n const e = t.split(\",\");\n for (let n = 0, i = e.length; n < i; n++) {\n const r = e[n].trim();\n if (r === s || r === \"*\")\n return !0;\n }\n }\n return t instanceof Array ? t.indexOf(s) > -1 : !1;\n}, K = (s, t) => {\n if (typeof t == \"function\")\n return t(s);\n const e = typeof t == \"string\" ? nt(t) : t;\n return !(!w(s.implementation.tenant || \"\", e.tenant || \"\") || !w(s.implementation.name, e.implementation || \"\") || !w(s.name, e.widget || \"\") || !w(s.container.get(\"$type\"), e.type || \"\"));\n}, tt = (s, t) => {\n if (typeof t == \"function\")\n return t(s);\n const e = typeof t == \"string\" ? st(t) : t;\n return !(!w(s.tenant || \"\", e.tenant || \"\") || !w(s.name, e.implementation || \"\"));\n}, Q = (s) => (t) => K(t, s), et = (s) => (t) => tt(t, s), f = (s) => s instanceof Array && s.length === 1 ? s[0] : s, nt = (s) => {\n const t = {}, e = s.split(\":\");\n return e.length === 1 ? t.widget = f(e[0].split(\",\")) : e.length === 2 ? (t.implementation = f(e[0].split(\",\")), t.widget = f(e[1].split(\",\"))) : (t.tenant = f(e[0].split(\",\")), t.implementation = f(e[1].split(\",\")), t.widget = f(e[2].split(\",\"))), t;\n}, st = (s) => {\n const t = {}, e = s.split(\":\");\n return e.length === 1 ? t.implementation = f(e[0].split(\",\")) : (t.tenant = f(e[0].split(\",\")), t.implementation = f(e[1].split(\",\"))), t;\n}, E = b(), V = (s, t, e) => s.filter((n) => n.stage === t && Q(n.selector)(e));\nfunction it(s) {\n const t = s.container.get(\"$environment\");\n let e = E(t).configurationCache;\n e && (e = e.filter((n) => n[0] !== s), E(t).configurationCache = e);\n}\nvar k = /* @__PURE__ */ ((s) => (s.Implementation = \"implementation\", s.Widget = \"widget\", s))(k || {}), g = /* @__PURE__ */ ((s) => (s.Pre = \"pre\", s.Post = \"post\", s))(g || {});\nconst T = (s, t, e) => (Object.keys(t).forEach((n) => {\n const i = t[n];\n if (typeof i == \"function\") {\n const r = i();\n typeof r.defaultArgs != \"undefined\" && e(r, ...r.defaultArgs), s[n] = (...o) => {\n const a = Object.assign(\n {},\n r,\n { handlerResolver: r.handlerResolver.bind({}) }\n );\n return e(a, ...o), s;\n };\n } else\n s[n] = T(\n {},\n i,\n e\n );\n}), s), rt = (s, t) => {\n switch (t) {\n case \"implementation\":\n return s.implementation;\n case \"widget\":\n return s;\n }\n}, O = (s, t, e, n) => (n.forEach((i) => {\n T(\n s,\n i,\n (r, ...o) => {\n const a = {\n selector: t,\n stage: r.stage,\n handler: (l) => {\n const h = rt(l, r.scope), m = { container: h.container, events: h.events }, y = r.handlerResolver, x = y(m);\n let v = E(e.environment).configurationCache;\n return v || (v = E(e.environment).configurationCache = []), v.find((R) => R.indexOf(h) > -1 && R.indexOf(y) > -1) ? Promise.resolve() : (v.push([h, y]), Promise.resolve(x(...o)));\n }\n };\n e.instructions.push(a);\n }\n );\n}), s);\nfunction ot(s, t) {\n function e(n) {\n return O(\n {},\n n,\n s,\n t\n );\n }\n return O(\n e,\n \"*\",\n s,\n t\n );\n}\nclass $t {\n constructor(t, e) {\n this.container = t, this.settings = e, this.widget = t.get(\"$widget\"), this.events = this.widget.events;\n }\n}\nconst at = (s, t, e, n) => {\n try {\n const i = new t(e, n);\n return {\n name: s,\n invoke: (r, o) => {\n let a;\n return i[r] && (a = i[r].call(i, o)), Promise.resolve(a);\n },\n getInstance: () => i\n };\n } catch (i) {\n if (i.message && i.message.indexOf(\"is not a constructor\") >= 0)\n return {\n name: s,\n invoke: (r) => {\n let o;\n return r === \"initialize\" && (o = t(e, n)), Promise.resolve(o);\n },\n getInstance: () => t\n };\n throw i;\n }\n};\nfunction j(s, t) {\n return typeof s == \"undefined\" ? t : s;\n}\nclass ct {\n constructor(t = {}) {\n this.part = t;\n }\n createCommand(t, e, n) {\n let i;\n typeof e == \"function\" ? i = {\n scope: k.Widget,\n stage: g.Post,\n defaultArgs: void 0,\n handlerResolver: e\n } : i = {\n scope: j(e.scope, k.Widget),\n stage: j(e.stage, g.Post),\n defaultArgs: e.defaultArgs,\n handlerResolver: n\n };\n let r = this.part;\n const o = t.split(\".\");\n return o.forEach((a, l) => {\n l === o.length - 1 ? r[a] || (r[a] = () => i) : r = this.part[a] = this.part[a] || {};\n }), this;\n }\n get() {\n return this.part;\n }\n}\nconst ht = (s) => {\n const t = new ct({});\n return s(t), t.get();\n}, lt = ht((s) => {\n s.createCommand(\n \"types.register\",\n { scope: k.Implementation, stage: g.Pre },\n (t) => (e, n) => {\n t.container.get(\"$types\")[e] = n;\n }\n ).createCommand(\n \"type\",\n { stage: g.Pre },\n (t) => (e) => {\n t.container.register(\"$type\", e);\n }\n ).createCommand(\n \"settings\",\n { stage: g.Pre, defaultArgs: [null] },\n (t) => (e) => {\n t.events.dispatch(\n \"settings:change\",\n e,\n { bubbles: !0 }\n ), t.container.register(\"$settings\", e);\n }\n ).createCommand(\n \"plugin\",\n { stage: g.Pre },\n (t) => (e, n, i) => {\n const { container: r } = t;\n let o = null, a = e, l = n;\n typeof e == \"string\" && (o = e, a = n, l = i);\n const h = (m) => {\n const { transformPluginSettings: y } = t.container.get(\"$environmentOptions\"), x = y ? y(\n l || {},\n o,\n t.container,\n a\n ) : n;\n try {\n const v = at(\n o,\n a,\n r,\n x\n );\n r.get(\"$plugins\").push(v), m && v.invoke(\"initialize\", null);\n } catch (v) {\n u(t).warn(\"Error when initializing plugin\", v);\n }\n };\n t.container.get(\"$instance\") ? h(!0) : t.events.subscribeOnce(\"widget:instance-created\", () => h(!1));\n }\n ).createCommand(\n \"container.register\",\n (t) => (e, n) => {\n t.container.register(e, n);\n }\n ).createCommand(\n \"container.registerAsync\",\n (t) => (e, n) => {\n t.container.registerAsync(e, n);\n }\n ).createCommand(\n \"container.registerFactory\",\n (t) => (e, n) => {\n t.container.registerFactory(e, n);\n }\n ).createCommand(\n \"container.touch\",\n (t) => (e, n) => {\n t.container.touch(e, n);\n }\n ).createCommand(\n \"csp\",\n {},\n (t) => (e) => {\n t.container.register(\"csp\", e);\n }\n );\n}), ut = lt;\nfunction dt(s, t, e = []) {\n const n = [ut].concat(e), i = ot(\n t,\n n\n );\n s(i, t);\n}\nclass pt {\n constructor() {\n this.tasks = [], this.current = Promise.resolve(), this.next = this.next.bind(this);\n }\n add(t, e, n, i) {\n this.tasks.push({ task: t, resolve: e, reject: n, done: i }), this.next();\n }\n next() {\n this.current = this.current.then(() => {\n const t = this.tasks.shift();\n if (t) {\n const e = Promise.resolve(t.task());\n return Promise.resolve(e).then(this.next).then(() => e.then((n) => {\n t.done(), t.resolve(n);\n })).catch((n) => (t.done(), t.reject(n), this.next()));\n }\n return Promise.resolve();\n });\n }\n}\nconst A = /* @__PURE__ */ new WeakMap();\nfunction vt(s) {\n return A.has(s) || A.set(s, new pt()), (t) => new Promise((e, n) => {\n const i = A.get(s);\n i.add(t, e, n, () => {\n i.tasks.length || A.delete(s);\n });\n });\n}\nconst U = (s) => typeof s != \"undefined\";\nvar ft = /* @__PURE__ */ ((s) => (s.Activating = \"activating\", s.Loading = \"loading\", s.Activated = \"activated\", s.Deactivating = \"deactivating\", s.Deactivated = \"deactivated\", s))(ft || {});\nconst $ = (s, t) => {\n s.events.dispatch(\"widget:state-change\", { state: t }, { bubbles: !0 }), s.state = t, s.events.dispatch(\"widget:state-changed\", {}, { bubbles: !0 });\n}, d = b(), gt = (s) => {\n const { container: t, events: e } = s;\n t.get(\"$controller\") || (t.register(\"$controller\", new Z(t)), e.dispatch(\"widget:controller-created\", {}, { bubbles: !0 }));\n};\nclass mt {\n /**\n * Creates a new `Widget` instance.\n * @param name Name of widget.\n * @param implementation The implementation this instance belongs to.\n * @param configuration Configuration for the widget.\n */\n constructor(t, e, n) {\n this.state = \"deactivated\", this.name = t, this.implementation = e, this.container = e.container.createChild(this, t), this.events = e.events.createChild(this), d(this).subscriptions = [], n && e.configure((i) => {\n const r = i(t);\n U(n.type) && r.type(n.type), U(n.settings) && r.settings(n.settings), n.plugins && Object.keys(n.plugins).forEach((o) => {\n var l;\n const a = (l = n.plugins) == null ? void 0 : l[o];\n r.plugin(o, a);\n });\n }), this.load = this.load.bind(this), this.activate = this.activate.bind(this), this.invoke = this.invoke.bind(this), this.deactivate = this.deactivate.bind(this);\n }\n /**\n * Initializes the widget, if not already initialized, and applies any\n * pending configuration.\n */\n load() {\n return vt(this)(() => {\n d(this).deactivatedPromise = null;\n const t = this.state === \"deactivated\";\n t && ($(\n this,\n \"activating\"\n /* Activating */\n ), this.container.register(\"$widget\", this), this.container.register(\"$controller\", null), this.container.register(\"$plugins\", []), this.container.register(\"$type\", null), this.container.register(\"$instance\", null)), $(\n this,\n \"loading\"\n /* Loading */\n );\n const e = this.implementation.instructions, n = V(e, g.Pre, this);\n return Promise.all(n.map((i) => i.handler(this))).then(() => {\n gt(this);\n const i = V(e, g.Post, this);\n return Promise.all(i.map((r) => r.handler(this))).then(() => {\n t && this.container.get(\"$controller\").initialize();\n });\n }).then(() => ($(\n this,\n \"activated\"\n /* Activated */\n ), this));\n });\n }\n /**\n * Activates the widget and makes it ready for receiving commands.\n * @param data Activation data\n */\n activate(t) {\n d(this).subscriptions.push(\n this.implementation.events.subscribe(\"implementation:configured\", () => {\n [\n \"activated\",\n \"activating\",\n \"loading\"\n /* Loading */\n ].indexOf(this.state) > -1 && this.load();\n })\n );\n const e = d(this).activatedPromise;\n return e ? (process.env.NODE_ENV !== \"production\" && u(this).warn(`Widget '${this.name}' has already been activated. The passed arguments for this activation will be discarded.`, t), e) : d(this).activatedPromise = this.load().then(() => this.container.get(\"$controller\").activate(t));\n }\n /**\n * Invokes a command on a widget. If the widget isn't activate the invocation \n * will be suspended until activation.\n * @param command Command to invoke.\n * @param args Command arguments.\n */\n invoke(t, ...e) {\n const n = d(this).activatedPromise, i = (r, ...o) => n.then(this.load).then(() => this.container.get(\"$controller\").invoke(r, ...o));\n return n ? i(t, ...e) : (process.env.NODE_ENV !== \"production\" && u(this).warn(\"You are invoking a command on a deactivated widget. The invocation will be queued until the widget is activated.\", this), new Promise((r) => {\n const o = this.events.subscribe(\"widget:state-changed\", () => {\n this.state === \"activated\" && (o(), r(i(t, ...e)));\n });\n }));\n }\n /**\n * Deactivates the widget by clearing the `Container` and removing any event subscriptions in the\n * `EventManager`.\n */\n deactivate() {\n const t = d(this).deactivatedPromise;\n return t || (this.state === \"deactivated\" ? Promise.resolve() : ($(\n this,\n \"deactivating\"\n /* Deactivating */\n ), d(this).deactivatedPromise = this.container.get(\"$controller\").deactivate().then(() => (d(this).activatedPromise = null, d(this).subscriptions.forEach((e) => e()), d(this).subscriptions = [], this.container.clear().then(() => {\n this.events.clear(), it(this), $(\n this,\n \"deactivated\"\n /* Deactivated */\n );\n })))));\n }\n}\nconst Pt = (s) => s.deactivate().then(() => {\n s.events.detach(), s.container.detach(), s.implementation.widgets.delete(s.name);\n});\nclass At {\n /**\n * Creates a new `Widget` instance.\n * @param container The `Container` instance to base the widget upon.\n */\n constructor(t) {\n 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, n) => {\n this.settings = n;\n });\n }\n}\nconst Y = b();\nclass yt {\n /**\n * Creates a new Implementation instance.\n * @param configuration Configuration for the implementation.\n * @param environment The parent environment.\n * @param configurationApiExtensions Optional configuration API extensions.\n */\n constructor(t, e, n = []) {\n this.instructions = [], this.widgets = /* @__PURE__ */ new Map(), this.name = t.name, this.tenant = t.tenant, this.environment = e, this.container = e.container.createChild(this, this.name), this.events = e.events.createChild(this), this.container.register(\"$types\", {}), Y(this).configurationApiExtensions = n;\n }\n /**\n * Loads all widgets in the implementation.\n */\n load() {\n const t = Array.from(this.widgets.values());\n return Promise.all(t.map((e) => e.load())).then(() => t);\n }\n /**\n * Configures the implementation by adding a configuration callback.\n * @param configFn Callback function for configuration.\n */\n configure(t) {\n return dt(t, this, Y(this).configurationApiExtensions), this.events.dispatch(\n \"implementation:configured\",\n { implementation: this },\n { bubbles: !0 }\n ), this;\n }\n /**\n * Creates a widget on the implementation and returns its `WidgetData`.\n * @param name Widget name.\n * @param configuration Widget configuration.\n */\n createWidget(t, e) {\n const n = new mt(t, this, e);\n return this.widgets.set(n.name, n), n;\n }\n}\nfunction wt(s, t, e) {\n const n = new yt(s, t, e);\n return s.widgets && Object.keys(s.widgets).forEach((i) => {\n var o;\n const r = (o = s.widgets) == null ? void 0 : o[i];\n n.createWidget(i, r);\n }), n;\n}\nclass C {\n constructor(t, e) {\n this.selectorFactory = e, typeof t == \"function\" ? this.resolver = t : this.resolver = () => t;\n }\n append(t) {\n const e = typeof t == \"function\" ? t : () => t;\n return new C(\n () => this.all().concat(e()),\n this.selectorFactory\n );\n }\n all() {\n return this.resolver().concat([]);\n }\n query(t) {\n return this.all().filter(this.selectorFactory(t));\n }\n find(t) {\n const e = this.query(t);\n if (e.length)\n return e[0];\n }\n}\nconst S = \"#____version____#\";\nfunction Et(s, t) {\n const e = B.create(s);\n return Promise.all(\n (t || []).map((n) => Promise.resolve(n(e)))\n ).then(() => e);\n}\nconst N = b(), bt = (s) => s.tenant ? `${s.name}:${s.tenant}` : s.name, H = class {\n constructor(s, t = [], e = {}) {\n this.widgets = new C(\n () => {\n let n = [];\n return this.implementations.all().forEach((i) => {\n n = n.concat(Array.from(i.widgets.values()));\n }), n;\n },\n Q\n ), this.implementations = new C([], et), this.name = s, this.container = new W(this, s), this.events = new D(this), this.container.register(\"$version\", S), this.container.register(\"$environment\", this), this.container.register(\"$environmentOptions\", e), N(this).configurationApiExtensions = t;\n }\n /**\n * Creates an implementation based on the provided configuration.\n * @param config Implementation configuration.\n */\n createImplementation(s) {\n const t = bt(s);\n let e = this.implementations.find(t);\n if (e)\n return process.env.NODE_ENV !== \"production\" && u(e).warn(`Implementation \"${t}\" already exist on current environment.`), e;\n const n = N(this).configurationApiExtensions;\n return e = wt(\n s,\n this,\n n\n ), this.implementations = this.implementations.append([e]), this.events.dispatch(\"implementation:created\", { implementation: e }), e;\n }\n /**\n * Patches the Environment instance configuration.\n * @param configuration Environment configuration.\n */\n patch(s = {}) {\n const { name: t, configurationApiExtensions: e } = s;\n typeof t != \"undefined\" && t !== null && (this.name = t), e && e.forEach(\n (n) => {\n N(this).configurationApiExtensions.push(n);\n }\n );\n }\n /**\n * Creates a new Environment instance based on the provided configuration.\n * @param configuration Environment configuration.\n */\n static create(s = {}) {\n return new H(\n s.name || \"\",\n s.configurationApiExtensions,\n s.options\n );\n }\n};\nlet B = H;\nB.version = S;\nexport {\n k as ConfigurationScope,\n g as ConfigurationStage,\n W as Container,\n B as Environment,\n D as EventManager,\n L as EventObject,\n yt as Implementation,\n $t as Plugin,\n mt as Widget,\n Z as WidgetController,\n ft as WidgetState,\n At as WidgetType,\n ht as createConfigurationApi,\n Et as createEnvironment,\n Pt as destroy,\n Pt as destroyWidget,\n u as logger,\n et as selectImplementations,\n Q as selectWidgets,\n S as version\n};\n//# sourceMappingURL=index.js.map\n","import { bootstrapImplementation, BootstrappedImplementation } from '@webprovisions/bootstrapping';\r\nimport { ConfigureCallback, selectImplementations } from '@webprovisions/platform';\r\nimport Implementation from './implementation';\r\n\r\nexport type BootstrapOptions = {\r\n /**\r\n * Resolver function for the root element to base the bootstrapping on.\r\n */\r\n rootElementResolver?: () => HTMLElement;\r\n};\r\n\r\n/**\r\n * Bootstraps an `Implementation` by scanning trigger elements and attaches them to\r\n * their corresponding widgets.\r\n */\r\nexport default (\r\n implementation: Implementation,\r\n configure: ConfigureCallback,\r\n options: BootstrapOptions = {}\r\n): Promise<BootstrappedImplementation> => {\r\n return bootstrapImplementation(\r\n implementation as any,\r\n implementation.bindings,\r\n () => {\r\n const runtimeConfigurationHandlers = implementation.container\r\n .get('$runtimecfg')\r\n .map((cfgHandlerArgs: any) => {\r\n const fnOrSelector = cfgHandlerArgs[0];\r\n if (typeof fnOrSelector === 'function') {\r\n return fnOrSelector;\r\n }\r\n if (selectImplementations(fnOrSelector)(implementation)) {\r\n return cfgHandlerArgs[1];\r\n }\r\n })\r\n .filter((handler: any) => !!handler);\r\n return (configure ? [configure] : []).concat(runtimeConfigurationHandlers);\r\n },\r\n options.rootElementResolver || (() => document.body)\r\n );\r\n};\r\n","import {\r\n EventListener,\r\n EventManager,\r\n EventSubscriptionCancellation,\r\n} from '@webprovisions/platform';\r\n\r\nexport type SubscribeDelegate = (type: string, listener: EventListener) => void;\r\n\r\n/**\r\n * Creates s subscriber for the specified `EventManager` and provides a single cancellation\r\n * function for all registered subscriptions.\r\n */\r\nexport const createEventSubscriber = (\r\n events: EventManager\r\n): [SubscribeDelegate, EventSubscriptionCancellation] => {\r\n const subs: EventSubscriptionCancellation[] = [];\r\n\r\n const subscribe = (type: string, listener: EventListener) => {\r\n subs.push(events.subscribe(type, listener));\r\n };\r\n\r\n return [\r\n subscribe,\r\n () => {\r\n subs.forEach((sub) => {\r\n sub();\r\n });\r\n },\r\n ];\r\n};\r\n","import { AbstractComponentController } from './component-controller';\r\nimport { ComponentNode } from './component-node';\r\nimport { ComponentPlatform } from './component-platform';\r\n\r\nexport type ComponentQueryRule = {\r\n id?: string;\r\n type?: string;\r\n};\r\n\r\nexport class ComponentQuery {\r\n constructor(private platform: ComponentPlatform, public rules: ComponentQueryRule[] = []) {}\r\n\r\n match(node: ComponentNode) {\r\n return this.rules.every((rule) => {\r\n if (rule.id && rule.id !== node.id) {\r\n return false;\r\n }\r\n if (rule.type && rule.type !== node.type) {\r\n return false;\r\n }\r\n return true;\r\n });\r\n }\r\n\r\n ofType(type: string): ComponentQuery {\r\n this.rules.push({ type });\r\n return this;\r\n }\r\n\r\n withId(id: string): ComponentQuery {\r\n this.rules.push({ id });\r\n return this;\r\n }\r\n\r\n select(): AbstractComponentController {\r\n return new AbstractComponentController(this.platform, this);\r\n }\r\n}\r\n","import { EventSubscriptionCancellation } from '@webprovisions/platform';\r\nimport { createEventSubscriber, SubscribeDelegate } from '../event-subscriber';\r\nimport { ActionsController } from './actions-controller';\r\nimport {\r\n ChangesetOptions,\r\n ComponentNode,\r\n ComponentNodeContext,\r\n ComponentNodeLayout,\r\n ComponentNodeProperties,\r\n RemoveChangeset,\r\n} from './component-node';\r\nimport { ComponentPlatform } from './component-platform';\r\nimport { ComponentQuery } from './component-query';\r\n\r\nexport interface ComponentController {\r\n actions: ActionsController;\r\n\r\n writeProperties(\r\n properties: Partial<ComponentNodeProperties>,\r\n options: ChangesetOptions\r\n ): void;\r\n\r\n writeContext(\r\n context: Partial<ComponentNodeContext>,\r\n options: ChangesetOptions\r\n ): void;\r\n\r\n writeLayout(\r\n context: Partial<ComponentNodeLayout>,\r\n options: ChangesetOptions\r\n ): void;\r\n\r\n dispose(): void;\r\n}\r\n\r\nexport class ComponentNodeController implements ComponentController {\r\n actions: ActionsController;\r\n\r\n private subscribe: SubscribeDelegate;\r\n private unsubscribe: EventSubscriptionCancellation;\r\n\r\n constructor(\r\n private platform: ComponentPlatform,\r\n public node: ComponentNode,\r\n ns?: string\r\n ) {\r\n this.actions = new ActionsController(\r\n platform,\r\n new ComponentQuery(platform).withId(node.id),\r\n ns\r\n );\r\n const [subscribe, unsubscribe] = createEventSubscriber(\r\n this.platform.events\r\n );\r\n this.subscribe = subscribe;\r\n this.unsubscribe = unsubscribe;\r\n }\r\n\r\n properties<T extends ComponentNodeProperties>(\r\n updated?: (properties: T) => void | Partial<ComponentNodeProperties>\r\n ): T {\r\n if (updated) {\r\n this.node.touchProperties((properties) => updated(<T>properties));\r\n }\r\n return <T>this.node.attributes.properties;\r\n }\r\n\r\n context(\r\n updated?: (context: ComponentNodeContext) => void\r\n ): ComponentNodeContext {\r\n if (updated) {\r\n this.subscribe('components:context-changed', (_event, { node }) => {\r\n if (node === this.node) {\r\n updated(this.node.attributes.context);\r\n }\r\n });\r\n }\r\n return this.node.attributes.context;\r\n }\r\n\r\n layout(updated?: (layout: ComponentNodeLayout) => void): ComponentNodeLayout {\r\n if (updated) {\r\n this.subscribe('components:layout-changed', (_event, { node }) => {\r\n if (node === this.node) {\r\n updated(this.node.attributes.layout);\r\n }\r\n });\r\n }\r\n return this.node.attributes.layout;\r\n }\r\n\r\n writeProperties(\r\n properties:\r\n | Partial<ComponentNodeProperties>\r\n | ((\r\n properties: ComponentNodeProperties\r\n ) => Partial<ComponentNodeProperties>),\r\n options?: ChangesetOptions\r\n ): void {\r\n this.node.writeProperties(properties, options);\r\n }\r\n\r\n writeContext(\r\n context: Partial<ComponentNodeContext>,\r\n options?: ChangesetOptions\r\n ): void {\r\n this.node.writeProperties(context, options);\r\n }\r\n\r\n writeLayout(\r\n layout: Partial<ComponentNodeLayout>,\r\n options?: ChangesetOptions\r\n ): void {\r\n this.node.writeLayout(layout, options);\r\n }\r\n\r\n dispose() {\r\n this.unsubscribe();\r\n this.actions.dispose();\r\n }\r\n}\r\n\r\nexport class AbstractComponentController implements ComponentController {\r\n actions: ActionsController;\r\n private removes: RemoveChangeset[] = [];\r\n\r\n constructor(\r\n private platform: ComponentPlatform,\r\n private target: ComponentQuery,\r\n private clearOnDispose = true\r\n ) {\r\n this.actions = new ActionsController(this.platform, this.target);\r\n }\r\n\r\n writeProperties(\r\n properties: Partial<ComponentNodeProperties>,\r\n options?: ChangesetOptions\r\n ): void {\r\n this.removes.push(\r\n this.platform.write({\r\n options,\r\n attributes: { properties },\r\n target: this.target,\r\n removable: this.clearOnDispose,\r\n })\r\n );\r\n }\r\n\r\n writeContext(\r\n context: Partial<ComponentNodeContext>,\r\n options?: ChangesetOptions\r\n ): void {\r\n this.removes.push(\r\n this.platform.write({\r\n options,\r\n attributes: { context },\r\n target: this.target,\r\n removable: this.clearOnDispose,\r\n })\r\n );\r\n }\r\n\r\n writeLayout(\r\n layout: Partial<ComponentNodeLayout>,\r\n options?: ChangesetOptions\r\n ): void {\r\n this.removes.push(\r\n this.platform.write({\r\n options,\r\n attributes: { layout },\r\n target: this.target,\r\n removable: this.clearOnDispose,\r\n })\r\n );\r\n }\r\n\r\n dispose() {\r\n this.removes.forEach((remove) => {\r\n remove();\r\n });\r\n this.actions.dispose();\r\n }\r\n}\r\n","import { EventSubscriptionCancellation } from '@webprovisions/platform';\r\nimport { ComponentNodeController } from './component-controller';\r\nimport { ComponentNode } from './component-node';\r\nimport { ComponentPlatform } from './component-platform';\r\nimport { ComponentQuery } from './component-query';\r\n\r\nexport type ActionData = any;\r\n\r\nexport type ActionHandler = (data: any, options: any, instance: ComponentNodeController) => any;\r\nexport type NextActionDelegate = (data: any, options?: any) => Promise<any>;\r\nexport type WatchActionDelegate = (\r\n input: ActionData,\r\n next: NextActionDelegate,\r\n instance: ComponentNodeController\r\n) => Promise<any> | any;\r\nexport type ActionWatcherContext = {\r\n source: ComponentNode;\r\n action: string;\r\n};\r\n\r\nexport type ActionsState = {\r\n handlers: {\r\n fn: ActionHandler;\r\n key: string;\r\n target: ComponentQuery;\r\n ns?: string;\r\n }[];\r\n\r\n watchers: {\r\n target: ComponentQuery;\r\n fn: WatchActionDelegate;\r\n key: string;\r\n ns?: string;\r\n }[];\r\n};\r\n\r\ntype ActionWatcherExecutionResult = {\r\n data: any;\r\n options: any;\r\n cancelled: boolean;\r\n};\r\n\r\nconst executeActionListeners = (\r\n listeners: WatchActionDelegate[],\r\n data: any,\r\n controller: ComponentNodeController\r\n): Promise<ActionWatcherExecutionResult> => {\r\n const stack = listeners.concat();\r\n const dispatch = (\r\n data: any,\r\n globalOptions: any,\r\n controller: ComponentNodeController\r\n ): Promise<ActionWatcherExecutionResult> => {\r\n let cancelled = true;\r\n if (stack.length) {\r\n const handler = stack.shift() as WatchActionDelegate;\r\n\r\n const next = (data: any, options: any) => {\r\n cancelled = false;\r\n return dispatch(data, Object.assign({}, globalOptions, options), controller);\r\n };\r\n\r\n return Promise.resolve(handler(data, next, controller)).then((result) => ({\r\n ...result,\r\n cancelled,\r\n }));\r\n }\r\n\r\n return Promise.resolve({ data, cancelled: false, options: globalOptions });\r\n };\r\n return dispatch(data, {}, controller);\r\n};\r\n\r\nexport class ActionsController {\r\n private subscriptions: (() => void)[] = [];\r\n constructor(\r\n private platform: ComponentPlatform,\r\n private target: ComponentQuery,\r\n private ns?: string\r\n ) {\r\n this.create = this.create.bind(this);\r\n }\r\n\r\n create(key: string, fn: ActionHandler = () => {}): EventSubscriptionCancellation {\r\n const handler = {\r\n key,\r\n fn,\r\n target: this.target,\r\n ns: this.ns,\r\n };\r\n this.platform.actionsState.handlers.push(handler);\r\n const subscription = () => {\r\n const index = this.platform.actionsState.handlers.indexOf(handler);\r\n if (index > -1) {\r\n this.platform.actionsState.handlers.splice(index, 1);\r\n }\r\n };\r\n this.subscriptions.push(subscription);\r\n return subscription;\r\n }\r\n\r\n dispatch(key: string, data: any): Promise<{ [instanceId: string]: any }> {\r\n const instances: ComponentNode[] = this.platform.nodes.all.concat(\r\n this.platform.nodes.detached\r\n );\r\n\r\n const output: { [instanceId: string]: any } = {};\r\n\r\n // handlers matching the specified pattern.\r\n const handlers = this.platform.actionsState.handlers.filter(\r\n (handler) => handler.key === key && (!handler.ns || !this.ns || handler.ns === this.ns)\r\n );\r\n\r\n return Promise.all(\r\n handlers.map((handler) => {\r\n // select all matching instances for this particular\r\n // handler (a handler can be mapped to many instances)\r\n const matchedInstances = instances.filter(\r\n (instance) => handler.target.match(instance) && this.target.match(instance)\r\n );\r\n\r\n // execute watchers for each matched instance\r\n const watchers = this.platform.actionsState.watchers\r\n .filter((watcher) => {\r\n return (\r\n watcher.key === key &&\r\n (!watcher.ns || !this.ns || watcher.ns === this.ns) &&\r\n matchedInstances.some((instance) => watcher.target.match(instance))\r\n );\r\n })\r\n .map((watcher) => watcher.fn);\r\n\r\n // execute watchers and handler for each instance\r\n return Promise.all(\r\n matchedInstances.map((node) => {\r\n const controller = new ComponentNodeController(\r\n this.platform,\r\n node,\r\n this.ns\r\n );\r\n return executeActionListeners(watchers, data, controller).then((input) => {\r\n const { data = {}, options, cancelled } = input;\r\n return Promise.resolve(\r\n cancelled ? {} : handler.fn(data, options, controller)\r\n ).then((handlerResponse) => {\r\n output[node.id] = handlerResponse;\r\n });\r\n });\r\n })\r\n );\r\n })\r\n ).then(() => output);\r\n }\r\n\r\n watch(key: string, fn: WatchActionDelegate): EventSubscriptionCancellation {\r\n let parsedKey = key;\r\n let parsedNs = this.ns;\r\n const sections = key.split('.');\r\n\r\n if (sections.length > 1) {\r\n parsedNs = sections[0];\r\n parsedKey = sections.splice(1).join('.');\r\n }\r\n const watcher = {\r\n fn,\r\n target: this.target,\r\n key: parsedKey,\r\n ns: parsedNs,\r\n };\r\n this.platform.actionsState.watchers.push(watcher);\r\n const subscription = () => {\r\n const index = this.platform.actionsState.watchers.indexOf(watcher);\r\n if (index > -1) {\r\n this.platform.actionsState.watchers.splice(index, 1);\r\n }\r\n };\r\n this.subscriptions.push(subscription);\r\n return subscription;\r\n }\r\n\r\n dispose() {\r\n this.subscriptions.forEach((unsubscribe) => unsubscribe());\r\n }\r\n}\r\n","import { createConfigurationApi } from '@webprovisions/platform';\r\nimport { CustomHandlerCallback } from './custom-component-handler';\r\n\r\ntype Options = {\r\n handlers?: [string, CustomHandlerCallback][];\r\n};\r\n\r\nexport default createConfigurationApi((builder) => {\r\n builder.createCommand('components', (context) => (config: Options) => {\r\n context.events.subscribeOnce(\r\n 'components:platform-created',\r\n (_event, { platform }) => {\r\n if (config.handlers) {\r\n config.handlers.forEach(([key, handler]) => {\r\n platform.addComponentHandler(key, handler);\r\n });\r\n }\r\n }\r\n );\r\n });\r\n});\r\n","var O = Object.getOwnPropertySymbols;\nvar L = Object.prototype.hasOwnProperty, B = Object.prototype.propertyIsEnumerable;\nvar x = (e, t) => {\n var o = {};\n for (var r in e)\n L.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);\n if (e != null && O)\n for (var r of O(e))\n t.indexOf(r) < 0 && B.call(e, r) && (o[r] = e[r]);\n return o;\n};\nfunction I(e) {\n const t = [];\n return e.forEach((o) => {\n t.indexOf(o) === -1 && t.push(o);\n }), t;\n}\nfunction k(e = \"\", t = \"\") {\n const o = e.split(\" \").concat(t.split(\" \"));\n return I(o).join(\" \").trim();\n}\nfunction U(e, t) {\n if (e) {\n if (typeof t == \"string\")\n return t;\n if (Array.isArray(t)) {\n let o = \"\";\n return t.forEach((r) => o = k(o, r)), o;\n }\n }\n}\nfunction X(...e) {\n let t = \"\";\n return e.length && e.forEach((o) => {\n typeof o == \"string\" ? t = k(t, o) : Array.isArray(o) ? t = k(t, U(...o)) : typeof o != \"undefined\" && o !== null && process.env.NODE_ENV !== \"production\" && p.warn(\n \"appendClassNames: arguments either haveto be a string or [boolean, ...string[]]. Passed args:\",\n ...e\n );\n }), t;\n}\nconst z = (e, t) => {\n let o, r = [];\n return (i) => (clearTimeout(o), new Promise((n, a) => {\n r.push([i, n, a]), o = setTimeout(() => {\n let f = t();\n r.forEach(([c, g, m]) => {\n f = c(f);\n }), r = [], n(f);\n }, e);\n }));\n}, tt = z;\nfunction T(e) {\n const t = {};\n if (typeof e == \"number\" || typeof e == \"string\")\n return e;\n for (const o in e)\n if (e.hasOwnProperty(o)) {\n const r = e[o], i = o.substring(0, 1).toLowerCase() + o.substring(1);\n if (Object.prototype.toString.call(r) === \"[object Array]\") {\n t[i] = [];\n for (let n = 0, a = r.length; n < a; n++)\n t[i].push(T(r[n]));\n } else\n r !== null && typeof r == \"object\" ? t[i] = T(r) : t[i] = r;\n }\n return t;\n}\nfunction N(e = {}) {\n const $ = e, {\n phrase: t = \"\",\n category: o,\n guideCategory: r,\n contactCategory: i,\n take: n,\n connectionKey: a,\n accordion: f,\n id: c,\n uriName: g,\n sorting: m,\n tag: u,\n tagId: l,\n tagTitle: h\n } = $, P = x($, [\n \"phrase\",\n \"category\",\n \"guideCategory\",\n \"contactCategory\",\n \"take\",\n \"connectionKey\",\n \"accordion\",\n \"id\",\n \"uriName\",\n \"sorting\",\n \"tag\",\n \"tagId\",\n \"tagTitle\"\n ]), s = {};\n return Object.keys(P).forEach((A) => {\n typeof e[A] == \"string\" && (s[A] = e[A]);\n }), typeof t == \"string\" && t.length && (s.phrase = t), t === null && (s.phrase = t), typeof r == \"string\" && r !== \"0\" && (s.guideCategory = r), typeof r == \"number\" && r !== 0 && (s.guideCategory = r), typeof r == \"object\" && r !== null && (typeof r.id == \"string\" && r.id !== \"0\" && (s.guideCategory = r.id), typeof r.id == \"number\" && r.id !== 0 && (s.guideCategory = r.id)), typeof i == \"string\" && i !== \"0\" && (s.contactCategory = i), typeof i == \"number\" && i !== 0 && (s.contactCategory = i), typeof i == \"object\" && i !== null && (typeof i.id == \"string\" && i.id !== \"0\" && (s.contactCategory = i.id), typeof i.id == \"number\" && i.id !== 0 && (s.contactCategory = i.id)), typeof o == \"string\" && o !== \"0\" && (s.category = o), typeof o == \"number\" && o !== 0 && (s.category = o), typeof o == \"object\" && o !== null && (typeof o.id == \"string\" && o.id !== \"0\" && (s.category = o.id), typeof o.id == \"number\" && o.id !== 0 && (s.category = o.id)), c && (s.id = c), g && (+s.category || +s.guideCategory || +s.guide || +s.contactCategory || +s.contactMethod) && (s.uriName = g), a && (s.connectionKey = a), n && (s.take = n), m && (s.sorting = m), typeof f == \"string\" && f.length > 0 && (s.accordion = f), typeof u == \"string\" && u !== \"0\" && (s.tag = u), typeof u == \"number\" && u !== 0 && (s.tag = u), Array.isArray(u) && u.length && (s.tag = u), (typeof l == \"string\" || typeof l == \"number\") && (s.tagId = l), typeof h == \"string\" && (s.tagTitle = h), typeof s.tag == \"string\" && (s.tag = s.tag.split(\",\")), s;\n}\nfunction* q(e) {\n if (e)\n for (let t = 0; t < e.length; t++) {\n const o = e[t];\n yield o, o.items && (yield* q(o.items));\n }\n}\nconst V = (e, t) => {\n const o = q(t);\n let r = o.next(), i = null;\n for (; !r.done; )\n r.value.id === e && (i = r.value), r = o.next();\n return i;\n}, W = V, M = (e) => {\n if (!e)\n return \"\";\n const t = [\n { from: /[äæǽ]+/gi, to: \"ae\" },\n { from: /[öœ]+/gi, to: \"oe\" },\n { from: /[ü]+/gi, to: \"ue\" },\n { from: /[Ä]+/gi, to: \"Ae\" },\n { from: /[Ü]+/gi, to: \"Ue\" },\n { from: /[Ö]+/gi, to: \"Oe\" },\n { from: /[ÀÁÂÃÄÅǺĀĂĄǍΑΆẢẠẦẪẨẬẰẮẴẲẶА]+/gi, to: \"A\" },\n { from: /[àáâãåǻāăąǎªαάảạầấẫẩậằắẵẳặа]+/gi, to: \"a\" },\n { from: /[Б]+/gi, to: \"B\" },\n { from: /[б]+/gi, to: \"b\" },\n { from: /[ÇĆĈĊČ]+/gi, to: \"C\" },\n { from: /[çćĉċč]+/gi, to: \"c\" },\n { from: /[Д]+/gi, to: \"D\" },\n { from: /[д]+/gi, to: \"d\" },\n { from: /[ÐĎĐΔ]+/gi, to: \"Dj\" },\n { from: /[ðďđδ]+/gi, to: \"dj\" },\n { from: /[ÈÉÊËĒĔĖĘĚΕΈẼẺẸỀẾỄỂỆЕЭ]+/gi, to: \"E\" },\n { from: /[èéêëēĕėęěέεẽẻẹềếễểệеэ]+/gi, to: \"e\" },\n { from: /[Ф]+/gi, to: \"F\" },\n { from: /[ф]+/gi, to: \"f\" },\n { from: /[ĜĞĠĢΓГҐ]+/gi, to: \"G\" },\n { from: /[ĝğġģγгґ]+/gi, to: \"g\" },\n { from: /[ĤĦ]+/gi, to: \"H\" },\n { from: /[ĥħ]+/gi, to: \"h\" },\n { from: /[ÌÍÎÏĨĪĬǏĮİΗΉΊΙΪỈỊИЫ]+/gi, to: \"I\" },\n { from: /[ìíîïĩīĭǐįıηήίιϊỉịиыї]+/gi, to: \"i\" },\n { from: /[Ĵ]+/gi, to: \"J\" },\n { from: /[ĵ]+/gi, to: \"j\" },\n { from: /[ĶΚК]+/gi, to: \"K\" },\n { from: /[ķκк]+/gi, to: \"k\" },\n { from: /[ĹĻĽĿŁΛЛ]+/gi, to: \"L\" },\n { from: /[ĺļľŀłλл]+/gi, to: \"l\" },\n { from: /[М]+/gi, to: \"M\" },\n { from: /[м]+/gi, to: \"m\" },\n { from: /[ÑŃŅŇΝН]+/gi, to: \"N\" },\n { from: /[ñńņňʼnνн]+/gi, to: \"n\" },\n { from: /[ÒÓÔÕŌŎǑŐƠØǾΟΌΩΏỎỌỒỐỖỔỘỜỚỠỞỢО]+/gi, to: \"O\" },\n { from: /[òóôõōŏǒőơøǿºοόωώỏọồốỗổộờớỡởợо]+/gi, to: \"o\" },\n { from: /[П]+/gi, to: \"P\" },\n { from: /[п]+/gi, to: \"p\" },\n { from: /[ŔŖŘΡР]+/gi, to: \"R\" },\n { from: /[ŕŗřρр]+/gi, to: \"r\" },\n { from: /[ŚŜŞȘŠΣС]+/gi, to: \"S\" },\n { from: /[śŝşșšſσςс]+/gi, to: \"s\" },\n { from: /[ȚŢŤŦτТ]+/gi, to: \"T\" },\n { from: /[țţťŧт]+/gi, to: \"t\" },\n { from: /[ÙÚÛŨŪŬŮŰŲƯǓǕǗǙǛŨỦỤỪỨỮỬỰУ]+/gi, to: \"U\" },\n { from: /[ùúûũūŭůűųưǔǖǘǚǜυύϋủụừứữửựу]+/gi, to: \"u\" },\n { from: /[ÝŸŶΥΎΫỲỸỶỴЙ]+/gi, to: \"Y\" },\n { from: /[ýÿŷỳỹỷỵй]+/gi, to: \"y\" },\n { from: /[В]+/gi, to: \"V\" },\n { from: /[в]+/gi, to: \"v\" },\n { from: /[Ŵ]+/gi, to: \"W\" },\n { from: /[ŵ]+/gi, to: \"w\" },\n { from: /[ŹŻŽΖЗ]+/gi, to: \"Z\" },\n { from: /[źżžζз]+/gi, to: \"z\" },\n { from: /[ÆǼ]+/gi, to: \"AE\" },\n { from: /[ß]+/gi, to: \"ss\" },\n { from: /[IJ]+/gi, to: \"IJ\" },\n { from: /[ij]+/gi, to: \"ij\" },\n { from: /[Œ]+/gi, to: \"OE\" },\n { from: /[ƒ]+/gi, to: \"f\" },\n { from: /[ξ]+/gi, to: \"ks\" },\n { from: /[π]+/gi, to: \"p\" },\n { from: /[β]+/gi, to: \"v\" },\n { from: /[μ]+/gi, to: \"m\" },\n { from: /[ψ]+/gi, to: \"ps\" },\n { from: /[Ё]+/gi, to: \"Yo\" },\n { from: /[ё]+/gi, to: \"yo\" },\n { from: /[Є]+/gi, to: \"Ye\" },\n { from: /[є]+/gi, to: \"ye\" },\n { from: /[Ї]+/gi, to: \"Yi\" },\n { from: /[Ж]+/gi, to: \"Zh\" },\n { from: /[ж]+/gi, to: \"zh\" },\n { from: /[Х]+/gi, to: \"Kh\" },\n { from: /[х]+/gi, to: \"kh\" },\n { from: /[Ц]+/gi, to: \"Ts\" },\n { from: /[ц]+/gi, to: \"ts\" },\n { from: /[Ч]+/gi, to: \"Ch\" },\n { from: /[ч]+/gi, to: \"ch\" },\n { from: /[Ш]+/gi, to: \"Sh\" },\n { from: /[ш]+/gi, to: \"sh\" },\n { from: /[Щ]+/gi, to: \"Shch\" },\n { from: /[щ]+/gi, to: \"shch\" },\n { from: /[ЪъЬь]+/gi, to: \"\" },\n { from: /[Ю]+/gi, to: \"Yu\" },\n { from: /[ю]+/gi, to: \"yu\" },\n { from: /[Я]+/gi, to: \"Ya\" },\n { from: /[я]+/gi, to: \"ya\" }\n ], o = /[^a-zA-Z0-9]+/g, r = /[-]$/;\n let i = e;\n for (const n in t)\n t.hasOwnProperty(n) && t[n].from.test(e) && (i = i.replace(t[n].from, t[n].to));\n return i = i.replace(o, \"-\"), i = i.replace(r, \"\"), i = i.toLowerCase(), i || \"humany\";\n}, E = M;\nfunction S(e, t = {}, o) {\n return e.forEach((r) => {\n o && (t[+r.id] = o), r.items && S(r.items, t, r.id);\n }), t;\n}\nfunction Y(e, t, o = [e], r = S(t)) {\n const i = (a) => {\n const f = r[+a];\n f && (o.unshift(f), i(f));\n }, n = r[+e];\n return n && (o.unshift(n), i(n)), o;\n}\nconst F = (e, t) => typeof e == \"undefined\" || typeof t == \"undefined\" ? /* @__PURE__ */ new Map() : new Map(\n e.map((o) => {\n const r = W(o, t);\n return [o, r];\n })\n), et = (e, t, o, r = \"guide-categories\") => o.getAsync(\"dataClient\").then((i) => i.fetch(r, { expandCategories: \"descendants\" }).then(({ categories: n }) => {\n const a = (f) => {\n const c = Y(f, n), g = F(c, n), m = [];\n return c.forEach((u) => {\n const l = g.get(u);\n l && m.push({\n routeName: e,\n title: l.title,\n symbol: l.symbol,\n id: l.id,\n routeParams: N(r === \"contact-method-categories\" ? {\n contactCategory: l.id,\n uriName: E(l.title)\n } : {\n guideCategory: l.id,\n uriName: E(l.title)\n })\n });\n }), m;\n };\n return Array.isArray(t) ? t.reduce((f, c) => {\n const g = a(c);\n return g.length > 0 && f.push(g), f;\n }, []) : a(t);\n})), K = (e) => {\n let t, o;\n e.split(\",\")[0].indexOf(\"base64\") !== -1 ? t = atob(e.split(\",\")[1]) : t = decodeURI(e.split(\",\")[1]), o = e.split(\",\")[0].split(\":\")[1].split(\";\")[0];\n const r = [];\n for (let i = 0; i < t.length; i++)\n r[i] = t.charCodeAt(i);\n return new Blob([new Uint8Array(r)], { type: o });\n}, ot = K;\nfunction rt(...e) {\n return process.env.NODE_ENV !== \"production\" && console && console.warn(...e);\n}\nconst C = (e, t, ...o) => typeof t == \"string\" ? e(`[humany] ${t}`, ...o) : e(t, ...o), y = class {\n constructor() {\n this.keys = [], this.log = (e, ...t) => this.lookup(e, () => y.log(...t)), this.warn = (e, ...t) => this.lookup(e, () => y.warn(...t)), this.error = (e, ...t) => this.lookup(e, () => y.error(...t)), this.info = (e, ...t) => this.lookup(e, () => y.info(...t));\n }\n lookup(e, t) {\n this.keys.indexOf(e) === -1 && (this.keys.push(e), t());\n }\n};\nlet p = y;\np.log = (...e) => C(console.log, ...e);\np.warn = (...e) => C(console.warn, ...e);\np.error = (...e) => C(console.error, ...e);\np.info = (...e) => C(console.info, ...e);\nconst D = (e) => {\n let t = {}, o, r;\n if (typeof e != \"object\" || e === null)\n return e;\n t = Array.isArray(e) ? [] : {};\n for (r in e)\n o = e[r], t[r] = typeof o == \"object\" && o !== null ? D(o) : o;\n return t;\n}, j = D, it = (e) => {\n if (!e)\n return null;\n const t = localStorage.getItem(\n `humany_${_(e.tenant + e.name)}`\n );\n if (t) {\n const { activeStickyWidget: o } = JSON.parse(t);\n if (o && o.value && e.widgets.get(o.value)) {\n const i = document.createElement(\"a\");\n i.setAttribute(\n \"href\",\n `//${e.bindings[0]}/${o.value}`\n ), document.body.appendChild(i);\n }\n }\n}, nt = (e, t = !1) => {\n const o = new Date(e);\n let r = `${o.getMonth() + 1}`, i = `${o.getDate()}`;\n const n = o.getFullYear();\n if (r.length < 2 && (r = `0${r}`), i.length < 2 && (i = `0${i}`), t) {\n let a = `${o.getHours()}`, f = `${o.getMinutes()}`;\n return a.length < 2 && (a = `0${a}`), f.length < 2 && (f = `0${f}`), `${[n, r, i].join(\"-\")} ${[a, f].join(\":\")}`;\n }\n return [n, r, i].join(\"-\");\n};\nfunction st(e) {\n const t = document.cookie;\n if (t.length > 0) {\n let o = t.indexOf(`${e}=`);\n if (o !== -1) {\n o = o + e.length + 1;\n let r = t.indexOf(\";\", o);\n return r === -1 && (r = t.length), unescape(t.substring(o, r));\n }\n }\n return null;\n}\nfunction _(e) {\n let t = 0;\n if (e.length === 0)\n return t.toString();\n for (let o = 0; o < e.length; o++) {\n const r = e.charCodeAt(o);\n t = (t << 5) - t + r, t = t & t;\n }\n return t.toString();\n}\nconst ft = (e, t) => {\n if (!e || !t)\n return !0;\n let o = t.parentNode, r = !1;\n for (; o !== null; )\n o === e && (r = !0), o = o.parentNode;\n return r;\n};\nfunction at(e) {\n return e.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/\\s+/g, \"-\").toLowerCase();\n}\nclass Z {\n constructor(t, o) {\n this.lockWarningTime = t, this.lockErrorTime = o, this.tasks = [], this.current = Promise.resolve(), this.next = this.next.bind(this);\n }\n add(t, o, r, i) {\n this.tasks.push({ task: t, resolve: o, reject: r, done: i }), this.next();\n }\n next() {\n this.current = this.current.then(() => {\n const t = this.tasks.shift();\n if (t) {\n let o;\n const r = setTimeout(() => {\n process.env.NODE_ENV !== \"production\" && p.warn(\n `A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,\n t\n ), o = setTimeout(() => {\n t.reject(\"lock timeout exceeded\");\n }, this.lockErrorTime);\n }, this.lockWarningTime), i = Promise.resolve(t.task()).then((n) => (clearTimeout(r), clearTimeout(o), n));\n return Promise.resolve(i).then(this.next).then(\n () => i.then((n) => {\n t.done(), t.resolve(n);\n })\n ).catch((n) => (t.done(), t.reject(n), this.next()));\n }\n return Promise.resolve();\n });\n }\n}\nconst b = /* @__PURE__ */ new WeakMap();\nfunction ct(e, t = 5e3, o = 1e3) {\n return b.has(e) || b.set(e, new Z(t, o)), (r) => new Promise((i, n) => {\n const a = b.get(e);\n a.add(r, i, n, () => {\n a.tasks.length || b.delete(e);\n });\n });\n}\nconst v = (e) => !!e && typeof e == \"object\" && !Array.isArray(e), J = (e, ...t) => {\n const o = j(e), r = j(t);\n return w(o, ...r);\n}, w = (e, ...t) => {\n if (!t.length)\n return e;\n const o = t.shift();\n if (v(e) && v(o))\n for (const r in o)\n v(o[r]) ? (e[r] || Object.assign(e, { [r]: {} }), w(e[r], o[r])) : Object.assign(e, { [r]: o[r] });\n return w(e, ...t);\n}, ut = J, Q = (e, t) => {\n const o = () => t.querySelectorAll(\"[data-loading=true]\").length > 0, i = (() => {\n let a = !1;\n return () => {\n if (a)\n return;\n e.get(\"$widget\").events.dispatch(\"widget:data-loaded\", {\n element: t\n }), a = !0;\n };\n })();\n if (!o())\n return i();\n new MutationObserver((a, f) => {\n a.find(\n (g) => g.type === \"attributes\" && g.attributeName === \"data-loading\"\n ) && !o() && (f.disconnect(), i());\n }).observe(t, {\n attributes: !0,\n childList: !0,\n subtree: !0\n });\n}, R = (e, t) => {\n e.get(\"$widget\").container.getAsync(\"components\").then((r) => {\n r.events.subscribeOnce(\"components:component-model-initialized\", () => {\n let i = r.nodes.visible.reduce(\n (f, c) => (!c.name || !c.type || c.type === \"view\" || c.type === \"root\" || c.attributes.layout.size === \"none\" || t.querySelector(`[data-name=\"${c.name}\"]`) || f.push(c.name), f),\n []\n ), n = !1;\n new MutationObserver((f, c) => {\n f.forEach((g) => {\n if (g.addedNodes) {\n const m = Array.from(\n g.addedNodes\n ).reduce((u, l) => {\n const h = l.getAttribute && l.getAttribute(\"data-name\");\n return h && i.indexOf(h) > -1 && u.push(h), u;\n }, []);\n i = i.filter((u) => m.indexOf(u) === -1), !n && i.length === 0 && (n = !0, Q(e, t), c.disconnect());\n }\n });\n }).observe(t, {\n attributes: !1,\n characterData: !1,\n childList: !0,\n subtree: !0,\n attributeOldValue: !1,\n characterDataOldValue: !1\n });\n });\n });\n}, lt = R, H = (e = {}) => (Object.keys(e).forEach((t) => {\n (e[t] === null || typeof e[t] == \"undefined\") && delete e[t];\n}), e), gt = H;\nfunction mt(e, t, o) {\n let r = \"\";\n if (o) {\n const i = /* @__PURE__ */ new Date();\n i.setTime(i.getTime() + o * 24 * 60 * 60 * 1e3), r = `; expires=${i.toUTCString()}`;\n }\n document.cookie = `${e}=${t}${r}; path=/`;\n}\nconst dt = (e, t) => {\n let o = !0;\n return Object.keys(e).length !== Object.keys(t).length || Object.keys(e).some((i) => !Object.keys(t).some((a) => i === a)) ? !1 : (Object.keys(e).forEach((i) => {\n if (o) {\n const n = typeof e[i] == \"undefined\" ? \"\" : e[i], a = typeof t[i] == \"undefined\" ? \"\" : t[i];\n o = n.toString() === a.toString();\n }\n }), o);\n}, d = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);\nfunction ht() {\n return d() + d() + \"-\" + d() + \"-\" + d() + \"-\" + d() + \"-\" + d() + d() + d();\n}\nclass pt {\n constructor(t) {\n this.queue = [], this.queueAttemptCalls = 0, this.callCount = 5, this.add = (o) => {\n this.queue.push(o), this.queueAttempt = setInterval(this.processQueue, 1e3);\n }, this.processQueue = () => {\n if (this.queue.length > 0) {\n const o = [];\n this.queue.forEach((r, i) => {\n const n = r();\n typeof n == \"function\" && (n(), o.push(i));\n }), this.queue = this.queue.filter((r, i) => !(o.indexOf(i) > -1)), this.queueAttempt && clearInterval(this.queueAttempt);\n }\n this.queueAttemptCalls > this.callCount && (clearInterval(this.queueAttempt), this.queueAttemptCalls = 0), this.queueAttemptCalls = this.queueAttemptCalls + 1;\n }, t && t.callCount && (this.callCount = t.callCount);\n }\n}\nexport {\n p as Logger,\n pt as WaitFor,\n X as appendClassNames,\n et as buildCategoryTrail,\n T as camilize,\n Y as categoryTrail,\n tt as createBatch,\n N as createParams,\n ot as dataURItoBlob,\n rt as debugLog,\n j as deepClone,\n it as findAndActivateStoredWidgets,\n W as findCategoryById,\n nt as formatDate,\n E as formatUrl,\n F as getCategoryTrailAsObjects,\n st as getCookie,\n _ as hash,\n ft as htmlParentContains,\n at as kebabCase,\n ct as lock,\n ut as mergeDeep,\n lt as notifyDataLoaded,\n gt as removeNullAndUndefinedValues,\n mt as setCookie,\n dt as shallowCompare,\n ht as uuid\n};\n//# sourceMappingURL=index.js.map\n","import { Logger, uuid } from '@telia-ace/widget-utilities';\r\nimport {\r\n Container,\r\n EventManager,\r\n EventSubscriptionCancellation,\r\n} from '@webprovisions/platform';\r\nimport { Breakpoints } from '../types';\r\n\r\nexport type ComponentNodeEventData = { node: ComponentNode };\r\n\r\nexport type RemoveChangeset = () => void;\r\n\r\nexport type ComponentNodeAttributes = {\r\n tags: string[];\r\n properties: ComponentNodeProperties;\r\n context: ComponentNodeContext;\r\n layout: ComponentNodeLayout;\r\n};\r\n\r\nexport type ResolveComponentNodeProperties = (\r\n properties: ComponentNodeProperties\r\n) => Partial<ComponentNodeProperties> | void;\r\n\r\nexport type ResolveComponentNodeContext = (\r\n context: ComponentNodeContext\r\n) => Partial<ComponentNodeContext>;\r\n\r\nexport type ResolveComponentNodeLayout = (\r\n layout: ComponentNodeLayout\r\n) => Partial<ComponentNodeLayout>;\r\n\r\nexport type ComponentNodeSettings = {\r\n tags?: string[];\r\n properties?: ComponentNodeProperties | ResolveComponentNodeProperties;\r\n context?: ComponentNodeContext | ResolveComponentNodeContext;\r\n layout?: ComponentNodeLayout | ResolveComponentNodeLayout;\r\n};\r\n\r\nexport type ComponentNodeProperties = { [key: string]: any };\r\n\r\nexport type ComponentNodeContext = { [key: string]: any };\r\n\r\nexport type ComponentNodeLayout = {\r\n size?: Size;\r\n indent?: number;\r\n order?: number;\r\n};\r\n\r\nexport type Size = number | 'full' | 'none';\r\n\r\nexport type UnmountComponentNode = () => void;\r\n\r\nexport type ChangesetOptions = {\r\n breakpoints?: Breakpoints;\r\n};\r\n\r\nexport type Changeset = [Partial<ComponentNodeSettings>, ChangesetOptions];\r\n\r\nexport class ComponentNode {\r\n id: string;\r\n type: string;\r\n name?: string;\r\n parent?: ComponentNode;\r\n tags: string[] = [];\r\n children: { [key: string]: ComponentNode[] } = {};\r\n changesets: Changeset[] = [];\r\n attributes: ComponentNodeAttributes;\r\n\r\n private mountCount = 0;\r\n\r\n constructor(\r\n private events: EventManager,\r\n type: string\r\n ) {\r\n this.id = uuid();\r\n this.type = type;\r\n this.attributes = {\r\n context: {},\r\n properties: {},\r\n layout: {},\r\n tags: [],\r\n };\r\n // write default attributes\r\n this.writeLayout({ size: 'full', indent: 0 });\r\n }\r\n\r\n mount(\r\n viewOutletContainer: Container,\r\n _element?: HTMLElement\r\n ): UnmountComponentNode {\r\n let mountedNodes: Map<ComponentNode, EventSubscriptionCancellation> =\r\n viewOutletContainer.get('mounted-nodes');\r\n\r\n if (!mountedNodes) {\r\n mountedNodes = new Map<ComponentNode, EventSubscriptionCancellation>();\r\n viewOutletContainer.register('mounted-nodes', mountedNodes);\r\n }\r\n\r\n if (mountedNodes.has(this)) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n Logger.error(\r\n 'Trying to mount an already mounted component node.',\r\n this\r\n );\r\n }\r\n return () => {};\r\n }\r\n\r\n /**\r\n * Dispatched when a node is mounted in a component.\r\n * This happens once for every `ViewOutlet`.\r\n */\r\n this.events.dispatch('components:node-mounted', { node: this });\r\n\r\n if (this.mountCount === 0) {\r\n this.mountCount = this.mountCount + 1;\r\n /**\r\n * Dispatched when a node is mounted in a component the first time.\r\n */\r\n this.events.dispatch('components:node-enter', { node: this });\r\n }\r\n\r\n return () => {\r\n mountedNodes.delete(this);\r\n this.events.dispatch('components:node-unmounted', { node: this });\r\n\r\n this.mountCount = this.mountCount - 1;\r\n if (this.mountCount === 0) {\r\n this.events.dispatch('components:node-exit', { node: this });\r\n }\r\n };\r\n }\r\n\r\n appendChild(node: ComponentNode, branch: string = 'default') {\r\n if (node.parent) {\r\n if (node.parent === this) {\r\n return;\r\n }\r\n node.parent.removeChild(node);\r\n }\r\n node.parent = this;\r\n\r\n if (!this.children[branch]) {\r\n this.children[branch] = [];\r\n }\r\n this.children[branch].push(node);\r\n\r\n this.events.dispatch('components:node-appended', { node });\r\n }\r\n\r\n prependChild(node: ComponentNode, branch: string = 'default') {\r\n if (node.parent) {\r\n if (node.parent === this) {\r\n return;\r\n }\r\n node.parent.removeChild(node);\r\n }\r\n node.parent = this;\r\n\r\n if (!this.children[branch]) {\r\n this.children[branch] = [];\r\n }\r\n this.children[branch].unshift(node);\r\n\r\n this.events.dispatch('components:node-appended', { node });\r\n }\r\n\r\n touchProperties(\r\n properties: ResolveComponentNodeProperties,\r\n options: ChangesetOptions = {},\r\n removable?: boolean\r\n ): RemoveChangeset {\r\n const attributes: Partial<ComponentNodeSettings> = { properties };\r\n const changeset: Changeset = [attributes, options];\r\n this.changesets.push(changeset);\r\n this.events.dispatch('components:set-properties', { node: this });\r\n return () => {\r\n if (removable) {\r\n const indexToRemove = this.changesets.indexOf(changeset);\r\n if (indexToRemove > -1) {\r\n this.changesets.splice(indexToRemove, 1);\r\n this.events.dispatch('components:set-properties', { node: this });\r\n }\r\n }\r\n };\r\n }\r\n\r\n writeProperties(\r\n properties:\r\n | Partial<ComponentNodeProperties>\r\n | ResolveComponentNodeProperties,\r\n options: ChangesetOptions = {},\r\n removable?: boolean\r\n ): RemoveChangeset {\r\n const attributes: Partial<ComponentNodeSettings> = { properties };\r\n const changeset: Changeset = [attributes, options];\r\n this.changesets.push(changeset);\r\n this.events.dispatch('components:set-properties', { node: this });\r\n return () => {\r\n if (removable) {\r\n const indexToRemove = this.changesets.indexOf(changeset);\r\n if (indexToRemove > -1) {\r\n this.changesets.splice(indexToRemove, 1);\r\n this.events.dispatch('components:set-properties', { node: this });\r\n }\r\n }\r\n };\r\n }\r\n\r\n writeLayout(\r\n layout: Partial<ComponentNodeLayout> | ResolveComponentNodeLayout,\r\n options: ChangesetOptions = {},\r\n removable?: boolean\r\n ): RemoveChangeset {\r\n const attributes: Partial<ComponentNodeSettings> = { layout };\r\n const changeset: Changeset = [attributes, options];\r\n this.changesets.push(changeset);\r\n this.events.dispatch('components:set-layout', { node: this });\r\n return () => {\r\n if (!removable) {\r\n return;\r\n }\r\n const indexToRemove = this.changesets.indexOf(changeset);\r\n if (indexToRemove > -1) {\r\n this.changesets.splice(indexToRemove, 1);\r\n this.events.dispatch('components:set-layout', { node: this });\r\n }\r\n };\r\n }\r\n\r\n writeContext(\r\n context: Partial<ComponentNodeContext> | ResolveComponentNodeContext,\r\n options: ChangesetOptions = {},\r\n removable?: boolean\r\n ): RemoveChangeset {\r\n const attributes: Partial<ComponentNodeSettings> = { context };\r\n const changeset: Changeset = [attributes, options];\r\n this.changesets.push(changeset);\r\n this.events.dispatch('components:set-context', { node: this });\r\n return () => {\r\n if (!removable) {\r\n return;\r\n }\r\n const indexToRemove = this.changesets.indexOf(changeset);\r\n if (indexToRemove > -1) {\r\n this.changesets.splice(indexToRemove, 1);\r\n this.events.dispatch('components:set-context', { node: this });\r\n }\r\n };\r\n }\r\n\r\n getChildren(branch: string = 'default'): ComponentNode[] {\r\n const children = this.children[branch] || [];\r\n return children.reduce((acc, node, i) => {\r\n const { order: index = i } = node.attributes.layout;\r\n if (!acc[index]) {\r\n acc[index] = node;\r\n } else {\r\n acc.splice(index, 0, node);\r\n }\r\n return acc;\r\n }, Array(children.length));\r\n }\r\n\r\n remove() {\r\n if (this.parent) {\r\n this.parent.removeChild(this);\r\n }\r\n }\r\n\r\n removeChild(node: ComponentNode) {\r\n Object.keys(this.children).forEach((branch) => {\r\n const children = this.children[branch];\r\n const indexToRemove = children.indexOf(node);\r\n if (indexToRemove > -1) {\r\n children.splice(indexToRemove, 1);\r\n this.events.dispatch('components:node-removed', {\r\n node,\r\n parentNode: this,\r\n });\r\n }\r\n });\r\n delete node.parent;\r\n }\r\n}\r\n","import { ComponentNode } from './component-node';\r\nimport { SwitchMap } from './component-platform';\r\n\r\nconst traverseComponentsRecursive = (\r\n nodes: ComponentNode[],\r\n switches: SwitchMap,\r\n fn: (node: ComponentNode) => boolean | void\r\n) => {\r\n for (let i = 0, y = nodes.length; i < y; i++) {\r\n if (fn(nodes[i]) === true) {\r\n break;\r\n }\r\n const branch = switches[nodes[i].id] || 'default';\r\n const children = nodes[i].getChildren(branch);\r\n traverseComponentsRecursive(children, switches, fn);\r\n }\r\n};\r\n\r\nexport const traverseComponents = (\r\n root: ComponentNode,\r\n switches: SwitchMap,\r\n fn: (node: ComponentNode) => boolean | void\r\n) => {\r\n if (fn(root) !== true) {\r\n const branch = switches[root.id] || 'default';\r\n const children = root.children[branch];\r\n traverseComponentsRecursive(children, switches, fn);\r\n }\r\n};\r\n\r\nexport const findVisibleComponents = (\r\n root: ComponentNode,\r\n switches: SwitchMap\r\n): ComponentNode[] => {\r\n const nodes: ComponentNode[] = [];\r\n traverseComponents(root, switches, (node) => {\r\n nodes.push(node);\r\n });\r\n return nodes;\r\n};\r\n\r\nexport const findComponent = (\r\n root: ComponentNode,\r\n switches: SwitchMap,\r\n fn: (node: ComponentNode) => boolean\r\n) => {\r\n let matched: ComponentNode | undefined;\r\n traverseComponents(root, switches, (node) => {\r\n if (fn(node)) {\r\n matched = node;\r\n return true;\r\n }\r\n });\r\n return matched;\r\n};\r\n\r\nexport const getAncestors = (node: ComponentNode) => {\r\n if (!node.parent) {\r\n return [];\r\n }\r\n const tree: ComponentNode[] = [];\r\n let currentNode: ComponentNode | undefined = node.parent;\r\n while (currentNode) {\r\n tree.unshift(currentNode);\r\n currentNode = currentNode.parent;\r\n }\r\n return tree;\r\n};\r\n","import { EventManager } from '@webprovisions/platform';\r\nimport { ComponentNode, ComponentNodeEventData } from './component-node';\r\nimport { SwitchMap } from './component-platform';\r\nimport {\r\n findComponent,\r\n findVisibleComponents,\r\n traverseComponents,\r\n} from './queries';\r\n\r\nexport type QueryDescriptor = {\r\n id?: string;\r\n type?: string;\r\n name?: string;\r\n};\r\n\r\nexport class ComponentNodeCollection {\r\n all: ComponentNode[] = [];\r\n visible: ComponentNode[] = [];\r\n detached: ComponentNode[] = [];\r\n\r\n constructor(\r\n public root: ComponentNode,\r\n private switches: SwitchMap,\r\n events: EventManager\r\n ) {\r\n events.subscribe(\r\n 'components:node-appended',\r\n (_event, data: ComponentNodeEventData) => {\r\n this.all.push(data.node);\r\n this.visible = findVisibleComponents(root, switches);\r\n }\r\n );\r\n events.subscribe(\r\n 'components:node-removed',\r\n (_event, data: ComponentNodeEventData) => {\r\n let indexToRemove = this.all.indexOf(data.node);\r\n if (indexToRemove > -1) {\r\n this.all.splice(indexToRemove, 1);\r\n }\r\n indexToRemove = this.visible.indexOf(data.node);\r\n if (indexToRemove > -1) {\r\n this.visible.splice(indexToRemove, 1);\r\n }\r\n this.visible = findVisibleComponents(root, switches);\r\n }\r\n );\r\n events.subscribe(\r\n 'components:node-switched',\r\n (_event, _data: ComponentNodeEventData) => {\r\n this.visible = findVisibleComponents(root, switches);\r\n }\r\n );\r\n }\r\n\r\n query(query: QueryDescriptor = {}): ComponentNode[] {\r\n const nodes: ComponentNode[] = [];\r\n traverseComponents(this.root, this.switches, (node) => {\r\n const match = Object.keys(query).every((member) => {\r\n return (<any>query)[member] === (<any>node)[member];\r\n });\r\n if (match) {\r\n nodes.push(node);\r\n }\r\n });\r\n return nodes;\r\n }\r\n\r\n get(id: string) {\r\n return (\r\n findComponent(this.root, this.switches, (node) => node.id === id) ||\r\n this.detached.find((node) => node.id === id)\r\n );\r\n }\r\n}\r\n","import { ComponentReference, ComponentSettings, ViewDefinition } from '../types';\r\nimport { ComponentNode } from './component-node';\r\nimport { ComponentPlatform } from './component-platform';\r\nimport { NormalizedComponentReference } from './create-component-model';\r\n\r\nexport type CustomHandlerCallback = (\r\n ref: NormalizedComponentReference,\r\n options: {\r\n platform: ComponentPlatform;\r\n node: ComponentNode;\r\n references: ComponentReference[];\r\n definitions: { [name: string]: ComponentSettings };\r\n views: { [key: string]: ViewDefinition };\r\n branch?: string;\r\n }\r\n) => void;\r\n\r\nexport class CustomComponentHandler {\r\n private handlers = new Map<string, CustomHandlerCallback>();\r\n\r\n add(name: string, fn: CustomHandlerCallback) {\r\n this.handlers.set(name, fn);\r\n }\r\n\r\n get(name: string) {\r\n return this.handlers.get(name);\r\n }\r\n}\r\n","import { ComponentPlatform } from '.';\r\nimport { Breakpoints } from '../types';\r\nimport {\r\n ComponentNode,\r\n ResolveComponentNodeContext,\r\n ResolveComponentNodeLayout,\r\n ResolveComponentNodeProperties,\r\n} from './component-node';\r\n\r\nexport type ProcessOptions = {\r\n context?: boolean;\r\n properties?: boolean;\r\n layout?: boolean;\r\n recursive?: boolean;\r\n};\r\n\r\nexport type StateProcessor = (node: ComponentNode, options: ProcessOptions) => void;\r\n\r\nconst calculateNodeIndex = (node: ComponentNode): number => {\r\n let currentNode = node;\r\n let index = 0;\r\n\r\n while (currentNode.parent) {\r\n index = index + 1;\r\n currentNode = currentNode.parent;\r\n }\r\n\r\n return index;\r\n};\r\n\r\nconst sortQueue = (queue: [ComponentNode, ProcessOptions][]): [ComponentNode, ProcessOptions][] => {\r\n const mapped: [number, ComponentNode, ProcessOptions][] = queue.map(([node, options]) => {\r\n return [calculateNodeIndex(node), node, options];\r\n });\r\n return mapped\r\n .sort(([a], [b]) => a - b)\r\n .map(([, node, options]) => {\r\n return [node, options];\r\n });\r\n};\r\n\r\nconst isObject = (item: any) => {\r\n if (item instanceof Date) {\r\n return false;\r\n }\r\n return item && typeof item === 'object' && !Array.isArray(item);\r\n};\r\n\r\nconst mergeDeep = (target: any, ...sources: any[]): any => {\r\n if (!sources.length) return target;\r\n const source = sources.shift();\r\n\r\n if (isObject(target) && isObject(source)) {\r\n for (const key in source) {\r\n if (isObject(source[key])) {\r\n if (!target[key]) Object.assign(target, { [key]: {} });\r\n mergeDeep(target[key], source[key]);\r\n } else {\r\n Object.assign(target, { [key]: source[key] });\r\n }\r\n }\r\n }\r\n return mergeDeep(target, ...sources);\r\n};\r\n\r\nconst matchesBreakpoint = (b1: Breakpoints | undefined, b2: string[]) => {\r\n if (!b1 || b1 === 'all') {\r\n return true;\r\n }\r\n return b1.some((b1) => b2.indexOf(b1) > -1);\r\n};\r\n\r\nexport type ProcessResult = Map<ComponentNode, ProcessOptions>;\r\n\r\nexport type ProcessReportCallback = (report: ProcessResult) => void;\r\n\r\nexport const createStateProcessor = (\r\n platform: ComponentPlatform,\r\n callback: ProcessReportCallback\r\n): StateProcessor => {\r\n let nodeQueue: ComponentNode[] = [];\r\n let optionsQueue: ProcessOptions[] = [];\r\n\r\n let timeout: NodeJS.Timeout;\r\n\r\n const flush = () => {\r\n if (process.env.NODE_ENV !== 'production') {\r\n console.time('state-processor.flush');\r\n }\r\n const processHistory: Map<ComponentNode, ProcessOptions> = new Map();\r\n const sortedQueue = sortQueue(nodeQueue.map((node, i) => [node, optionsQueue[i]]));\r\n\r\n const processNode = (node: ComponentNode, options: ProcessOptions) => {\r\n const history = processHistory.get(node) || {};\r\n\r\n // todo: this doesnt take overrides into account\r\n const processContext = options.context && !history.context;\r\n const processProperties = options.properties && !history.properties;\r\n const processLayout = options.layout && !history.layout;\r\n\r\n processHistory.set(node, {\r\n context: history.context || processContext,\r\n properties: history.properties || processProperties,\r\n layout: history.layout || processLayout,\r\n });\r\n\r\n if (processProperties) {\r\n node.attributes.properties = {};\r\n }\r\n if (processLayout) {\r\n node.attributes.layout = {};\r\n }\r\n\r\n if (processContext) {\r\n node.attributes.context = mergeDeep({}, node.parent?.attributes.context);\r\n }\r\n\r\n const propertyResolvers: ResolveComponentNodeProperties[] = [];\r\n const layoutResolvers: ResolveComponentNodeLayout[] = [];\r\n const contextResolvers: ResolveComponentNodeContext[] = [];\r\n\r\n node.changesets.forEach((changeset) => {\r\n const [change, options] = changeset;\r\n if (matchesBreakpoint(options.breakpoints, platform.breakpoints)) {\r\n if (processProperties) {\r\n if (typeof change.properties === 'function') {\r\n propertyResolvers.push(\r\n <ResolveComponentNodeProperties>change.properties\r\n );\r\n } else {\r\n mergeDeep(node.attributes.properties, change.properties);\r\n }\r\n }\r\n\r\n if (processLayout) {\r\n if (typeof change.layout === 'function') {\r\n layoutResolvers.push(<ResolveComponentNodeLayout>change.layout);\r\n } else {\r\n mergeDeep(node.attributes.layout, change.layout);\r\n }\r\n }\r\n\r\n if (processContext) {\r\n if (typeof change.context === 'function') {\r\n contextResolvers.push(<ResolveComponentNodeContext>change.context);\r\n } else {\r\n mergeDeep(node.attributes.context, change.context);\r\n }\r\n }\r\n }\r\n });\r\n\r\n propertyResolvers.forEach((resolver) => {\r\n mergeDeep(node.attributes.properties, resolver(node.attributes.properties));\r\n });\r\n\r\n layoutResolvers.forEach((resolver) => {\r\n mergeDeep(node.attributes.layout, resolver(node.attributes.layout));\r\n });\r\n\r\n contextResolvers.forEach((resolver) => {\r\n mergeDeep(node.attributes.context, resolver(node.attributes.context));\r\n });\r\n\r\n if (processContext || options.recursive) {\r\n const branch = platform.getBranch(node);\r\n const childOptions: ProcessOptions = options.recursive\r\n ? options\r\n : {\r\n context: !!processContext,\r\n };\r\n node.getChildren(branch).forEach((child) => {\r\n processNode(child, childOptions);\r\n });\r\n }\r\n };\r\n\r\n if (process.env.NODE_ENV !== 'production') {\r\n console.timeEnd('state-processor.flush');\r\n }\r\n\r\n sortedQueue.forEach(([node, options]) => {\r\n processNode(node, options);\r\n });\r\n\r\n nodeQueue = [];\r\n optionsQueue = [];\r\n\r\n callback(processHistory);\r\n };\r\n\r\n const schedule = () => {\r\n clearTimeout(timeout);\r\n timeout = setTimeout(flush, 0);\r\n };\r\n\r\n return (node, options) => {\r\n const index = nodeQueue.indexOf(node);\r\n\r\n if (index > -1) {\r\n // if node already exist in queue, update its options\r\n const summary = optionsQueue[index];\r\n if (options.context) {\r\n summary.context = true;\r\n }\r\n if (options.properties) {\r\n summary.properties = true;\r\n }\r\n if (options.layout) {\r\n summary.layout = true;\r\n }\r\n if (options.recursive) {\r\n summary.recursive = true;\r\n }\r\n return schedule();\r\n }\r\n\r\n nodeQueue.push(node);\r\n optionsQueue.push(options);\r\n\r\n return schedule();\r\n };\r\n};\r\n","import { uuid } from '@telia-ace/widget-utilities';\r\nimport {\r\n Container,\r\n EventManager,\r\n EventSubscriptionCancellation,\r\n Widget,\r\n} from '@webprovisions/platform';\r\nimport { ActionsController, ActionsState } from './actions-controller';\r\nimport { ChangesetProvider } from './changeset-provider';\r\nimport {\r\n Changeset,\r\n ChangesetOptions,\r\n ComponentNode,\r\n ComponentNodeEventData,\r\n ComponentNodeSettings,\r\n RemoveChangeset,\r\n} from './component-node';\r\nimport { ComponentNodeCollection } from './component-node-collection';\r\nimport { ComponentQuery } from './component-query';\r\nimport {\r\n CustomComponentHandler,\r\n CustomHandlerCallback,\r\n} from './custom-component-handler';\r\nimport { createStateProcessor, StateProcessor } from './state-processor';\r\n\r\nexport type MergeOptions = { breakpoints?: string[] };\r\n\r\ntype AbstractChangesetRecord = {\r\n changeset: Changeset;\r\n target: ComponentQuery;\r\n removes: RemoveChangeset[];\r\n};\r\n\r\nexport type SwitchMap = { [id: string]: string };\r\n\r\nexport type ChangesetData = {\r\n key?: string;\r\n target: ComponentQuery;\r\n attributes: Partial<ComponentNodeSettings>;\r\n options?: ChangesetOptions;\r\n removable?: boolean;\r\n provider?: string;\r\n};\r\n\r\nexport class ComponentPlatform {\r\n events: EventManager;\r\n breakpoints: string[] = [];\r\n nodes: ComponentNodeCollection;\r\n // internal\r\n actionsState: ActionsState = { handlers: [], watchers: [] };\r\n\r\n private switches: SwitchMap = {};\r\n private changesets: AbstractChangesetRecord[] = [];\r\n private subscriptions: EventSubscriptionCancellation[] = [];\r\n private processNode: StateProcessor;\r\n private customComponentHandler = new CustomComponentHandler();\r\n\r\n constructor(\r\n widget: Widget,\r\n private providers: { [key: string]: ChangesetProvider } = {}\r\n ) {\r\n this.events = widget.events.createChild(this);\r\n const root = new ComponentNode(this.events, 'root');\r\n root.name = `root-${widget.name}`;\r\n this.nodes = new ComponentNodeCollection(root, this.switches, this.events);\r\n\r\n const processNode = (this.processNode = createStateProcessor(\r\n this,\r\n (report) => {\r\n const nodes = Array.from(report.keys());\r\n if (process.env.NODE_ENV !== 'production') {\r\n console.info(`STATE PROCESSOR: ${nodes.length} node(s) processed:\r\n${nodes.map(\r\n (node) => `${node.name || '<no name>'} (${node.id})\r\n`\r\n)}`);\r\n }\r\n nodes.forEach((node) => {\r\n const options = report.get(node);\r\n if (node.parent && node.parent.type === 'root') {\r\n this.events.dispatch('components:root-children-changed', { node });\r\n }\r\n if (options?.context) {\r\n this.events.dispatch('components:context-changed', { node });\r\n }\r\n if (options?.properties) {\r\n this.events.dispatch('components:properties-changed', { node });\r\n }\r\n if (options?.layout) {\r\n this.events.dispatch('components:layout-changed', { node });\r\n }\r\n });\r\n this.events.dispatch(\r\n 'components:component-model-initialized',\r\n {},\r\n { bubbles: true }\r\n );\r\n }\r\n ));\r\n\r\n Promise.all(\r\n Object.keys(providers).map((key) => {\r\n const provider = providers[key];\r\n return provider.load(this);\r\n })\r\n );\r\n\r\n this.subscriptions.push(\r\n this.events.subscribe(\r\n 'components:node-appended',\r\n (_event, data: ComponentNodeEventData) => {\r\n const { node } = data;\r\n this.changesets.forEach((record) => {\r\n const { changeset, target, removes } = record;\r\n const [change, options] = changeset;\r\n if (target.match(data.node)) {\r\n if (change.properties) {\r\n removes.push(node.writeProperties(change.properties, options));\r\n }\r\n if (change.context) {\r\n removes.push(node.writeContext(change.context, options));\r\n }\r\n if (change.layout) {\r\n removes.push(node.writeLayout(change.layout, options));\r\n }\r\n }\r\n });\r\n }\r\n )\r\n );\r\n this.subscriptions.push(\r\n this.events.subscribe(\r\n 'components:node-appended',\r\n (_event, data: ComponentNodeEventData) => {\r\n processNode(data.node, { properties: true, context: true });\r\n }\r\n )\r\n );\r\n this.subscriptions.push(\r\n this.events.subscribe(\r\n 'components:set-properties',\r\n (_event, data: ComponentNodeEventData) => {\r\n processNode(data.node, { properties: true });\r\n }\r\n )\r\n );\r\n this.subscriptions.push(\r\n this.events.subscribe(\r\n 'components:set-context',\r\n (_event, data: ComponentNodeEventData) => {\r\n processNode(data.node, { properties: true, context: true });\r\n }\r\n )\r\n );\r\n this.subscriptions.push(\r\n this.events.subscribe(\r\n 'components:set-indent',\r\n (_event, data: ComponentNodeEventData) => {\r\n processNode(data.node, { layout: true });\r\n }\r\n )\r\n );\r\n this.subscriptions.push(\r\n this.events.subscribe(\r\n 'components:set-layout',\r\n (_event, data: ComponentNodeEventData) => {\r\n processNode(data.node, { layout: true });\r\n }\r\n )\r\n );\r\n this.subscriptions.push(\r\n this.events.subscribe(\r\n 'components:node-switched',\r\n (_event, { node, branch: _branch }) => {\r\n processNode(node, {\r\n layout: true,\r\n recursive: true,\r\n properties: true,\r\n context: true,\r\n });\r\n }\r\n )\r\n );\r\n this.subscriptions.push(\r\n this.events.subscribe(\r\n 'components:node-removed',\r\n (_event, { parentNode }) => {\r\n processNode(parentNode, { properties: true });\r\n }\r\n )\r\n );\r\n\r\n if (this.events.parent) {\r\n this.events.parent.dispatch('components:platform-created', {\r\n platform: this,\r\n });\r\n }\r\n }\r\n\r\n static getInstance(container: Container): Promise<ComponentPlatform> {\r\n return container.getAsync('components');\r\n }\r\n\r\n addBreakpoint(name: string) {\r\n if (this.breakpoints.indexOf(name) === -1) {\r\n this.breakpoints.push(name);\r\n this.processNode(this.nodes.root, {\r\n context: true,\r\n properties: true,\r\n layout: true,\r\n recursive: true,\r\n });\r\n }\r\n }\r\n\r\n removeBreakpoint(name: string) {\r\n const indexToRemove = this.breakpoints.indexOf(name);\r\n if (indexToRemove > -1) {\r\n this.breakpoints.splice(indexToRemove, 1);\r\n this.processNode(this.nodes.root, {\r\n context: true,\r\n properties: true,\r\n layout: true,\r\n recursive: true,\r\n });\r\n }\r\n }\r\n\r\n setSwitch(node: ComponentNode, branch: string) {\r\n this.switches[node.id] = branch;\r\n this.events.dispatch('components:node-switched', { node, branch });\r\n }\r\n\r\n getBranch(node: ComponentNode): string | undefined {\r\n return this.switches[node.id];\r\n }\r\n\r\n /**\r\n * Creates a `ComponentNode` of the specified type.\r\n * @param type Type of node.\r\n */\r\n createNode(\r\n type: string,\r\n options: { detached?: boolean } = {}\r\n ): ComponentNode {\r\n const node = new ComponentNode(this.events, type);\r\n if (options.detached) {\r\n this.nodes.detached.push(node);\r\n }\r\n return node;\r\n }\r\n\r\n components(): ComponentQuery {\r\n return new ComponentQuery(this);\r\n }\r\n\r\n actions(target: ComponentQuery, ns: string): ActionsController {\r\n return new ActionsController(this, <any>target, ns);\r\n }\r\n\r\n write(data: ChangesetData): RemoveChangeset {\r\n const {\r\n provider: providerName,\r\n target,\r\n attributes,\r\n options = {},\r\n removable,\r\n } = data;\r\n const key = data.key || uuid();\r\n const changeset: Changeset = [attributes, options];\r\n const record: AbstractChangesetRecord = { changeset, target, removes: [] };\r\n if (providerName) {\r\n const provider = this.providers[providerName];\r\n provider.write(key, target, attributes, options);\r\n record.removes.push(() => {\r\n provider.remove(key);\r\n });\r\n }\r\n\r\n this.changesets.push(record);\r\n this.nodes.all.forEach((node) => {\r\n if (target.match(node)) {\r\n let remove: RemoveChangeset = () => {};\r\n if (attributes.properties) {\r\n remove = node.writeProperties(\r\n attributes.properties,\r\n options,\r\n removable\r\n );\r\n }\r\n if (attributes.context) {\r\n remove = node.writeContext(attributes.context, options, removable);\r\n }\r\n if (attributes.layout) {\r\n remove = node.writeContext(attributes.layout, options, removable);\r\n }\r\n record.removes.push(remove);\r\n }\r\n });\r\n return () => {\r\n if (removable) {\r\n record.removes.forEach((remove) => remove());\r\n const indexToRemove = this.changesets.indexOf(record);\r\n if (indexToRemove > -1) {\r\n this.changesets.splice(indexToRemove, 1);\r\n }\r\n }\r\n };\r\n }\r\n\r\n addComponentHandler(definitionType: string, fn: CustomHandlerCallback) {\r\n this.customComponentHandler.add(definitionType, fn);\r\n }\r\n\r\n getComponentHandler(definitionType: string) {\r\n return this.customComponentHandler.get(definitionType);\r\n }\r\n\r\n dispose() {\r\n this.subscriptions.forEach((sub) => sub());\r\n }\r\n}\r\n","import { Logger } from '@telia-ace/widget-utilities';\r\nimport { EventSubscriptionCancellation } from '@webprovisions/platform';\r\nimport { Breakpoints, ComponentSettings, ViewDefinition, WidgetSettings } from '../types';\r\nimport {\r\n ComponentNode,\r\n ComponentNodeContext,\r\n ComponentNodeLayout,\r\n ComponentNodeProperties,\r\n} from './component-node';\r\nimport { ComponentPlatform } from './component-platform';\r\n\r\ntype ComponentReference = string | [string, ...ComponentReferenceOverride[]];\r\n\r\ntype ComponentReferenceOverride = {\r\n breakpoints?: Breakpoints;\r\n tags?: string[];\r\n context?: ComponentNodeContext;\r\n properties?: ComponentNodeProperties;\r\n layout?: ComponentNodeLayout;\r\n};\r\n\r\nexport type NormalizedComponentReference = {\r\n definitionId: string;\r\n overrides: ComponentReferenceOverride[];\r\n};\r\n\r\nexport const normalizeReference = (reference: ComponentReference): NormalizedComponentReference => {\r\n if (Array.isArray(reference)) {\r\n const [definitionId, ...overrides] = reference;\r\n return {\r\n definitionId,\r\n overrides,\r\n };\r\n }\r\n return {\r\n definitionId: reference,\r\n overrides: [],\r\n };\r\n};\r\n\r\nexport type ComponentHandlerOptions = {\r\n platform: ComponentPlatform;\r\n node: ComponentNode;\r\n references: ComponentReference[];\r\n definitions: { [name: string]: ComponentSettings };\r\n views: { [key: string]: ViewDefinition };\r\n branch?: string;\r\n};\r\n\r\nexport const createChildren = (\r\n platform: ComponentPlatform,\r\n node: ComponentNode,\r\n references: ComponentReference[],\r\n definitions: { [name: string]: ComponentSettings },\r\n views: { [key: string]: ViewDefinition },\r\n branch?: string\r\n) => {\r\n references.forEach((ref) => {\r\n const childRef = normalizeReference(ref);\r\n const childDef = definitions[childRef.definitionId];\r\n if (childRef.definitionId === 'view') {\r\n const viewNode = platform.createNode('view');\r\n viewNode.name = 'view';\r\n Object.keys(views).forEach((key) => {\r\n const viewDef = views[key];\r\n createChildren(platform, viewNode, [viewDef.entry], definitions, views, key);\r\n });\r\n node.appendChild(viewNode);\r\n\r\n childRef.overrides.forEach((override) => {\r\n if (override.properties) {\r\n viewNode.writeProperties(override.properties, {\r\n breakpoints: override.breakpoints,\r\n });\r\n }\r\n if (override.context) {\r\n viewNode.writeContext(override.context, { breakpoints: override.breakpoints });\r\n }\r\n if (override.layout) {\r\n viewNode.writeLayout(override.layout, { breakpoints: override.breakpoints });\r\n }\r\n });\r\n } else if (platform.getComponentHandler(childDef.type)) {\r\n const handle = platform.getComponentHandler(childDef.type);\r\n if (handle) {\r\n handle(childRef, {\r\n platform,\r\n node,\r\n references,\r\n definitions,\r\n views,\r\n branch,\r\n });\r\n }\r\n } else {\r\n const childDef = definitions[childRef.definitionId];\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (!childDef) {\r\n Logger.error(\r\n `No definition found for component type '${childRef.definitionId}'.`\r\n );\r\n return;\r\n }\r\n }\r\n const childNode = platform.createNode(childDef.type);\r\n childNode.name = childRef.definitionId;\r\n childNode.tags = childDef.tags || [];\r\n if (childDef.properties) {\r\n childNode.writeProperties(childDef.properties);\r\n }\r\n if (childDef.context) {\r\n childNode.writeContext(childDef.context);\r\n }\r\n if (childDef.layout) {\r\n childNode.writeLayout(childDef.layout);\r\n }\r\n node.appendChild(childNode, branch);\r\n\r\n childRef.overrides.forEach((override) => {\r\n const options = { breakpoints: override.breakpoints };\r\n if (override.properties) {\r\n childNode.writeProperties(override.properties, options);\r\n }\r\n if (override.context) {\r\n childNode.writeContext(override.context, options);\r\n }\r\n if (override.layout) {\r\n childNode.writeLayout(override.layout, options);\r\n }\r\n });\r\n\r\n if (childDef.children) {\r\n createChildren(platform, childNode, childDef.children, definitions, views);\r\n }\r\n }\r\n });\r\n};\r\n\r\nexport const createComponentModel = (\r\n platform: ComponentPlatform,\r\n settings: WidgetSettings\r\n): EventSubscriptionCancellation => {\r\n const { entry, components, breakpoints, views } = settings;\r\n const subscriptions: EventSubscriptionCancellation[] = [];\r\n\r\n Object.keys(breakpoints).forEach((name) => {\r\n const query = breakpoints[name];\r\n const list = window.matchMedia(query);\r\n if (list.matches) {\r\n platform.breakpoints.push(name);\r\n }\r\n const listener = (event: MediaQueryListEvent) => {\r\n if (event.matches) {\r\n platform.addBreakpoint(name);\r\n } else {\r\n platform.removeBreakpoint(name);\r\n }\r\n };\r\n list.addListener(listener);\r\n subscriptions.push(() => list.removeListener(listener));\r\n });\r\n\r\n createChildren(platform, platform.nodes.root, [entry], components, views);\r\n\r\n return () =>\r\n subscriptions.forEach((sub) => {\r\n sub();\r\n });\r\n};\r\n","import { ComponentNode } from './component-node';\r\n\r\nexport type ComponentDescriptor = {\r\n id: string;\r\n type?: string;\r\n name?: string;\r\n branch: string;\r\n};\r\n\r\nexport const asDescriptor = (node: ComponentNode, branch?: string): ComponentDescriptor => {\r\n return {\r\n id: node.id,\r\n type: node.type,\r\n name: node.name,\r\n branch: branch || 'default',\r\n };\r\n};\r\n","import { uuid } from '@telia-ace/widget-utilities';\r\nimport {\r\n Container,\r\n EventSubscriptionCancellation,\r\n} from '@webprovisions/platform';\r\nimport { ComponentNodeController } from './component-controller';\r\nimport { ComponentNode } from './component-node';\r\nimport { ComponentPlatform } from './component-platform';\r\nimport { ComponentQuery } from './component-query';\r\n\r\nexport type ExtendComponentHandler = (\r\n controller: ComponentNodeController\r\n) => any;\r\n\r\nexport type ExtendComponentOptions = {\r\n reuseController?: boolean;\r\n};\r\n\r\nexport const extendComponent = (\r\n container: Container,\r\n typeOrQuery: string | ComponentQuery,\r\n handler: ExtendComponentHandler,\r\n ns: string = uuid(),\r\n options: ExtendComponentOptions = {}\r\n): Promise<void> => {\r\n return container\r\n .getAsync('components')\r\n .then((components: ComponentPlatform) => {\r\n let target: ComponentQuery;\r\n if (typeof typeOrQuery === 'string') {\r\n const collection = new ComponentQuery(components);\r\n collection.ofType(typeOrQuery);\r\n target = collection;\r\n } else {\r\n target = typeOrQuery;\r\n }\r\n\r\n const managedInstances: {\r\n [instanceId: string]: {\r\n dispose: EventSubscriptionCancellation;\r\n controller: ComponentNodeController;\r\n };\r\n } = {};\r\n\r\n const getOrCreateController = (\r\n node: ComponentNode\r\n ): Promise<ComponentNodeController> => {\r\n const existing = managedInstances[node.id];\r\n if (existing) {\r\n return Promise.resolve(existing.controller);\r\n }\r\n return ComponentPlatform.getInstance(container).then((platform) => {\r\n return new ComponentNodeController(platform, node, ns);\r\n });\r\n };\r\n\r\n components.events.subscribe(\r\n 'components:node-enter',\r\n (_event, { node }: { node: ComponentNode }) => {\r\n if (target.match(node)) {\r\n getOrCreateController(node).then((controller) => {\r\n Promise.resolve(handler(controller)).then((dispose) => {\r\n managedInstances[node.id] = {\r\n dispose,\r\n controller,\r\n };\r\n });\r\n });\r\n }\r\n }\r\n );\r\n components.events.subscribe(\r\n 'components:node-exit',\r\n (_event, { node }: { node: ComponentNode }) => {\r\n const instance = managedInstances[node.id];\r\n if (instance) {\r\n instance.dispose && instance.dispose();\r\n if (!options.reuseController) {\r\n instance.controller.dispose();\r\n delete managedInstances[node.id];\r\n }\r\n }\r\n }\r\n );\r\n });\r\n};\r\n","import { Logger } from '@telia-ace/widget-utilities';\r\nimport {\r\n Container,\r\n EventManager,\r\n EventSubscriptionCancellation,\r\n WidgetType,\r\n} from '@webprovisions/platform';\r\n\r\nexport type ReactComponent = any | null; // TODO: Not using React\r\n\r\nexport default class ComponentResolver {\r\n aliases: Map<string, string> = new Map();\r\n components: Map<string, any> = new Map();\r\n events: EventManager;\r\n logger = new Logger();\r\n\r\n constructor(container: Container) {\r\n const { events }: WidgetType = container.get('$widget');\r\n this.events = events;\r\n }\r\n\r\n getComponent(key: string): ReactComponent {\r\n const alias = this.aliases.get(key);\r\n const component = this.components.get(alias || key) || null;\r\n\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (!component) {\r\n this.logger.warn(\r\n alias || key,\r\n `Unable to resolve component: \"${\r\n alias || key\r\n }\". You most likely forgot to register the required plugin for: ${\r\n alias || key\r\n }.`\r\n );\r\n }\r\n }\r\n\r\n return component;\r\n }\r\n\r\n registerComponent(\r\n key: string,\r\n component: ReactComponent\r\n ): EventSubscriptionCancellation {\r\n this.components.set(key, component);\r\n\r\n this.events.dispatch('component-resolver:resolve', key);\r\n\r\n return () => {\r\n this.components.delete(key);\r\n };\r\n }\r\n\r\n registerResolver(\r\n key: string,\r\n fn: (component: ReactComponent) => void\r\n ): EventSubscriptionCancellation {\r\n return this.events.subscribe(\r\n 'component-resolver:resolve',\r\n (_e, data: string) => {\r\n if (data === key) {\r\n const component = this.getComponent(key);\r\n fn(component);\r\n }\r\n }\r\n );\r\n }\r\n\r\n registerAlias(alias: string, key: string): EventSubscriptionCancellation {\r\n this.aliases.set(alias, key);\r\n\r\n this.events.dispatch('component-resolver:resolve', alias);\r\n\r\n return () => {\r\n this.aliases.delete(alias);\r\n };\r\n }\r\n}\r\n","export default '#____version____#';\r\n","import {\r\n BootstrappedImplementationConfiguration,\r\n ConfigurationApi as BootstrappingConfigurationApi,\r\n} from '@webprovisions/bootstrapping';\r\nimport {\r\n ConfigurationApiDefinition,\r\n Environment as EnvironmentBase,\r\n version as webprovisionsVersion,\r\n WidgetSelector,\r\n} from '@webprovisions/platform';\r\nimport Implementation from './implementation';\r\nimport version from './version';\r\n\r\nexport interface RuntimeConfiguration {\r\n /**\r\n * Extensions for the configuration API (optional).\r\n */\r\n configurationApiExtensions?: ConfigurationApiDefinition[];\r\n}\r\n\r\n/**\r\n * The widget runtime.\r\n */\r\nexport default class Environment extends EnvironmentBase {\r\n /**\r\n * Version of the widget runtime.\r\n */\r\n static override version: string = `${version} (${webprovisionsVersion})`;\r\n\r\n constructor(\r\n name: string,\r\n configurationApiExtensions: ConfigurationApiDefinition[] = []\r\n ) {\r\n super(name, configurationApiExtensions, {\r\n transformPluginSettings: (settings, name, container) => {\r\n const $settings = container.get('$settings');\r\n const configPluginSettings =\r\n $settings.plugins && name ? $settings.plugins[name] || {} : {};\r\n return {\r\n ...configPluginSettings,\r\n ...settings,\r\n };\r\n },\r\n });\r\n }\r\n\r\n override createImplementation(\r\n configuration: BootstrappedImplementationConfiguration\r\n ): Implementation {\r\n const implementation = <Implementation>(\r\n super.createImplementation(configuration)\r\n );\r\n implementation.bindings = configuration.bindings;\r\n return implementation;\r\n }\r\n\r\n /**\r\n * Performs navigation for widgets matching the specified selector by invoking a\r\n * 'navigate' command.\r\n * @param selector Widget selector matching the widget(s) to perform navigation on.\r\n * @param route Route name.\r\n * @param params Route params.\r\n */\r\n navigate(\r\n selector: WidgetSelector,\r\n route: string,\r\n params: { [key: string]: string }\r\n ) {\r\n this.widgets\r\n .query(selector)\r\n .forEach((widget) => widget.invoke('navigate', { route, params }));\r\n }\r\n\r\n /**\r\n * Creates a runtime based on provided configuration.\r\n * @param configuration Runtime configuration.\r\n */\r\n static override create(\r\n configuration: RuntimeConfiguration = {}\r\n ): Environment {\r\n const configurationApiExtensions = [BootstrappingConfigurationApi].concat(\r\n (configuration.configurationApiExtensions as any) || []\r\n );\r\n return new Environment('humany', configurationApiExtensions as any);\r\n }\r\n\r\n /**\r\n * Creates a widget runtime based on provided configuration and retains configuration handlers\r\n * registered on global context. Use this factory to fully support the default embed script.\r\n * Will return any existing widget runtime if available.\r\n * @param configuration Runtime configuration.\r\n * @param global Object to read configuration handlers from (default: window).\r\n */\r\n static createFromGlobal(\r\n globalInstance: any,\r\n configuration: RuntimeConfiguration = {}\r\n ): Environment {\r\n if (this.isRuntime(globalInstance)) {\r\n (globalInstance as Environment).patch(configuration);\r\n return globalInstance;\r\n }\r\n\r\n const runtimeConfiguration: any[] = [];\r\n\r\n const tempRuntimeConfiguration = globalInstance && globalInstance._c;\r\n if (tempRuntimeConfiguration) {\r\n tempRuntimeConfiguration.forEach((args: any) =>\r\n runtimeConfiguration.push(args)\r\n );\r\n }\r\n\r\n const runtime = this.create(configuration);\r\n runtime.container.register('$runtimecfg', runtimeConfiguration);\r\n return runtime;\r\n }\r\n\r\n /**\r\n * Determines whether the specified object is a valid widget runtime.\r\n * @param obj Object to compare.\r\n */\r\n static isRuntime(obj: any): boolean {\r\n if (\r\n obj &&\r\n typeof obj === 'object' &&\r\n obj.container &&\r\n typeof obj.container.get === 'function' &&\r\n obj.container.get('$environment') === obj &&\r\n obj.container.owner === obj\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n","import { Implementation as ImplementationBase } from '@webprovisions/platform';\r\n\r\n/**\r\n * Represents an implementation.\r\n */\r\nexport default class Implementation extends ImplementationBase {\r\n bindings: string[] = [];\r\n}\r\n","import { Container, Plugin as PluginBase } from '@webprovisions/platform';\r\n\r\n/**\r\n * Base class for a widget plugin.\r\n */\r\nexport default class Plugin extends PluginBase {\r\n constructor(container: Container, settings?: any) {\r\n super(container, settings);\r\n }\r\n}\r\n","import { ComponentNodeLayout } from '../component-platform';\r\n\r\nexport type ComponentSettings = {\r\n type: string;\r\n context?: Context;\r\n properties?: Properties;\r\n layout?: ComponentNodeLayout;\r\n tags?: string[];\r\n children?: ComponentReference[];\r\n};\r\n\r\nenum HistoryMode {\r\n scopedHash = 'scopedHash',\r\n hash = 'hash',\r\n browser = 'browser',\r\n memory = 'memory',\r\n}\r\n\r\nexport type RoutingSettings = {\r\n initialPath: string;\r\n mode: HistoryMode;\r\n basePath?: string;\r\n};\r\n\r\nexport type ComponentReference = string | [string, ...ComponentReferenceOverride[]];\r\n\r\nexport type Properties = { [key: string]: any };\r\n\r\nexport type Context = { [key: string]: any };\r\n\r\nexport type ViewDefinition = {\r\n path: string | string[];\r\n entry: ComponentReference;\r\n};\r\n\r\nexport type Breakpoints = 'all' | string[];\r\n\r\nexport type ComponentReferenceOverride = {\r\n breakpoints?: Breakpoints;\r\n size?: number | 'full' | 'none';\r\n indent?: number;\r\n tags?: string[];\r\n context?: Context;\r\n properties?: Properties;\r\n};\r\n\r\nexport type ComponentDefinitionMap = {\r\n [name: string]: ComponentSettings;\r\n};\r\n\r\nexport type WidgetSettings = {\r\n data: { projection: string; site?: 'current' | 'referrer'; forceHttps?: boolean };\r\n components: ComponentDefinitionMap;\r\n entry: ComponentReference;\r\n breakpoints: { [name: string]: string };\r\n routing: RoutingSettings;\r\n views: { [name: string]: ViewDefinition };\r\n integrationResources: { path: string; mediaQueriesSupported: boolean }[];\r\n trigger?: { symbol?: Symbol; label?: string; action?: string };\r\n activate?: boolean | null;\r\n plugins?: { [key: string]: any };\r\n};\r\n\r\nexport type MinMax = {\r\n min: string;\r\n max: string;\r\n};\r\n\r\ntype Symbol = {\r\n type: 'Uri' | 'Svg' | 'FontAwesome' | 'Text' | string;\r\n content: string;\r\n};\r\n\r\nexport enum WidgetRenderState {\r\n open = 'open',\r\n closed = 'closed',\r\n hidden = 'hidden',\r\n}\r\n","import { Container, WidgetType as WidgetTypeBase } from '@webprovisions/platform';\r\n\r\n/**\r\n * Base class for a widget.\r\n */\r\nexport default class WidgetType extends WidgetTypeBase {\r\n constructor(container: Container) {\r\n super(container);\r\n }\r\n}\r\n"],"names":["ActionResolver","container","events","target","action","value","origin","fn","_e","f","r","o","E","b","i","x","q","I","h","m","g","L","s","a","y","O$1","c","A","O","u","l","p","k","S","W","R","M","P","N$1","C","N","$","e","z","D","B","F","n","_","G","J","X","Z","w","K","nt","tt","st","Q","et","V","it","T","rt","v","ot","$t","at","j","ct","ht","lt","ut","dt","pt","vt","U","d","gt","mt","At","Y","yt","wt","C$1","bt","H","bootstrap","implementation","configure","options","bootstrapImplementation","runtimeConfigurationHandlers","cfgHandlerArgs","fnOrSelector","selectImplementations","handler","createEventSubscriber","subs","type","listener","sub","ComponentQuery","platform","rules","node","rule","id","AbstractComponentController","ComponentNodeController","ns","ActionsController","subscribe","unsubscribe","updated","properties","_event","context","layout","clearOnDispose","remove","executeActionListeners","listeners","data","controller","stack","dispatch","globalOptions","cancelled","next","result","__spreadProps","__spreadValues","key","subscription","index","instances","output","handlers","matchedInstances","instance","watchers","watcher","input","handlerResponse","parsedKey","parsedNs","sections","componentConfigurationApi","createConfigurationApi","builder","config","ComponentNode","uuid","viewOutletContainer","_element","mountedNodes","Logger","branch","removable","changeset","indexToRemove","children","acc","traverseComponentsRecursive","nodes","switches","traverseComponents","root","findVisibleComponents","findComponent","matched","ComponentNodeCollection","_data","query","member","CustomComponentHandler","name","calculateNodeIndex","currentNode","sortQueue","queue","isObject","item","mergeDeep","sources","source","matchesBreakpoint","b1","b2","createStateProcessor","callback","nodeQueue","optionsQueue","timeout","flush","processHistory","sortedQueue","processNode","_a","history","processContext","processProperties","processLayout","propertyResolvers","layoutResolvers","contextResolvers","change","resolver","childOptions","child","schedule","summary","ComponentPlatform","widget","providers","report","record","removes","_branch","parentNode","providerName","attributes","provider","definitionType","normalizeReference","reference","definitionId","overrides","createChildren","references","definitions","views","ref","childRef","childDef","viewNode","viewDef","override","handle","childNode","createComponentModel","settings","entry","components","breakpoints","subscriptions","list","event","asDescriptor","extendComponent","typeOrQuery","collection","managedInstances","getOrCreateController","existing","dispose","ComponentResolver","alias","component","version","_Environment","EnvironmentBase","configurationApiExtensions","$settings","configPluginSettings","configuration","selector","route","params","BootstrappingConfigurationApi","globalInstance","runtimeConfiguration","tempRuntimeConfiguration","args","runtime","obj","webprovisionsVersion","Environment","Implementation","ImplementationBase","Plugin","PluginBase","WidgetRenderState","WidgetType","WidgetTypeBase"],"mappings":";;;;;;;;;;;;AASA,MAAqBA,GAAe;AAAA,EAGlC,YAAYC,GAAsB;AAChC,UAAM,EAAE,QAAAC,EAAmB,IAAAD,EAAU,IAAI,SAAS;AAC7C,SAAA,SAASC,EAAO,YAAY,IAAI;AAAA,EACvC;AAAA,EAEA,OAAOC,GAAgBC,GAAgBC,GAAkB;AACvD,SAAK,OAAO;AAAA,MACV;AAAA,MACA,EAAE,QAAAD,GAAQ,OAAAC,GAAO,QAAAF,EAAO;AAAA,MACxB,EAAE,SAAS,GAAK;AAAA,IAAA;AAAA,EAEpB;AAAA,EAEA,UAAUG,GAAgBC,GAA2C;AACnE,WAAO,KAAK,OAAO;AAAA,MACjB;AAAA,MACA,CAACC,GAAI,EAAE,QAAAJ,GAAQ,OAAAC,GAAO,QAAAF,EACpB,MAAAG,MAAWH,KAAUI,EAAGD,GAAQF,GAAQC,CAAK;AAAA,IAAA;AAAA,EAEnD;AACF;AChCA,MAAMI,IAAI,CAAC,GAAG,GAAG,MAAMC,MAAM;AAC3B,QAAMC,IAAI,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C,GAAmB;AAAA,EAA/D,cAAA;AAAA,UAAA,GAAA,SAAA,GACI,KAAA,WAAqB;EAAC;AAC1B;ACFA,MAAqBC,WAAeC,GAAW;AAAA,EAC3C,YAAYzR,GAAsBiP,GAAgB;AAC9C,UAAMjP,GAAWiP,CAAQ;AAAA,EAC7B;AACJ;ACgEY,IAAAyC,uBAAAA,OACRA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,SAAS,UAHDA,IAAAA,MAAA,CAAA,CAAA;ACpEZ,MAAqBC,WAAmBC,GAAe;AAAA,EACnD,YAAY5R,GAAsB;AAC9B,UAAMA,CAAS;AAAA,EACnB;AACJ;","x_google_ignoreList":[1,2,9]}
|
package/dist/plugin.d.ts
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Container, Plugin as PluginBase } from '@webprovisions/platform';
|
2
|
+
/**
|
3
|
+
* Base class for a widget plugin.
|
4
|
+
*/
|
5
|
+
export default class Plugin extends PluginBase {
|
6
|
+
constructor(container: Container, settings?: any);
|
7
|
+
}
|
8
|
+
//# sourceMappingURL=plugin.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1E;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,UAAU;gBAC9B,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,GAAG;CAGnD"}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
import { ComponentNodeLayout } from '../component-platform';
|
2
|
+
export type ComponentSettings = {
|
3
|
+
type: string;
|
4
|
+
context?: Context;
|
5
|
+
properties?: Properties;
|
6
|
+
layout?: ComponentNodeLayout;
|
7
|
+
tags?: string[];
|
8
|
+
children?: ComponentReference[];
|
9
|
+
};
|
10
|
+
declare enum HistoryMode {
|
11
|
+
scopedHash = "scopedHash",
|
12
|
+
hash = "hash",
|
13
|
+
browser = "browser",
|
14
|
+
memory = "memory"
|
15
|
+
}
|
16
|
+
export type RoutingSettings = {
|
17
|
+
initialPath: string;
|
18
|
+
mode: HistoryMode;
|
19
|
+
basePath?: string;
|
20
|
+
};
|
21
|
+
export type ComponentReference = string | [string, ...ComponentReferenceOverride[]];
|
22
|
+
export type Properties = {
|
23
|
+
[key: string]: any;
|
24
|
+
};
|
25
|
+
export type Context = {
|
26
|
+
[key: string]: any;
|
27
|
+
};
|
28
|
+
export type ViewDefinition = {
|
29
|
+
path: string | string[];
|
30
|
+
entry: ComponentReference;
|
31
|
+
};
|
32
|
+
export type Breakpoints = 'all' | string[];
|
33
|
+
export type ComponentReferenceOverride = {
|
34
|
+
breakpoints?: Breakpoints;
|
35
|
+
size?: number | 'full' | 'none';
|
36
|
+
indent?: number;
|
37
|
+
tags?: string[];
|
38
|
+
context?: Context;
|
39
|
+
properties?: Properties;
|
40
|
+
};
|
41
|
+
export type ComponentDefinitionMap = {
|
42
|
+
[name: string]: ComponentSettings;
|
43
|
+
};
|
44
|
+
export type WidgetSettings = {
|
45
|
+
data: {
|
46
|
+
projection: string;
|
47
|
+
site?: 'current' | 'referrer';
|
48
|
+
forceHttps?: boolean;
|
49
|
+
};
|
50
|
+
components: ComponentDefinitionMap;
|
51
|
+
entry: ComponentReference;
|
52
|
+
breakpoints: {
|
53
|
+
[name: string]: string;
|
54
|
+
};
|
55
|
+
routing: RoutingSettings;
|
56
|
+
views: {
|
57
|
+
[name: string]: ViewDefinition;
|
58
|
+
};
|
59
|
+
integrationResources: {
|
60
|
+
path: string;
|
61
|
+
mediaQueriesSupported: boolean;
|
62
|
+
}[];
|
63
|
+
trigger?: {
|
64
|
+
symbol?: Symbol;
|
65
|
+
label?: string;
|
66
|
+
action?: string;
|
67
|
+
};
|
68
|
+
activate?: boolean | null;
|
69
|
+
plugins?: {
|
70
|
+
[key: string]: any;
|
71
|
+
};
|
72
|
+
};
|
73
|
+
export type MinMax = {
|
74
|
+
min: string;
|
75
|
+
max: string;
|
76
|
+
};
|
77
|
+
type Symbol = {
|
78
|
+
type: 'Uri' | 'Svg' | 'FontAwesome' | 'Text' | string;
|
79
|
+
content: string;
|
80
|
+
};
|
81
|
+
export declare enum WidgetRenderState {
|
82
|
+
open = "open",
|
83
|
+
closed = "closed",
|
84
|
+
hidden = "hidden"
|
85
|
+
}
|
86
|
+
export {};
|
87
|
+
//# sourceMappingURL=configuration.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/types/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACnC,CAAC;AAEF,aAAK,WAAW;IACZ,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,MAAM,WAAW;CACpB;AAED,MAAM,MAAM,eAAe,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,GAAG,0BAA0B,EAAE,CAAC,CAAC;AAEpF,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAEhD,MAAM,MAAM,OAAO,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GA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