@telia-ace/alliance-utilities 1.0.11-next.0 → 1.0.11-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../framework/dist/chunks/capabilities-a4bf3b71.js","../../framework/dist/index.js","../../../internal/client-utilities/dist/index.js","../src/current-user.ts"],"sourcesContent":["var ie = Object.defineProperty;\nvar ae = (e, o, t) => o in e ? ie(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;\nvar k = (e, o, t) => (ae(e, typeof o != \"symbol\" ? o + \"\" : o, t), t);\n/*! js-cookie v3.0.5 | MIT */\nfunction F(e) {\n for (var o = 1; o < arguments.length; o++) {\n var t = arguments[o];\n for (var r in t)\n e[r] = t[r];\n }\n return e;\n}\nvar se = {\n read: function(e) {\n return e[0] === '\"' && (e = e.slice(1, -1)), e.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent);\n },\n write: function(e) {\n return encodeURIComponent(e).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n );\n }\n};\nfunction R(e, o) {\n function t(i, s, u) {\n if (!(typeof document > \"u\")) {\n u = F({}, o, u), typeof u.expires == \"number\" && (u.expires = new Date(Date.now() + u.expires * 864e5)), u.expires && (u.expires = u.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);\n var p = \"\";\n for (var l in u)\n u[l] && (p += \"; \" + l, u[l] !== !0 && (p += \"=\" + u[l].split(\";\")[0]));\n return document.cookie = i + \"=\" + e.write(s, i) + p;\n }\n }\n function r(i) {\n if (!(typeof document > \"u\" || arguments.length && !i)) {\n for (var s = document.cookie ? document.cookie.split(\"; \") : [], u = {}, p = 0; p < s.length; p++) {\n var l = s[p].split(\"=\"), d = l.slice(1).join(\"=\");\n try {\n var n = decodeURIComponent(l[0]);\n if (u[n] = e.read(d, n), i === n)\n break;\n } catch {\n }\n }\n return i ? u[i] : u;\n }\n }\n return Object.create(\n {\n set: t,\n get: r,\n remove: function(i, s) {\n t(\n i,\n \"\",\n F({}, s, {\n expires: -1\n })\n );\n },\n withAttributes: function(i) {\n return R(this.converter, F({}, this.attributes, i));\n },\n withConverter: function(i) {\n return R(F({}, this.converter, i), this.attributes);\n }\n },\n {\n attributes: { value: Object.freeze(o) },\n converter: { value: Object.freeze(e) }\n }\n );\n}\nvar G = R(se, { path: \"/\" }), ce = Object.defineProperty, le = (e, o, t) => o in e ? ce(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, D = (e, o, t) => (le(e, typeof o != \"symbol\" ? o + \"\" : o, t), t), h = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = \"AlreadyInitialized\", e[e.NoAppNameOrKey = 1001] = \"NoAppNameOrKey\", e[e.MissingAppController = 1002] = \"MissingAppController\", e[e.MissingCapabilityOnApp = 1003] = \"MissingCapabilityOnApp\", e[e.MissingManagedObjectProvider = 1004] = \"MissingManagedObjectProvider\", e[e.NoManifest = 1005] = \"NoManifest\", e[e.NoRootElement = 1006] = \"NoRootElement\", e[e.NoView = 1007] = \"NoView\", e[e.CookieKeyNotDefined = 1008] = \"CookieKeyNotDefined\", e[e.CookieCategoryNotAllowed = 1009] = \"CookieCategoryNotAllowed\", e[e.StorageKeyNotDefined = 1010] = \"StorageKeyNotDefined\", e[e.StorageCategoryNotAllowed = 1011] = \"StorageCategoryNotAllowed\", e))(h || {});\nfunction ue(e, o) {\n return Object.entries(o).reduce((t, [r, i]) => t.replaceAll(`{{${r}}}`, i), e);\n}\nconst pe = {\n // framework\n [\n 1e3\n /* AlreadyInitialized */\n ]: \"The runtime has already been initialized\",\n [\n 1001\n /* NoAppNameOrKey */\n ]: \"App name and/or app key is not defined on global scope\",\n [\n 1002\n /* MissingAppController */\n ]: \"No app controller registered for app '{{app}}'\",\n [\n 1003\n /* MissingCapabilityOnApp */\n ]: \"No capability '{{capability}}' enabled for app '{{app}}'\",\n [\n 1004\n /* MissingManagedObjectProvider */\n ]: \"No managed object provider registered for object '{{object}}'\",\n [\n 1005\n /* NoManifest */\n ]: \"The current apps manifest is not defined on global scope\",\n [\n 1006\n /* NoRootElement */\n ]: \"Could not find the root element in the DOM\",\n [\n 1007\n /* NoView */\n ]: \"Could not find view with id '{{id}}' on view controller for app '{{app}}'\",\n [\n 1008\n /* CookieKeyNotDefined */\n ]: \"Cookie key '{{key}}' not present in manifest, cookie has not been set\",\n [\n 1009\n /* CookieCategoryNotAllowed */\n ]: \"Cookies categorized as '{{category}}' are not allowed by the user, cookie '{{key}}' has not been set\",\n [\n 1010\n /* StorageKeyNotDefined */\n ]: \"Storage key '{{key}}' not present in manifest, item has not been stored\",\n [\n 1011\n /* StorageCategoryNotAllowed */\n ]: \"Storage categorized as '{{category}}' is not allowed by the user, item '{{key}}' has not been stored\",\n // utilities\n [\n 2e3\n /* CurrentUserMissingProvider */\n ]: \"No managed object provider registered for object 'currentUser'\",\n [\n 2001\n /* CurrentUserGatewayNotStarted */\n ]: \"Could not access the gateway when querying 'currentUser'\",\n [\n 2002\n /* CurrentUserMissingBackend */\n ]: \"Could not access the required backend when querying 'currentUser'\",\n [\n 2003\n /* CurrentUserMissingInDatabase */\n ]: \"Could not locate the authenticated user in the Alliance database\"\n}, de = \"AllianceError\";\nclass w extends Error {\n constructor(o, t = {}) {\n const r = ue(pe[o], t), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${o}`;\n super(r), this.code = o, this.name = de, this.stack = `[${o}] - ${r}\n` + i;\n }\n}\nfunction fe(e) {\n const o = Object.entries(e).reduce((t, r) => {\n const [i, s] = r;\n return typeof s > \"u\" || (typeof s == \"object\" && s !== null ? t[i] = JSON.stringify(s) : t[i] = s), t;\n }, {});\n return Object.keys(o).length ? `?${new URLSearchParams(o)}` : \"\";\n}\nfunction he() {\n const e = W(), { href: o, search: t } = window.location;\n return o.replace(e, \"\").replace(t, \"\");\n}\nfunction ye(e = \"\", o = \"\", t = {}) {\n const r = W().replace(location.origin, \"\"), i = fe(t);\n return e ? o ? `${r}/${e}/${o}${i}` : `${r}/${e}${i}` : `${r}${i}`;\n}\nfunction Ke() {\n const e = he(), [o = \"\", t = \"\"] = e.split(\"/\").filter((r) => !!r);\n return {\n app: o,\n capability: t\n };\n}\nfunction Ve(e) {\n const { origin: o, pathname: t } = window.location;\n if (e === \"production\") {\n const [r] = t.split(\"/\").filter((i) => !!i);\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = `${o}/${r}`;\n }\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = o;\n}\nfunction W() {\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL;\n}\nvar Y = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = \"AlreadyExists\", e[e.ApiGatewayPortDescription = 1] = \"ApiGatewayPortDescription\", e[e.ApiServerModeDescription = 2] = \"ApiServerModeDescription\", e[e.AppConfigurationPath = 3] = \"AppConfigurationPath\", e[e.AppCreated = 4] = \"AppCreated\", e[e.AppEntryBuildOptionDescription = 5] = \"AppEntryBuildOptionDescription\", e[e.AppNameInquiry = 6] = \"AppNameInquiry\", e[e.BuildDescription = 7] = \"BuildDescription\", e[e.BuildModeOptionDescription = 8] = \"BuildModeOptionDescription\", e[e.BuildWatchDescription = 9] = \"BuildWatchDescription\", e[e.CreateAppDescription = 10] = \"CreateAppDescription\", e[e.CreateWorkspaceDescription = 11] = \"CreateWorkspaceDescription\", e[e.DevServerOpenDescription = 12] = \"DevServerOpenDescription\", e[e.DevServerPortDescription = 13] = \"DevServerPortDescription\", e[e.DevServerLoggingDescription = 14] = \"DevServerLoggingDescription\", e[e.Done = 15] = \"Done\", e[e.FetchPackageVersionError = 16] = \"FetchPackageVersionError\", e[e.ManifestEntryBuildOptionDescription = 17] = \"ManifestEntryBuildOptionDescription\", e[e.MissingTranslationKey = 18] = \"MissingTranslationKey\", e[e.NoAppName = 19] = \"NoAppName\", e[e.NoAppNameFound = 20] = \"NoAppNameFound\", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = \"NoAppOrWorkspaceInCurrentDirectory\", e[e.NoWorkspaceName = 22] = \"NoWorkspaceName\", e[e.OperationCancelled = 23] = \"OperationCancelled\", e[e.ServeDescription = 24] = \"ServeDescription\", e[e.ServedStopped = 25] = \"ServedStopped\", e[e.ServerGatewayMode = 26] = \"ServerGatewayMode\", e[e.ServerMode = 27] = \"ServerMode\", e[e.ServerModeInquiry = 28] = \"ServerModeInquiry\", e[e.ServerProxyMode = 29] = \"ServerProxyMode\", e[e.StopServerInstructions = 30] = \"StopServerInstructions\", e[e.TemplateFrameworkInquiry = 31] = \"TemplateFrameworkInquiry\", e[e.TemplateLanguageInquiry = 32] = \"TemplateLanguageInquiry\", e[e.UnrecognizedCommand = 33] = \"UnrecognizedCommand\", e[e.WorkspaceCreated = 34] = \"WorkspaceCreated\", e[e.WorkspaceNameInquiry = 35] = \"WorkspaceNameInquiry\", e))(Y || {});\nconst ge = {\n [\n 15\n /* Done */\n ]: \"Done\",\n [\n 22\n /* NoWorkspaceName */\n ]: \"No workspace name provided!\",\n [\n 19\n /* NoAppName */\n ]: \"No app name provided!\",\n [\n 0\n /* AlreadyExists */\n ]: \"File or directory '{0}' already exists!\",\n [\n 21\n /* NoAppOrWorkspaceInCurrentDirectory */\n ]: \"Could not find any app entry file at '{0}'!\",\n [\n 33\n /* UnrecognizedCommand */\n ]: \"Unrecognized command(s) {0}!\",\n [\n 34\n /* WorkspaceCreated */\n ]: \"Workspace was created at path '{0}'!\",\n [\n 4\n /* AppCreated */\n ]: \"App was created at path '{0}'!\",\n [\n 25\n /* ServedStopped */\n ]: \"Server stopped.\",\n [\n 11\n /* CreateWorkspaceDescription */\n ]: \"Creates an Alliance Workspace in the current directory.\",\n [\n 10\n /* CreateAppDescription */\n ]: \"Creates an Alliance Application in the current directory or Alliance Workspace.\",\n [\n 24\n /* ServeDescription */\n ]: \"Starts a Alliance development server using the current directory package.json.\",\n [\n 7\n /* BuildDescription */\n ]: \"Builds an Alliance Application using Vite.\",\n [\n 35\n /* WorkspaceNameInquiry */\n ]: \"Enter the name of your workspace\",\n [\n 28\n /* ServerModeInquiry */\n ]: \"Which server mode do you want to use?\",\n [\n 6\n /* AppNameInquiry */\n ]: \"Enter the name of your app\",\n [\n 18\n /* MissingTranslationKey */\n ]: \"No translation key provided!\",\n [\n 23\n /* OperationCancelled */\n ]: \"Operation cancelled.\",\n [\n 30\n /* StopServerInstructions */\n ]: `Press CTRL + C to stop the server.\n`,\n [\n 32\n /* TemplateLanguageInquiry */\n ]: \"Select preferred language\",\n [\n 31\n /* TemplateFrameworkInquiry */\n ]: \"Select preferred framework template\",\n [\n 13\n /* DevServerPortDescription */\n ]: \"The port that the dev server should use.\",\n [\n 14\n /* DevServerLoggingDescription */\n ]: \"Whether the dev server and browser console should output more log information or not (false).\",\n [\n 1\n /* ApiGatewayPortDescription */\n ]: \"The port that the api gateway should use.\",\n [\n 2\n /* ApiServerModeDescription */\n ]: \"Which components to start. [server|server-proxy|server-gateway].\",\n [\n 12\n /* DevServerOpenDescription */\n ]: \"Whether the dev server should automatically open in your browser or not.\",\n [\n 9\n /* BuildWatchDescription */\n ]: \"Whether the build should start watching and rebuild when files change or not.\",\n [\n 5\n /* AppEntryBuildOptionDescription */\n ]: \"The entry file for the app (./src/app).\",\n [\n 17\n /* ManifestEntryBuildOptionDescription */\n ]: \"The entry file for the app manifest (./src/manifest).\",\n [\n 8\n /* BuildModeOptionDescription */\n ]: \"Which mode to use when building the app.\",\n [\n 16\n /* FetchPackageVersionError */\n ]: \"Failed to fetch package info from the NPM registry for package '${0}'!\",\n [\n 20\n /* NoAppNameFound */\n ]: \"Could not find app name in manifest.\",\n [\n 3\n /* AppConfigurationPath */\n ]: \"The path to the app configuration file.\",\n [\n 27\n /* ServerMode */\n ]: \"Server\",\n [\n 29\n /* ServerProxyMode */\n ]: \"Server with proxy\",\n [\n 26\n /* ServerGatewayMode */\n ]: \"Server with gateway\"\n}, L = class {\n};\nlet O = L;\nD(O, \"getTranslations\", () => ge), D(O, \"getTranslation\", (e, ...o) => {\n const t = L.getTranslations()[e];\n if (!t)\n throw new Error(`Could not find text with given key '${e}'.`);\n return o.reduce(\n (r, i, s) => r.toString().replace(`{${s}}`, i.toString()),\n t\n ).toString();\n}), D(O, \"get\", (e = Y.MissingTranslationKey, ...o) => L.getTranslation(e, ...o));\nfunction me(e) {\n return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, \"default\") ? e.default : e;\n}\nvar j = { exports: {} }, P, V;\nfunction we() {\n if (V)\n return P;\n V = 1;\n var e = 1e3, o = e * 60, t = o * 60, r = t * 24, i = r * 7, s = r * 365.25;\n P = function(n, a) {\n a = a || {};\n var c = typeof n;\n if (c === \"string\" && n.length > 0)\n return u(n);\n if (c === \"number\" && isFinite(n))\n return a.long ? l(n) : p(n);\n throw new Error(\n \"val is not a non-empty string or a valid number. val=\" + JSON.stringify(n)\n );\n };\n function u(n) {\n if (n = String(n), !(n.length > 100)) {\n var a = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n n\n );\n if (a) {\n var c = parseFloat(a[1]), y = (a[2] || \"ms\").toLowerCase();\n switch (y) {\n case \"years\":\n case \"year\":\n case \"yrs\":\n case \"yr\":\n case \"y\":\n return c * s;\n case \"weeks\":\n case \"week\":\n case \"w\":\n return c * i;\n case \"days\":\n case \"day\":\n case \"d\":\n return c * r;\n case \"hours\":\n case \"hour\":\n case \"hrs\":\n case \"hr\":\n case \"h\":\n return c * t;\n case \"minutes\":\n case \"minute\":\n case \"mins\":\n case \"min\":\n case \"m\":\n return c * o;\n case \"seconds\":\n case \"second\":\n case \"secs\":\n case \"sec\":\n case \"s\":\n return c * e;\n case \"milliseconds\":\n case \"millisecond\":\n case \"msecs\":\n case \"msec\":\n case \"ms\":\n return c;\n default:\n return;\n }\n }\n }\n }\n function p(n) {\n var a = Math.abs(n);\n return a >= r ? Math.round(n / r) + \"d\" : a >= t ? Math.round(n / t) + \"h\" : a >= o ? Math.round(n / o) + \"m\" : a >= e ? Math.round(n / e) + \"s\" : n + \"ms\";\n }\n function l(n) {\n var a = Math.abs(n);\n return a >= r ? d(n, a, r, \"day\") : a >= t ? d(n, a, t, \"hour\") : a >= o ? d(n, a, o, \"minute\") : a >= e ? d(n, a, e, \"second\") : n + \" ms\";\n }\n function d(n, a, c, y) {\n var C = a >= c * 1.5;\n return Math.round(n / c) + \" \" + y + (C ? \"s\" : \"\");\n }\n return P;\n}\nfunction Ce(e) {\n t.debug = t, t.default = t, t.coerce = l, t.disable = s, t.enable = i, t.enabled = u, t.humanize = we(), t.destroy = d, Object.keys(e).forEach((n) => {\n t[n] = e[n];\n }), t.names = [], t.skips = [], t.formatters = {};\n function o(n) {\n let a = 0;\n for (let c = 0; c < n.length; c++)\n a = (a << 5) - a + n.charCodeAt(c), a |= 0;\n return t.colors[Math.abs(a) % t.colors.length];\n }\n t.selectColor = o;\n function t(n) {\n let a, c = null, y, C;\n function f(...g) {\n if (!f.enabled)\n return;\n const b = f, A = Number(/* @__PURE__ */ new Date()), oe = A - (a || A);\n b.diff = oe, b.prev = a, b.curr = A, a = A, g[0] = t.coerce(g[0]), typeof g[0] != \"string\" && g.unshift(\"%O\");\n let S = 0;\n g[0] = g[0].replace(/%([a-zA-Z%])/g, (M, re) => {\n if (M === \"%%\")\n return \"%\";\n S++;\n const K = t.formatters[re];\n if (typeof K == \"function\") {\n const ne = g[S];\n M = K.call(b, ne), g.splice(S, 1), S--;\n }\n return M;\n }), t.formatArgs.call(b, g), (b.log || t.log).apply(b, g);\n }\n return f.namespace = n, f.useColors = t.useColors(), f.color = t.selectColor(n), f.extend = r, f.destroy = t.destroy, Object.defineProperty(f, \"enabled\", {\n enumerable: !0,\n configurable: !1,\n get: () => c !== null ? c : (y !== t.namespaces && (y = t.namespaces, C = t.enabled(n)), C),\n set: (g) => {\n c = g;\n }\n }), typeof t.init == \"function\" && t.init(f), f;\n }\n function r(n, a) {\n const c = t(this.namespace + (typeof a > \"u\" ? \":\" : a) + n);\n return c.log = this.log, c;\n }\n function i(n) {\n t.save(n), t.namespaces = n, t.names = [], t.skips = [];\n let a;\n const c = (typeof n == \"string\" ? n : \"\").split(/[\\s,]+/), y = c.length;\n for (a = 0; a < y; a++)\n c[a] && (n = c[a].replace(/\\*/g, \".*?\"), n[0] === \"-\" ? t.skips.push(new RegExp(\"^\" + n.slice(1) + \"$\")) : t.names.push(new RegExp(\"^\" + n + \"$\")));\n }\n function s() {\n const n = [\n ...t.names.map(p),\n ...t.skips.map(p).map((a) => \"-\" + a)\n ].join(\",\");\n return t.enable(\"\"), n;\n }\n function u(n) {\n if (n[n.length - 1] === \"*\")\n return !0;\n let a, c;\n for (a = 0, c = t.skips.length; a < c; a++)\n if (t.skips[a].test(n))\n return !1;\n for (a = 0, c = t.names.length; a < c; a++)\n if (t.names[a].test(n))\n return !0;\n return !1;\n }\n function p(n) {\n return n.toString().substring(2, n.toString().length - 2).replace(/\\.\\*\\?$/, \"*\");\n }\n function l(n) {\n return n instanceof Error ? n.stack || n.message : n;\n }\n function d() {\n console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\");\n }\n return t.enable(t.load()), t;\n}\nvar be = Ce;\n(function(e, o) {\n o.formatArgs = r, o.save = i, o.load = s, o.useColors = t, o.storage = u(), o.destroy = (() => {\n let l = !1;\n return () => {\n l || (l = !0, console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"));\n };\n })(), o.colors = [\n \"#0000CC\",\n \"#0000FF\",\n \"#0033CC\",\n \"#0033FF\",\n \"#0066CC\",\n \"#0066FF\",\n \"#0099CC\",\n \"#0099FF\",\n \"#00CC00\",\n \"#00CC33\",\n \"#00CC66\",\n \"#00CC99\",\n \"#00CCCC\",\n \"#00CCFF\",\n \"#3300CC\",\n \"#3300FF\",\n \"#3333CC\",\n \"#3333FF\",\n \"#3366CC\",\n \"#3366FF\",\n \"#3399CC\",\n \"#3399FF\",\n \"#33CC00\",\n \"#33CC33\",\n \"#33CC66\",\n \"#33CC99\",\n \"#33CCCC\",\n \"#33CCFF\",\n \"#6600CC\",\n \"#6600FF\",\n \"#6633CC\",\n \"#6633FF\",\n \"#66CC00\",\n \"#66CC33\",\n \"#9900CC\",\n \"#9900FF\",\n \"#9933CC\",\n \"#9933FF\",\n \"#99CC00\",\n \"#99CC33\",\n \"#CC0000\",\n \"#CC0033\",\n \"#CC0066\",\n \"#CC0099\",\n \"#CC00CC\",\n \"#CC00FF\",\n \"#CC3300\",\n \"#CC3333\",\n \"#CC3366\",\n \"#CC3399\",\n \"#CC33CC\",\n \"#CC33FF\",\n \"#CC6600\",\n \"#CC6633\",\n \"#CC9900\",\n \"#CC9933\",\n \"#CCCC00\",\n \"#CCCC33\",\n \"#FF0000\",\n \"#FF0033\",\n \"#FF0066\",\n \"#FF0099\",\n \"#FF00CC\",\n \"#FF00FF\",\n \"#FF3300\",\n \"#FF3333\",\n \"#FF3366\",\n \"#FF3399\",\n \"#FF33CC\",\n \"#FF33FF\",\n \"#FF6600\",\n \"#FF6633\",\n \"#FF9900\",\n \"#FF9933\",\n \"#FFCC00\",\n \"#FFCC33\"\n ];\n function t() {\n return typeof window < \"u\" && window.process && (window.process.type === \"renderer\" || window.process.__nwjs) ? !0 : typeof navigator < \"u\" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/) ? !1 : typeof document < \"u\" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773\n typeof window < \"u\" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator < \"u\" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker\n typeof navigator < \"u\" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n }\n function r(l) {\n if (l[0] = (this.useColors ? \"%c\" : \"\") + this.namespace + (this.useColors ? \" %c\" : \" \") + l[0] + (this.useColors ? \"%c \" : \" \") + \"+\" + e.exports.humanize(this.diff), !this.useColors)\n return;\n const d = \"color: \" + this.color;\n l.splice(1, 0, d, \"color: inherit\");\n let n = 0, a = 0;\n l[0].replace(/%[a-zA-Z%]/g, (c) => {\n c !== \"%%\" && (n++, c === \"%c\" && (a = n));\n }), l.splice(a, 0, d);\n }\n o.log = console.debug || console.log || (() => {\n });\n function i(l) {\n try {\n l ? o.storage.setItem(\"debug\", l) : o.storage.removeItem(\"debug\");\n } catch {\n }\n }\n function s() {\n let l;\n try {\n l = o.storage.getItem(\"debug\");\n } catch {\n }\n return !l && typeof process < \"u\" && \"env\" in process && (l = process.env.DEBUG), l;\n }\n function u() {\n try {\n return localStorage;\n } catch {\n }\n }\n e.exports = be(o);\n const { formatters: p } = e.exports;\n p.j = function(l) {\n try {\n return JSON.stringify(l);\n } catch (d) {\n return \"[UnexpectedJSONParseError]: \" + d.message;\n }\n };\n})(j, j.exports);\nvar ve = j.exports;\nconst ke = /* @__PURE__ */ me(ve);\nfunction H(e) {\n return e.type === \"Logic\";\n}\nvar U = /* @__PURE__ */ ((e) => (e.View = \"View\", e.Logic = \"Logic\", e))(U || {});\nclass _e {\n constructor(o) {\n k(this, \"type\", \"Logic\");\n k(this, \"execute\");\n this.execute = o;\n }\n}\nfunction Ge() {\n try {\n return ALLIANCE_APP_MANIFEST;\n } catch {\n }\n}\nfunction E() {\n try {\n return ALLIANCE_APP_NAME;\n } catch {\n }\n}\nfunction Ae() {\n try {\n return ALLIANCE_APP_KEY;\n } catch {\n }\n}\nfunction Se() {\n const e = {\n environment: \"production\",\n logging: !1\n };\n try {\n return ALLIANCE_ENVIRONMENT || e;\n } catch {\n return e;\n }\n}\nfunction Z() {\n if (N())\n return Promise.resolve();\n const e = 2e4, o = 5;\n return new Promise((t, r) => {\n const i = () => {\n clearInterval(u), clearTimeout(s);\n }, s = setTimeout(() => {\n i(), r(new Error(`Runtime not initialized after ${e}ms`));\n }, e), u = setInterval(() => {\n N() && (i(), t());\n }, o);\n });\n}\nfunction N() {\n return m(\n \"RUNTIME_INITIALIZED\"\n /* RuntimeInitialized */\n );\n}\nfunction m(e = \"\") {\n return globalThis[$(e)];\n}\nfunction J(e, o) {\n return globalThis[$(e)] = o;\n}\nfunction $(e) {\n return `__ALLIANCE_${e}`;\n}\nfunction X(e) {\n return `APP_CONTROLLER_KEY_${e}`;\n}\nvar B = /* @__PURE__ */ ((e) => (e.RuntimeInitialized = \"RUNTIME_INITIALIZED\", e.RuntimeApps = \"RUNTIME_APPS\", e.RuntimeManifests = \"RUNTIME_MANIFESTS\", e))(B || {});\nfunction We() {\n const e = document.createElement(\"div\");\n return e.id = \"root\", document.body.append(e), e;\n}\nfunction Fe() {\n const e = document.getElementById(\"root\");\n if (!e)\n throw new w(h.NoRootElement);\n return e;\n}\nfunction Ne() {\n return m(\n \"RUNTIME_MANIFESTS\"\n /* RuntimeManifests */\n ).reduce((o, t) => {\n if (!t.storage)\n return o;\n for (const [r, i] of Object.entries(t.storage))\n o[r] = i;\n return o;\n }, {});\n}\nfunction Ee(e) {\n return {\n capabilities: \"#25BCDD\",\n \"managed-objects\": \"#FC7A12\",\n controller: \"#F635C6\",\n proxy: \"#48E70B\",\n views: \"#F6D72E\",\n system: \"#D52C2E\"\n }[e];\n}\nconst _ = /* @__PURE__ */ new Map();\nfunction I(e) {\n let o = _.get(e);\n return o || (o = ke(e === \"system\" ? \"[system]\" : `[${E()}] ${e}`), o.color = Ee(e), o.enabled = Ie(), _.set(e, o), o);\n}\nfunction Ie() {\n const e = Se(), o = G.get(\"logging\");\n return e.environment === \"development\" && !!e.logging || o === \"true\";\n}\nconst v = I(\"system\");\nfunction Te(e) {\n const o = e.split(\";\")[0];\n return decodeURIComponent(o.split(\"=\")[0].trim());\n}\nconst Me = \"alliance-cookie-consent\";\nfunction De() {\n let e = [\"necessary\"];\n const o = G.get(Me);\n if (o) {\n const t = o.split(\",\"), r = /* @__PURE__ */ new Set([...e, ...t]);\n e = Array.from(r);\n }\n return e;\n}\nfunction Ye() {\n const e = Ne();\n function o(t, r, i) {\n const s = e[t];\n if (!s)\n throw new w(r, {\n key: t\n });\n if (!De().includes(s.category))\n throw new w(i, {\n key: t,\n category: s.category\n });\n return !0;\n }\n try {\n const t = Object.getOwnPropertyDescriptor(Document.prototype, \"cookie\") || Object.getOwnPropertyDescriptor(HTMLDocument.prototype, \"cookie\");\n t && t.configurable && (v(\"registering override for document.cookie setter\"), Object.defineProperty(document, \"cookie\", {\n get: function() {\n var r;\n return (r = t == null ? void 0 : t.get) == null ? void 0 : r.call(document);\n },\n set: function(r) {\n var i;\n if (r) {\n const s = Te(r);\n try {\n o(\n s,\n h.CookieKeyNotDefined,\n h.CookieCategoryNotAllowed\n );\n } catch (u) {\n console.error(u);\n return;\n }\n }\n return (i = t == null ? void 0 : t.set) == null ? void 0 : i.call(document, r);\n }\n }));\n } catch (t) {\n v(\"error occurred when attempting to override document.cookie setter - error: %O\", t);\n }\n try {\n const t = window.CookieStore.prototype.set;\n t && (v(\"registering override for cookieStore.set function\"), window.CookieStore.prototype.set = async function(r) {\n const i = typeof r == \"object\" ? r.name : r;\n try {\n o(\n i,\n h.CookieKeyNotDefined,\n h.CookieCategoryNotAllowed\n );\n } catch (s) {\n console.error(s);\n return;\n }\n return t.apply(this, arguments);\n });\n } catch (t) {\n v(\"error occurred when attempting to cookieStore.set - error: %O\", t);\n }\n try {\n const t = window.Storage.prototype.setItem;\n v(\"registering override for sessionStorage.setItem and localStorage.setItem\"), window.Storage.prototype.setItem = function(r, i) {\n try {\n o(\n r,\n h.StorageKeyNotDefined,\n h.StorageCategoryNotAllowed\n );\n } catch (s) {\n console.error(s);\n return;\n }\n return t.apply(this, arguments);\n };\n } catch (t) {\n v(\n \"error occurred when attempting to sessionStorage.setItem and localStorage.setItem - error: %O\",\n t\n );\n }\n}\nconst Oe = `\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>ACE Alliance - Cookie Policy</title>\n <link\n rel=\"icon\"\n href=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGcElEQVRYha2Xe4xUVx3HP7/fPTOzDLO7sw8RlzWlZEtp2dCy0qIVWltKU/UPDZH6ijXWEK2odPcPa2qbhpi2kSa7blSStsFUjNq0lWCMaVMx8rAm22IJMJRHCqFC6BJ22eEx+5p7z88/7sywC7uwgCe5mXsz5/y+j/M753eOcJ2tK5sDyBrME2gBmkBq43/tnMERgXdAjrbn518yXq4RNA3cB/J54HNiMhfEicm4oAYghmHexN4Dew5k01giUybQlc1h0CbI9zC+Imi9mCAIYhoHsnI4KcNjYoDhxWPxsxFY1Z5vHQVwVwSu3Qdid4E8rSb3i6mqKYwBjpWX1V/QZBiYYWIIiifCw8Mm/vS7L/W237FqJno58M5srgmxP4npjsAHDwTeaeAdagGBdwQWoBYgFqCmqGlMqvTE3+U+ipbeE+ngB42Lde6kDnRmcwisAHlBfdBYCYxStp3y7xjTJ51RA0XxgGCkasQFSfkW8NQlBDqzORVYK6ZPqAU6ThUyqd0TN7mQDRZ/CULzvVVeRO68xIGubE6BbjH9oVqA+thaQccpvjLwRDTit2RG/fxVGR3sLc4ELuRAV90+gJ/G4K4EHpRs1wr7qwW/uH36uaxPzwz0xNZhHUfAzJZgsjZWrqXEiTP9WlRP1Bb+pCacs2KaCwvmD/5+cLhCoCubU0G61QJXyWYkVv9/Av/UEzVh2+PVDmDPr875ob4oD6UcMLhfTdqU8dket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2PN0ng+3DDovIZFG5w37bEe+dc+UCQC8/ZtjzX07i/88saU4J8yLXiAhaCC+fn7Sz/7iNFq+mqZ6TuD6do+Gu7vPcuQvBRf62LlIQ2/Y1zvyra9OhnPZSf1g58k5I6ftDSnqnNFTaOACqmclfP0tSa3KBjrc5/2Hbwz7Q38ocHLniDM8XjxeIrxG3rA16vXXj529dVKMK2bVL2fkmhrmJ/9cPy91Z2ZGwhMqQx95TudC8gdCZx4obbMVAhqNGvaoCr99bKD1svGntK4647vg84J8X021PBXlK5gJGJWr11GDb3fkW7dPJfaUi3539iARxSUCz4AsERMVpHwDxMTyhq0HftGRbz071bhXfeooXVJvBR4EbgSGgR6Bt9qvArjc/gfZzPoCTDB+AgAAAABJRU5ErkJggg==\"\n />\n <style>\n @charset \"UTF-8\";\n @import 'https://cdn.voca.teliacompany.com/fonts/TeliaSansV10/TeliaSans.css';\n @import 'https://fonts.googleapis.com/css?family=Reenie+Beanie';\n\n body {\n font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;\n }\n\n body > div {\n max-width: 1000px;\n margin: 0 auto;\n padding: 0 40px 40px;\n }\n </style>\n </head>\n\n <body>\n <div>\n <h1>Cookie Policy</h1>\n <p>\n On our websites, we use cookies and other similar technologies. You can choose\n whether you want to allow our websites to store cookies on your computer or not. You\n can change your choices at any time.\n </p>\n\n <h2>Your consent is required</h2>\n <p>\n You choose whether you want to accept cookies on your device or not. Your consent is\n required for the use of cookies, but not for such cookies that are necessary to\n enable the service that you as a user have requested. If you do not accept our use\n of cookies, or if you have previously approved our use and have changed your mind,\n you can return to your cookie settings at any time and change your choices. You do\n this by clicking on the cookie button/link. You may also need to change the settings\n in your browser and manually delete cookies to clear your device of previously\n stored cookies.\n </p>\n\n <h2>What are cookies?</h2>\n <p>\n A cookie is a small text file that is stored on your computer by the web browser\n while browsing a website. When we refer to cookies (“cookies”) in this policy, other\n similar technologies and tools that retrieve and store information in your browser,\n and in some cases forward such information to third parties, in a manner similar to\n cookies. Examples are pixels, local storage, session storage and fingerprinting.\n </p>\n <p>\n The websites will “remember” and “recognize” you. This can be done by placing\n cookies in three different ways;\n </p>\n <ul>\n <li>The session ends, ie until you close the window in your browser.</li>\n <li>\n Time-limited, ie the cookie has a predetermined lifespan. The time may vary\n between different cookies.\n </li>\n <li>\n Until further notice, ie the information remains until you choose to delete it\n yourself. This applies to local storage.\n </li>\n </ul>\n <p>You can always go into your browser and delete already stored cookies yourself.</p>\n\n <h3>Third Party Cookies</h3>\n <p>\n We use third-party cookies on our websites. Third-party cookies are stored by\n someone other than the person responsible for the website, in this case by a company\n other than Telia.\n </p>\n <p>\n Telia uses external platforms to communicate digitally, these include the Google\n Marketing Platform and others. The platforms use both first- and third-party cookies\n as well as similar techniques to advertise and follow up the results of the\n advertising.\n </p>\n <p>\n A third-party cookie can be used by several websites to understand and track how you\n browse between different websites. Telia receives information from these cookies,\n but the information can also be used for other purposes determined by third parties.\n Third-party cookies found on our website are covered by each third-party privacy\n policy. Feel free to read these to understand what other purposes the information\n can be used for. Links are in our Cookie Table.\n </p>\n <p>\n For information about which third-party cookies are used on our websites, see our\n Cookie Table. For more information on how Telia handles personal data in connection\n with transfers to third parties, read our Privacy Policy.\n </p>\n\n <h2>Cookies on our websites</h2>\n <p>\n In order for you to have better control over which cookies are used on the websites,\n and thus be able to more easily decide how cookies should be used when you visit our\n websites, we have identified four different categories of cookies. These categories\n are defined based on the purposes for the use of the cookies.\n </p>\n <p>\n In our Cookie Table, you can also see which category each cookie belongs to, for\n what purposes it is used and for how long it is active.\n </p>\n <p>\n We have identified the following four categories of cookies. All categories contain\n cookies which means that data is shared with third parties.\n </p>\n\n <h3>Necessary</h3>\n <p>\n These cookies are needed for our app to work in a secure and correct way. Necessary\n cookies enable you to use our app and us to provide the service you request.\n Necessary cookies make basic functions of the app possible, for example, identifying\n you when you log into My Telia, detecting repeated failed login attempts,\n identifying where you are in the buying process and remembering the items put into\n your shopping basket.\n </p>\n\n <h3>Functionality</h3>\n <p>\n These cookies let us to enable some useful functionalities to make the user\n experience better, for example, to remember your login details and settings.\n </p>\n\n <h3>Analytics</h3>\n <p>\n These cookies give us information about how you use our app and allow us to improve\n the user experience.\n </p>\n\n <h3>Marketing</h3>\n <p>\n These cookies help us and our partners to display personalized and relevant ads\n based on your browsing behavior on our website and in our app, even when you later\n visit other (third parties’) websites. These cookies are used to evaluate the\n effectiveness of our marketingcampaigns, as well as for targeted marketing and\n profiling, regardless of which device(s) you have used. Information collected for\n this purpose may also be combined with other customer and traffic data we have about\n you, if you have given your consent that we may use your traffic data for marketing\n purpose and have not objected to the use of your customer data for marketing\n purposes.\n </p>\n\n <h2>Manage settings</h2>\n <p>\n We save your cookie consent for 12 months. Then we will ask you again. Please note\n that some cookies have a lifespan that exceeds these 12 months. You may therefore\n need to change the settings in your browser and manually delete all cookies.\n </p>\n <p>\n More information on how to turn off cookies can be found in the instructions for\n your browser.\n </p>\n <ul>\n <li>\n <a\n href=\"https://support.google.com/accounts/answer/61416?co=GENIE.Platform%3DDesktop&amp;hl=en\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Google Chrome</a\n >\n </li>\n <li>\n <a\n href=\"https://privacy.microsoft.com/en-us/windows-10-microsoft-edge-and-privacy\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Microsoft Edge</a\n >\n </li>\n <li>\n <a\n href=\"https://support.mozilla.org/en-US/kb/enable-and-disable-cookies-website-preferences\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Mozilla Firefox</a\n >\n </li>\n <li>\n <a\n href=\"https://support.microsoft.com/en-gb/help/17442/windows-internet-explorer-delete-manage-cookies\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Microsoft Internet Explorer</a\n >\n </li>\n <li>\n <a\n href=\"https://www.opera.com/help/tutorials/security/privacy/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Opera</a\n >\n </li>\n <li>\n <a\n href=\"https://support.apple.com/guide/safari/manage-cookies-and-website-data-sfri11471/mac\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Apple Safari</a\n >\n </li>\n </ul>\n\n <h3>Do Not Track-signals</h3>\n <p>\n If you have chosen to turn on the Do Not Track function in your browser, we will not\n automatically place cookies for marketing on your device. You make other choices in\n your cookie settings.\n </p>\n\n <h3>If you block cookies</h3>\n <p>\n If you choose not to accept our use of cookies, the functionality and performance of\n our websites may deteriorate as certain functions are dependent on cookies. A\n blocking of cookies can therefore mean that the websites’ services do not work as\n they should.\n </p>\n\n <h3>Your security with us</h3>\n <p>\n If you want to read more about your rights and how we protect your privacy, go to\n our privacy policy for\n <a\n href=\"https://www.telia.se/dam/jcr:df2eeb83-50ce-4383-89fc-0613f7615796/Integritetspolicy-privatkunder.pdf\"\n >private customers</a\n >\n (C2B) or\n <a\n href=\"https://www.telia.se/dam/jcr:95b2b4a5-82ca-436b-90e0-873e0a864118/Telia-integritetspolicy-foretag.pdf\"\n >corporate customers</a\n >\n (B2B). You are always welcome to contact us at\n <a href=\"mailto:dpo-se@teliacompany.com\">dpo-se@teliacompany.com</a> if you have any\n questions.\n </p>\n <p>Our cookie policy may change in the future.</p>\n <p>\n More information about cookies can be found at the Swedish Post and Telecom\n Authority (PTS).\n </p>\n\n <h2>Our Cookie Table</h2>\n <p>\n Below, you will find a list of the cookies and similar technologies that we use on\n this website. These cookies are stored on your device by us.\n </p>\n <table>\n <thead>\n <tr>\n <th>Cookie</th>\n <th>Category</th>\n <th>Purpose</th>\n <th>Lifespan</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>alliance-session-v1</td>\n <td>necessary</td>\n <td>Contains the authenticated user.</td>\n <td>1 day</td>\n </tr>\n {APP_COOKIES}\n </tbody>\n </table>\n <style>\n table {\n width: 100%;\n border: 1px solid rgba(0, 0, 0, 0.15);\n }\n th, td {\n text-align: left;\n padding: 3px;\n }\n </style>\n </div>\n </body>\n</html>\n`;\nfunction He(e) {\n const o = [];\n for (const t of e)\n if (t.storage)\n for (const [r, i] of Object.entries(t.storage)) {\n const s = Pe(r, i);\n o.push(s);\n }\n return Oe.replace(\"{APP_COOKIES}\", o.join(\"\"));\n}\nfunction Pe(e, o) {\n const t = [\"<tr>\"], { category: r, purpose: i, lifespan: s } = o;\n return t.push(`<td>${e}</td>`), t.push(`<td>${r}</td>`), t.push(`<td>${i}</td>`), t.push(`<td>${s}</td>`), t.push(\"</tr>\"), t.join(\"\");\n}\nlet q = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((o, t) => (t &= 63, t < 36 ? o += t.toString(36) : t < 62 ? o += (t - 26).toString(36).toUpperCase() : t > 62 ? o += \"-\" : o += \"_\", o), \"\");\nconst x = I(\"views\");\nfunction Q(e) {\n return e.type === U.View;\n}\nvar xe = /* @__PURE__ */ ((e) => (e.Main = \"main\", e.Aside = \"aside\", e.Body = \"body\", e))(xe || {});\nclass Ze {\n constructor(o, t) {\n k(this, \"type\", U.View);\n k(this, \"execute\");\n this.container = t, this.execute = o;\n }\n}\nfunction Re() {\n const e = E(), o = /* @__PURE__ */ new Map(), t = async (i) => {\n const s = o.get(i);\n if (x(\"unmounting view - view: %O\", s), !s)\n throw new w(h.NoView, { id: i, app: e });\n s.unmount && await s.unmount(), s.element.replaceChildren(), s.element.removeAttribute(\"app\"), s.element.removeAttribute(\"view-id\"), o.delete(i), s.element.remove();\n };\n return {\n unmount: t,\n mount: async (i, s, u, p) => {\n if (x(\"mounting view - operation: %O, capability: %o, args: %O\", i, u, p), i.container === \"main\") {\n const c = ye(e, u, p), y = location.href.replace(location.origin, \"\");\n c !== y && (x(\"syncing url - data: %O, url: %o\", p, c), history.pushState(p, \"\", c));\n }\n if (i.container === \"aside\" || i.container === \"main\") {\n const [c] = Array.from(document.getElementsByTagName(i.container)), y = c == null ? void 0 : c.getAttribute(\"app\"), C = c == null ? void 0 : c.getAttribute(\"view-id\");\n if (y && C) {\n const f = await z(y);\n await (f == null ? void 0 : f.views.unmount(C));\n }\n }\n let l;\n const d = Fe();\n i.container === \"aside\" ? (l = document.createElement(\n \"aside\"\n /* Aside */\n ), d.prepend(l)) : i.container === \"body\" ? (l = document.createElement(\"div\"), d.append(l)) : (l = document.createElement(\n \"main\"\n /* Main */\n ), d.append(l));\n const n = q(8);\n l.setAttribute(\"app\", e), l.setAttribute(\"view-id\", n);\n const a = {\n element: l,\n unmount: await i.execute(l, (c) => {\n s(c), t(n);\n })\n };\n o.set(n, a);\n }\n };\n}\nconst Le = I(\"controller\");\nfunction je() {\n const e = E(), o = Ae();\n if (!e || !o)\n throw new w(h.NoAppNameOrKey);\n const t = X(e);\n return m(t) ? m(t) : (J(t, o), o);\n}\nfunction ee() {\n const e = je();\n if (m(e))\n return m(e);\n const o = E();\n Le(\"creating app controller\");\n const t = {\n name: o,\n capabilities: {\n app: /* @__PURE__ */ new Map(),\n system: /* @__PURE__ */ new Map()\n },\n managedObjects: {\n providers: /* @__PURE__ */ new Map(),\n watchers: /* @__PURE__ */ new Map()\n },\n views: Re()\n };\n return J(e, t), t;\n}\nasync function z(e) {\n await Z();\n const o = X(e), t = m(o);\n if (!t)\n return;\n const r = m(t);\n if (r)\n return r;\n}\nasync function Je() {\n return await Z(), (await Promise.all(\n m(B.RuntimeApps).map((o) => z(o))\n )).filter((o) => !!o);\n}\nconst T = I(\"capabilities\");\nasync function te(e, o, t) {\n const r = await z(e);\n if (!r)\n throw new w(h.MissingAppController, { app: e });\n const s = (t === \"app\" ? r.capabilities.app : r.capabilities.system).get(o);\n if (!s)\n throw new w(h.MissingCapabilityOnApp, {\n capability: o,\n app: e\n });\n return { controller: r, handler: s };\n}\nfunction Ue(e) {\n return (o, t, r) => (e(\"requesting capability - app: %o, capability: %o, args: %O\", o, t, r), {\n id: q(8),\n result: new Promise(async (i) => {\n const { controller: s, handler: u } = await te(\n o,\n t,\n \"app\"\n ), p = await u(r);\n H(p) ? await p.execute(i) : Q(p) && await s.views.mount(p, i, t, r), e(\n \"resolved capability - app: %o, capability: %o, args: %O\",\n o,\n t,\n r\n );\n })\n });\n}\nfunction $e(e, o) {\n if (N())\n throw new w(h.AlreadyInitialized);\n const t = ee();\n T(\"enabling capability - capability: %o, handler: %O\", e, o), t.capabilities.app.set(e, o);\n}\nfunction Xe(e, o) {\n if (N())\n throw new w(h.AlreadyInitialized);\n const t = ee();\n T(\"enabling system capability - capability: %o, handler: %O\", e, o), t.capabilities.system.set(e, o);\n}\nfunction Be(e) {\n return (o, t, r) => {\n e(\n \"requesting system capability - capability: %o, args: %O, targetApp: %o\",\n o,\n t,\n r\n );\n const i = [], s = m(B.RuntimeApps);\n for (const u of s) {\n if (r && u !== r)\n continue;\n const p = new Promise(async (l) => {\n const { controller: d, handler: n } = await te(\n u,\n o,\n \"system\"\n ), a = await n(t);\n H(a) ? await a.execute(l) : Q(a) && await d.views.mount(a, l, o, t), e(\n \"resolved system capability - capability: %o, args: %O, targetApp: %o\",\n o,\n t,\n r\n );\n });\n i.push({\n id: q(8),\n result: p\n });\n }\n return i;\n };\n}\nconst Qe = Be(T), et = Ue(T);\nexport {\n Me as A,\n w as C,\n _e as L,\n h as N,\n xe as O,\n Ve as P,\n B as S,\n Ze as V,\n Ke as W,\n Je as a,\n Ge as b,\n I as c,\n Se as d,\n He as e,\n $e as f,\n ee as g,\n Xe as h,\n N as i,\n Qe as j,\n We as k,\n Be as l,\n z as m,\n Ue as n,\n m as o,\n et as r,\n Ye as t,\n J as w\n};\n//# sourceMappingURL=capabilities-a4bf3b71.js.map\n","import { c as E, i as S, C as p, N as g, g as N, a as v, b as T, d as R, V as d, O, L as j } from \"./chunks/capabilities-a4bf3b71.js\";\nimport { A as J, f as F, h as M, e as X, r as Y, j as Z } from \"./chunks/capabilities-a4bf3b71.js\";\nfunction k(e) {\n return e;\n}\nconst c = E(\"managed-objects\");\nfunction V(e, n) {\n return c(\"querying objects - object: %o, args: %O\", e, n), {\n async resolve() {\n return c(\"resolving query - object: %o, args: %O\", e, n), await (await C(e)).managedObjects.providers.get(e)(n);\n },\n async watch(r) {\n c(\"adding watcher - object: %o, args: %O\", e, n), (await C(e)).managedObjects.watchers.get(e).push(r);\n }\n };\n}\nfunction D(e, n) {\n if (S())\n throw new p(g.AlreadyInitialized);\n c(\"registering provider - object: %o, handler: %O\", e, n);\n const r = N();\n return r.managedObjects.providers.set(e, n), r.managedObjects.watchers.set(e, []), function() {\n c(\"triggering watchers - object: %o, handler: %O\", e, n);\n const t = r.managedObjects.watchers.get(e) || [];\n for (const a of t)\n a();\n };\n}\nasync function C(e) {\n const r = (await v()).find(\n (t) => t.managedObjects.providers.has(e) && t.managedObjects.watchers.has(e)\n );\n if (!r)\n throw new p(g.MissingManagedObjectProvider, { object: e });\n return r;\n}\nconst A = E(\"proxy\");\nvar L = /* @__PURE__ */ ((e) => (e.Get = \"GET\", e.Head = \"HEAD\", e.Post = \"POST\", e.Put = \"PUT\", e.Delete = \"DELETE\", e.Connect = \"CONNECT\", e.Options = \"OPTIONS\", e.Trace = \"TRACE\", e.Patch = \"PATCH\", e))(L || {});\nfunction b(e, n, r = []) {\n const t = new URL(e, location.origin);\n if (r.find((o) => $(o, e))) {\n const i = \"/-/gateway\" + (t.pathname !== \"/\" ? t.pathname : \"/\") + (n ? t.search : \"\");\n return new URL(i, location.origin);\n }\n return t;\n}\nfunction q(e = {}) {\n if (Object.keys(e).length === 0)\n return \"\";\n const n = Object.entries(e).reduce(\n (t, [a, o]) => (typeof o > \"u\" || o === null || (t[a] = o.toString()), t),\n {}\n );\n return `?${new URLSearchParams(n).toString()}`;\n}\nfunction x(e) {\n return e.replaceAll(/[-\\/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n}\nfunction $(e, n) {\n const r = x(e);\n return new RegExp(`^${r.replaceAll(\"\\\\?\", \".?\").replaceAll(\"\\\\*\", \".*\")}`, \"i\").test(n);\n}\nfunction I(e, n) {\n const r = T();\n if (!r)\n throw new p(g.NoManifest);\n const { name: t, endpoints: a = [] } = r;\n A(\"creating request - input: %o, options: %O\", e, { lots: 1, of: { properties: 123 } });\n const o = b(e.toString(), !0, a), i = new Request(o, n), { environment: l } = R();\n if (l === \"production\") {\n const u = location.pathname.split(\"/\").filter((f) => !!f);\n i.headers.set(\"Alliance-Target-Workspace\", u[0]);\n }\n return i.headers.set(\"Alliance-Target-Url\", e.toString()), i.headers.set(\"Alliance-Target-App\", t), A(\"created request - request: %O\", i), i;\n}\nfunction G() {\n const e = T();\n if (!e)\n throw new p(g.NoManifest);\n const { name: n, endpoints: r = [] } = e;\n async function t(a, o, i = {}) {\n const { body: l, query: u, headers: f } = i, P = b(a, !1, r), w = q(u), h = {\n [\n \"Alliance-Target-Url\"\n /* TargetUrl */\n ]: `${a}${w}`,\n // FUTURE TODO: Is there a better name for this?\n [\n \"Alliance-Target-App\"\n /* TargetApp */\n ]: n\n }, m = location.pathname.split(\"/\").filter((s) => !!s);\n m.length > 1 && (h[\n \"Alliance-Target-Workspace\"\n /* TargetWorkspace */\n ] = m[0]);\n const y = {\n method: o,\n headers: {\n \"Content-Type\": \"application/json\",\n ...f,\n ...h\n }\n };\n return l && (y.body = JSON.stringify(l)), fetch(`${P}${w}`, y).then((s) => s.json()).catch((s) => {\n throw s;\n });\n }\n return {\n post: (a, o) => t(a, \"POST\", o),\n put: (a, o) => t(a, \"PUT\", o),\n delete: (a, o) => t(a, \"DELETE\", o),\n get: (a, o) => t(a, \"GET\", o),\n create: I\n };\n}\nfunction _(e) {\n return new d(e, O.Main);\n}\nfunction z(e) {\n return new d(e, O.Body);\n}\nfunction B(e) {\n return new d(e, O.Aside);\n}\nfunction K(e) {\n return new j(e);\n}\nexport {\n J as ALLIANCE_COOKIE_CONSENT_COOKIE_NAME,\n L as HttpMethods,\n B as createAsideViewOperation,\n z as createBodyViewOperation,\n K as createOperation,\n G as createProxy,\n I as createRequest,\n _ as createViewOperation,\n k as defineConfig,\n F as enableCapability,\n M as enableSystemCapability,\n X as generateCookiePolicyHtml,\n D as provideObjects,\n V as queryObjects,\n Y as runCapability,\n Z as runSystemCapability\n};\n//# sourceMappingURL=index.js.map\n","var f = Object.defineProperty;\nvar v = (e, t, r) => t in e ? f(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;\nvar a = (e, t, r) => (v(e, typeof t != \"symbol\" ? t + \"\" : t, r), r);\nvar N = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = \"AlreadyInitialized\", e[e.NoAppNameOrKey = 1001] = \"NoAppNameOrKey\", e[e.MissingAppController = 1002] = \"MissingAppController\", e[e.MissingCapabilityOnApp = 1003] = \"MissingCapabilityOnApp\", e[e.MissingManagedObjectProvider = 1004] = \"MissingManagedObjectProvider\", e[e.NoManifest = 1005] = \"NoManifest\", e[e.NoRootElement = 1006] = \"NoRootElement\", e[e.NoView = 1007] = \"NoView\", e[e.CookieKeyNotDefined = 1008] = \"CookieKeyNotDefined\", e[e.CookieCategoryNotAllowed = 1009] = \"CookieCategoryNotAllowed\", e[e.StorageKeyNotDefined = 1010] = \"StorageKeyNotDefined\", e[e.StorageCategoryNotAllowed = 1011] = \"StorageCategoryNotAllowed\", e))(N || {}), A = /* @__PURE__ */ ((e) => (e[e.CurrentUserMissingProvider = 2e3] = \"CurrentUserMissingProvider\", e[e.CurrentUserGatewayNotStarted = 2001] = \"CurrentUserGatewayNotStarted\", e[e.CurrentUserMissingBackend = 2002] = \"CurrentUserMissingBackend\", e[e.CurrentUserMissingInDatabase = 2003] = \"CurrentUserMissingInDatabase\", e))(A || {});\nfunction m(e, t) {\n return Object.entries(t).reduce((r, [i, n]) => r.replaceAll(`{{${i}}}`, n), e);\n}\nconst S = {\n // framework\n [\n 1e3\n /* AlreadyInitialized */\n ]: \"The runtime has already been initialized\",\n [\n 1001\n /* NoAppNameOrKey */\n ]: \"App name and/or app key is not defined on global scope\",\n [\n 1002\n /* MissingAppController */\n ]: \"No app controller registered for app '{{app}}'\",\n [\n 1003\n /* MissingCapabilityOnApp */\n ]: \"No capability '{{capability}}' enabled for app '{{app}}'\",\n [\n 1004\n /* MissingManagedObjectProvider */\n ]: \"No managed object provider registered for object '{{object}}'\",\n [\n 1005\n /* NoManifest */\n ]: \"The current apps manifest is not defined on global scope\",\n [\n 1006\n /* NoRootElement */\n ]: \"Could not find the root element in the DOM\",\n [\n 1007\n /* NoView */\n ]: \"Could not find view with id '{{id}}' on view controller for app '{{app}}'\",\n [\n 1008\n /* CookieKeyNotDefined */\n ]: \"Cookie key '{{key}}' not present in manifest, cookie has not been set\",\n [\n 1009\n /* CookieCategoryNotAllowed */\n ]: \"Cookies categorized as '{{category}}' are not allowed by the user, cookie '{{key}}' has not been set\",\n [\n 1010\n /* StorageKeyNotDefined */\n ]: \"Storage key '{{key}}' not present in manifest, item has not been stored\",\n [\n 1011\n /* StorageCategoryNotAllowed */\n ]: \"Storage categorized as '{{category}}' is not allowed by the user, item '{{key}}' has not been stored\",\n // utilities\n [\n 2e3\n /* CurrentUserMissingProvider */\n ]: \"No managed object provider registered for object 'currentUser'\",\n [\n 2001\n /* CurrentUserGatewayNotStarted */\n ]: \"Could not access the gateway when querying 'currentUser'\",\n [\n 2002\n /* CurrentUserMissingBackend */\n ]: \"Could not access the required backend when querying 'currentUser'\",\n [\n 2003\n /* CurrentUserMissingInDatabase */\n ]: \"Could not locate the authenticated user in the Alliance database\"\n}, d = \"AllianceError\";\nclass C extends Error {\n constructor(t, r = {}) {\n const i = m(S[t], r), n = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;\n super(i), this.code = t, this.name = d, this.stack = `[${t}] - ${i}\n` + n;\n }\n}\nfunction I(e) {\n return !!e.code && e.name === d;\n}\nfunction D(e) {\n const r = Object.entries(e).reduce((i, n) => {\n const [o, p] = n;\n return typeof p > \"u\" || (typeof p == \"object\" && p !== null ? i[o] = JSON.stringify(p) : i[o] = p), i;\n }, {});\n return Object.keys(r).length ? `?${new URLSearchParams(r)}` : \"\";\n}\nfunction b() {\n const e = l(), { href: t, search: r } = window.location;\n return t.replace(e, \"\").replace(r, \"\");\n}\nfunction k(e = \"\", t = \"\", r = {}) {\n const i = l().replace(location.origin, \"\"), n = D(r);\n return e ? t ? `${i}/${e}/${t}${n}` : `${i}/${e}${n}` : `${i}${n}`;\n}\nfunction W() {\n const e = b(), [t = \"\", r = \"\"] = e.split(\"/\").filter((i) => !!i);\n return {\n app: t,\n capability: r\n };\n}\nfunction P(e) {\n const { origin: t, pathname: r } = window.location;\n if (e === \"production\") {\n const [i] = r.split(\"/\").filter((n) => !!n);\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = `${t}/${i}`;\n }\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = t;\n}\nfunction l() {\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL;\n}\nvar s = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = \"AlreadyExists\", e[e.ApiGatewayPortDescription = 1] = \"ApiGatewayPortDescription\", e[e.ApiServerModeDescription = 2] = \"ApiServerModeDescription\", e[e.AppConfigurationPath = 3] = \"AppConfigurationPath\", e[e.AppCreated = 4] = \"AppCreated\", e[e.AppEntryBuildOptionDescription = 5] = \"AppEntryBuildOptionDescription\", e[e.AppNameInquiry = 6] = \"AppNameInquiry\", e[e.BuildDescription = 7] = \"BuildDescription\", e[e.BuildModeOptionDescription = 8] = \"BuildModeOptionDescription\", e[e.BuildWatchDescription = 9] = \"BuildWatchDescription\", e[e.CreateAppDescription = 10] = \"CreateAppDescription\", e[e.CreateWorkspaceDescription = 11] = \"CreateWorkspaceDescription\", e[e.DevServerOpenDescription = 12] = \"DevServerOpenDescription\", e[e.DevServerPortDescription = 13] = \"DevServerPortDescription\", e[e.DevServerLoggingDescription = 14] = \"DevServerLoggingDescription\", e[e.Done = 15] = \"Done\", e[e.FetchPackageVersionError = 16] = \"FetchPackageVersionError\", e[e.ManifestEntryBuildOptionDescription = 17] = \"ManifestEntryBuildOptionDescription\", e[e.MissingTranslationKey = 18] = \"MissingTranslationKey\", e[e.NoAppName = 19] = \"NoAppName\", e[e.NoAppNameFound = 20] = \"NoAppNameFound\", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = \"NoAppOrWorkspaceInCurrentDirectory\", e[e.NoWorkspaceName = 22] = \"NoWorkspaceName\", e[e.OperationCancelled = 23] = \"OperationCancelled\", e[e.ServeDescription = 24] = \"ServeDescription\", e[e.ServedStopped = 25] = \"ServedStopped\", e[e.ServerGatewayMode = 26] = \"ServerGatewayMode\", e[e.ServerMode = 27] = \"ServerMode\", e[e.ServerModeInquiry = 28] = \"ServerModeInquiry\", e[e.ServerProxyMode = 29] = \"ServerProxyMode\", e[e.StopServerInstructions = 30] = \"StopServerInstructions\", e[e.TemplateFrameworkInquiry = 31] = \"TemplateFrameworkInquiry\", e[e.TemplateLanguageInquiry = 32] = \"TemplateLanguageInquiry\", e[e.UnrecognizedCommand = 33] = \"UnrecognizedCommand\", e[e.WorkspaceCreated = 34] = \"WorkspaceCreated\", e[e.WorkspaceNameInquiry = 35] = \"WorkspaceNameInquiry\", e))(s || {});\nconst M = {\n [\n 15\n /* Done */\n ]: \"Done\",\n [\n 22\n /* NoWorkspaceName */\n ]: \"No workspace name provided!\",\n [\n 19\n /* NoAppName */\n ]: \"No app name provided!\",\n [\n 0\n /* AlreadyExists */\n ]: \"File or directory '{0}' already exists!\",\n [\n 21\n /* NoAppOrWorkspaceInCurrentDirectory */\n ]: \"Could not find any app entry file at '{0}'!\",\n [\n 33\n /* UnrecognizedCommand */\n ]: \"Unrecognized command(s) {0}!\",\n [\n 34\n /* WorkspaceCreated */\n ]: \"Workspace was created at path '{0}'!\",\n [\n 4\n /* AppCreated */\n ]: \"App was created at path '{0}'!\",\n [\n 25\n /* ServedStopped */\n ]: \"Server stopped.\",\n [\n 11\n /* CreateWorkspaceDescription */\n ]: \"Creates an Alliance Workspace in the current directory.\",\n [\n 10\n /* CreateAppDescription */\n ]: \"Creates an Alliance Application in the current directory or Alliance Workspace.\",\n [\n 24\n /* ServeDescription */\n ]: \"Starts a Alliance development server using the current directory package.json.\",\n [\n 7\n /* BuildDescription */\n ]: \"Builds an Alliance Application using Vite.\",\n [\n 35\n /* WorkspaceNameInquiry */\n ]: \"Enter the name of your workspace\",\n [\n 28\n /* ServerModeInquiry */\n ]: \"Which server mode do you want to use?\",\n [\n 6\n /* AppNameInquiry */\n ]: \"Enter the name of your app\",\n [\n 18\n /* MissingTranslationKey */\n ]: \"No translation key provided!\",\n [\n 23\n /* OperationCancelled */\n ]: \"Operation cancelled.\",\n [\n 30\n /* StopServerInstructions */\n ]: `Press CTRL + C to stop the server.\n`,\n [\n 32\n /* TemplateLanguageInquiry */\n ]: \"Select preferred language\",\n [\n 31\n /* TemplateFrameworkInquiry */\n ]: \"Select preferred framework template\",\n [\n 13\n /* DevServerPortDescription */\n ]: \"The port that the dev server should use.\",\n [\n 14\n /* DevServerLoggingDescription */\n ]: \"Whether the dev server and browser console should output more log information or not (false).\",\n [\n 1\n /* ApiGatewayPortDescription */\n ]: \"The port that the api gateway should use.\",\n [\n 2\n /* ApiServerModeDescription */\n ]: \"Which components to start. [server|server-proxy|server-gateway].\",\n [\n 12\n /* DevServerOpenDescription */\n ]: \"Whether the dev server should automatically open in your browser or not.\",\n [\n 9\n /* BuildWatchDescription */\n ]: \"Whether the build should start watching and rebuild when files change or not.\",\n [\n 5\n /* AppEntryBuildOptionDescription */\n ]: \"The entry file for the app (./src/app).\",\n [\n 17\n /* ManifestEntryBuildOptionDescription */\n ]: \"The entry file for the app manifest (./src/manifest).\",\n [\n 8\n /* BuildModeOptionDescription */\n ]: \"Which mode to use when building the app.\",\n [\n 16\n /* FetchPackageVersionError */\n ]: \"Failed to fetch package info from the NPM registry for package '${0}'!\",\n [\n 20\n /* NoAppNameFound */\n ]: \"Could not find app name in manifest.\",\n [\n 3\n /* AppConfigurationPath */\n ]: \"The path to the app configuration file.\",\n [\n 27\n /* ServerMode */\n ]: \"Server\",\n [\n 29\n /* ServerProxyMode */\n ]: \"Server with proxy\",\n [\n 26\n /* ServerGatewayMode */\n ]: \"Server with gateway\"\n}, u = class {\n};\nlet c = u;\na(c, \"getTranslations\", () => M), a(c, \"getTranslation\", (t, ...r) => {\n const n = u.getTranslations()[t];\n if (!n)\n throw new Error(`Could not find text with given key '${t}'.`);\n return r.reduce(\n (p, h, g) => p.toString().replace(`{${g}}`, h.toString()),\n n\n ).toString();\n}), a(c, \"get\", (t = s.MissingTranslationKey, ...r) => u.getTranslation(t, ...r));\nfunction R(e, t) {\n return y(Object.values(e), ({ name: r }) => ({\n label: r,\n value: r,\n selected: t === r\n }));\n}\nvar O = /* @__PURE__ */ ((e) => (e.Primary = \"primary\", e.Secondary = \"secondary\", e.Expressive = \"expressive\", e.Destructive = \"destructive\", e.Text = \"text\", e.PrimaryWhite = \"primary-white\", e.SecondaryWhite = \"secondary-white\", e.ExpressiveWhite = \"expressive-white\", e.TertiaryPurple = \"tertiary-purple\", e))(O || {});\nfunction $(e, t) {\n return Object.values(e).find((i) => i.name === t);\n}\nfunction y(e, t) {\n return e.reduce(\n (r, i) => (r.push({\n disabled: !1,\n selected: !1,\n ...t(i)\n }), r),\n [\n {\n label: \"Choose...\",\n value: \"\",\n disabled: !0,\n selected: !0\n }\n ]\n );\n}\nfunction U(e) {\n return (t) => {\n t.key === \"Enter\" && e(t);\n };\n}\nfunction L(e, t = \"all\") {\n const { email: r, displayName: i } = e, n = i && i !== \"unknown\", o = !!r;\n switch (t) {\n case \"all\": {\n if (n && o)\n return `${i} (${r})`;\n if (n)\n return i;\n if (o)\n return r;\n }\n case \"single\": {\n if (n)\n return i;\n if (o)\n return r;\n }\n }\n return \"<UNKNOWN USER>\";\n}\nfunction j(...e) {\n return e.filter((t) => !!t).join(\" \");\n}\nexport {\n C as AllianceError,\n N as FrameworkErrorCodes,\n c as Texts,\n s as TranslationsKey,\n A as UtilitiesErrorCodes,\n O as VocaButtonVariant,\n j as classNames,\n k as createCapabilityPath,\n L as friendlyUserName,\n W as getCurrentLocationInfo,\n l as getRuntimeRootUrl,\n $ as getVocaIcon,\n I as isAllianceError,\n y as mapToVocaOptions,\n U as onEnter,\n P as setRuntimeRootUrl,\n R as vocaIconsToOptions\n};\n//# sourceMappingURL=index.js.map\n","import { queryObjects } from '@telia-ace/alliance-framework';\nimport {\n AllianceError,\n FrameworkErrorCodes,\n UtilitiesErrorCodes,\n isAllianceError,\n} from '@telia-ace/alliance-internal-client-utilities';\n\ntype CurrentUser = {\n permissions: { permission: { name: string; app: { name: string } } }[];\n type: 'super-admin' | 'user';\n};\n\nlet currentUser: CurrentUser;\n\nasync function getCurrentUser() {\n try {\n if (currentUser) {\n return currentUser;\n }\n\n const query = queryObjects<CurrentUser>('currentUser');\n currentUser = await query.resolve();\n\n return currentUser;\n } catch (err: any) {\n if (isAllianceError(err) && err.code === FrameworkErrorCodes.MissingManagedObjectProvider) {\n throw new AllianceError(UtilitiesErrorCodes.CurrentUserMissingProvider);\n } else if (err.message.includes('GraphQL Error (Code: 404)')) {\n throw new AllianceError(UtilitiesErrorCodes.CurrentUserGatewayNotStarted);\n } else if (err.message.includes('GraphQL Error (Code: 500)')) {\n throw new AllianceError(UtilitiesErrorCodes.CurrentUserMissingBackend);\n } else if (\n err.message.includes('GraphQL Error (Code: 200)') &&\n err.message.includes('Cannot return null for non-nullable field')\n ) {\n throw new AllianceError(UtilitiesErrorCodes.CurrentUserMissingInDatabase);\n } else {\n throw err;\n }\n }\n}\n\nexport async function isSystemAdmin() {\n const currentUser = await getCurrentUser();\n return !!currentUser && currentUser.type === 'super-admin';\n}\n\nexport async function hasPermission(appName: string, permissionName: string): Promise<boolean> {\n const currentUser = await getCurrentUser();\n return !!currentUser?.permissions.find(\n ({ permission }) => permission.app.name === appName && permission.name === permissionName\n );\n}\n"],"names":["F","o","t","r","se","R","s","u","p","l","d","n","G","ce","le","D","h","ue","pe","de","w","Y","ge","L","O","me","j","P","V","we","a","c","y","C","Ce","f","b","A","oe","S","M","re","K","ne","be","ve","ke","E","Se","Z","N","m","$","X","B","Ee","_","I","Ie","z","Je","v","g","i","currentUser","getCurrentUser","queryObjects","err","isAllianceError","FrameworkErr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AAA,IAAc,MAAMC;AACnB,SAAA,CAAC,EAACD,KAAAA,QAAAA,EAAa,YAAY;AAAA,IAC9B,CAAC,EAAE,YAAAY,EAAW,MAAMA,EAAW,IAAI,SAASF,KAAWE,EAAW,SAASD;AAAA;AAEnF;"}
package/package.json CHANGED
@@ -1,32 +1,22 @@
1
1
  {
2
2
  "name": "@telia-ace/alliance-utilities",
3
- "version": "1.0.11-next.0",
4
- "description": "Utilities used internally by ACE Alliance packages.",
3
+ "version": "1.0.11-next.1",
4
+ "description": "Utilities used by ACE Alliance apps.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Telia Company AB",
7
- "exports": {
8
- "./backend": {
9
- "types": "./backend/index.d.ts",
10
- "import": "./backend/index.js"
11
- },
12
- "./frontend": {
13
- "types": "./frontend/index.d.ts",
14
- "import": "./frontend/index.js"
15
- },
16
- "./prettier-config": "./prettier-config.json",
17
- "./typescript-config": "./typescript-config.json"
18
- },
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
19
9
  "type": "module",
20
10
  "files": [
21
- "typescript-config.json",
22
- "prettier-config.json",
23
11
  "LICENSE.txt",
24
12
  "README.md",
25
13
  "CHANGELOG.md",
26
- "chunks",
27
- "frontend",
28
- "backend"
14
+ "dist"
29
15
  ],
16
+ "dependencies": {
17
+ "@telia-ace/alliance-internal-client-utilities": "1.0.1-next.0",
18
+ "@telia-ace/alliance-framework": "1.0.11-next.2"
19
+ },
30
20
  "devDependencies": {
31
21
  "vite": "^4.3.5"
32
22
  },
@@ -35,8 +25,8 @@
35
25
  },
36
26
  "scripts": {
37
27
  "build:dev": "tsc && vite build --mode development",
38
- "build:prod": "rimraf backend frontend chunks && tsc && vite build --mode prod",
39
- "build:test": "rimraf backend frontend chunks && tsc && vite build --mode test",
28
+ "build:prod": "rimraf dist && tsc && vite build --mode prod",
29
+ "build:test": "rimraf dist && tsc && vite build --mode test",
40
30
  "build:docker": "vite build",
41
31
  "dev": "tsc && vite build --mode development --watch"
42
32
  }
@@ -1 +0,0 @@
1
- export * from './vite-plugin-css-import';
package/backend/index.js DELETED
@@ -1,31 +0,0 @@
1
- import { createWriteStream as d, createReadStream as S, rmSync as g, renameSync as w } from "node:fs";
2
- import { resolve as a, dirname as $, relative as v } from "node:path";
3
- import { pipeline as y } from "node:stream/promises";
4
- function I(n, c = !1) {
5
- return {
6
- name: "vite-plugin-css-import",
7
- apply: "build",
8
- enforce: "post",
9
- writeBundle: async (h, m) => {
10
- const s = Object.keys(m).filter((t) => t.endsWith(".css"));
11
- if (!s.length)
12
- return;
13
- const i = a(process.cwd(), `${n}-temp.js`), e = a(process.cwd(), `${n}.js`), p = s.reduce((t, o) => {
14
- if (c) {
15
- const f = $(e), u = v(f, o);
16
- return `${t}import "${u.replaceAll("\\", "/")}";
17
- `;
18
- }
19
- return `${t}import "./${o}";
20
- `;
21
- }, ""), r = d(i);
22
- r.write(p, "utf8");
23
- const l = S(e);
24
- await y(l, r), g(e, { force: !0 }), w(i, e), r.end();
25
- }
26
- };
27
- }
28
- export {
29
- I as viteCssImportPlugin
30
- };
31
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/backend/vite-plugin-css-import.ts"],"sourcesContent":["import { createReadStream, createWriteStream, renameSync, rmSync } from 'node:fs';\nimport { dirname, relative, resolve } from 'node:path';\nimport { pipeline } from 'node:stream/promises';\nimport type { PluginOption } from 'vite';\n\nexport function viteCssImportPlugin(\n outFilePath: string,\n relativePath: boolean = false\n): PluginOption {\n return {\n name: 'vite-plugin-css-import',\n apply: 'build',\n enforce: 'post',\n\n writeBundle: async (_, bundle) => {\n const cssFiles = Object.keys(bundle).filter((fileName) => fileName.endsWith('.css'));\n if (!cssFiles.length) {\n return;\n }\n\n const tempTargetFilePath = resolve(process.cwd(), `${outFilePath}-temp.js`);\n const targetFilePath = resolve(process.cwd(), `${outFilePath}.js`);\n\n const cssImportStatement = cssFiles.reduce((acc, cssFile) => {\n if (relativePath) {\n const targetDirname = dirname(targetFilePath);\n const relativePath = relative(targetDirname, cssFile);\n return `${acc}import \"${relativePath.replaceAll('\\\\', '/')}\";\\n`;\n }\n\n return `${acc}import \"./${cssFile}\";\\n`;\n }, '');\n\n const writeStream = createWriteStream(tempTargetFilePath);\n writeStream.write(cssImportStatement, 'utf8');\n const readStream = createReadStream(targetFilePath);\n\n await pipeline(readStream, writeStream);\n rmSync(targetFilePath, { force: true });\n renameSync(tempTargetFilePath, targetFilePath);\n writeStream.end();\n },\n };\n}\n"],"names":["viteCssImportPlugin","outFilePath","relativePath","_","bundle","cssFiles","fileName","tempTargetFilePath","resolve","targetFilePath","cssImportStatement","acc","cssFile","targetDirname","dirname","relative","writeStream","createWriteStream","readStream","createReadStream","pipeline","rmSync","renameSync"],"mappings":";;;AAKgB,SAAAA,EACZC,GACAC,IAAwB,IACZ;AACL,SAAA;AAAA,IACH,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,IAET,aAAa,OAAOC,GAAGC,MAAW;AACxB,YAAAC,IAAW,OAAO,KAAKD,CAAM,EAAE,OAAO,CAACE,MAAaA,EAAS,SAAS,MAAM,CAAC;AAC/E,UAAA,CAACD,EAAS;AACV;AAGJ,YAAME,IAAqBC,EAAQ,QAAQ,IAAI,GAAG,GAAGP,WAAqB,GACpEQ,IAAiBD,EAAQ,QAAQ,IAAI,GAAG,GAAGP,MAAgB,GAE3DS,IAAqBL,EAAS,OAAO,CAACM,GAAKC,MAAY;AACzD,YAAIV,GAAc;AACR,gBAAAW,IAAgBC,EAAQL,CAAc,GACtCP,IAAea,EAASF,GAAeD,CAAO;AACpD,iBAAO,GAAGD,YAAcT,EAAa,WAAW,MAAM,GAAG;AAAA;AAAA;AAG7D,eAAO,GAAGS,cAAgBC;AAAA;AAAA,SAC3B,EAAE,GAECI,IAAcC,EAAkBV,CAAkB;AAC5C,MAAAS,EAAA,MAAMN,GAAoB,MAAM;AACtC,YAAAQ,IAAaC,EAAiBV,CAAc;AAE5C,YAAAW,EAASF,GAAYF,CAAW,GACtCK,EAAOZ,GAAgB,EAAE,OAAO,GAAM,CAAA,GACtCa,EAAWf,GAAoBE,CAAc,GAC7CO,EAAY,IAAI;AAAA,IACpB;AAAA,EAAA;AAER;"}
@@ -1,2 +0,0 @@
1
- import type { PluginOption } from 'vite';
2
- export declare function viteCssImportPlugin(outFilePath: string, relativePath?: boolean): PluginOption;
@@ -1,17 +0,0 @@
1
- export declare enum AllianceErrorCodes {
2
- AlreadyInitialized = 1000,
3
- NoAppNameOrKey = 1001,
4
- MissingAppController = 1002,
5
- MissingCapabilityOnApp = 1003,
6
- MissingManagedObjectProvider = 1004,
7
- NoManifest = 1005,
8
- NoRootElement = 1006,
9
- NoView = 1007,
10
- CookieKeyNotDefined = 1008,
11
- CookieCategoryNotAllowed = 1009,
12
- StorageKeyNotDefined = 1010,
13
- StorageCategoryNotAllowed = 1011
14
- }
15
- export declare class AllianceError extends Error {
16
- constructor(code: AllianceErrorCodes, variables?: Record<string, string>);
17
- }
@@ -1,6 +0,0 @@
1
- export { AllianceError, AllianceErrorCodes } from './exceptions';
2
- export * from './routing';
3
- export { default as Texts, type TextArgs } from './texts';
4
- export { TranslationsKey } from './translations';
5
- export type * from './types';
6
- export * from './ui';