From 841c1b6419bf1498f6efc995a3883a5831305600 Mon Sep 17 00:00:00 2001 From: Rick Butterfield Date: Mon, 16 Dec 2024 16:12:28 +0000 Subject: [PATCH] v2.0.6 --- .../public/umbraco-package.json | 2 +- .../SustainabilityComposer.cs | 5 ++++- .../Umbraco.Community.Sustainability.csproj | 2 +- .../Umbraco.Community.Sustainability/index-BOus3T3d.js.map | 2 +- .../stats-workspace.element-Ug3H0Tey.js.map | 2 +- .../Umbraco.Community.Sustainability/umbraco-package.json | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Community.Sustainability.UI/public/umbraco-package.json b/src/Umbraco.Community.Sustainability.UI/public/umbraco-package.json index 787ab50..1fc0591 100644 --- a/src/Umbraco.Community.Sustainability.UI/public/umbraco-package.json +++ b/src/Umbraco.Community.Sustainability.UI/public/umbraco-package.json @@ -2,7 +2,7 @@ "$schema": "../umbraco-package-schema.json", "name": "Umbraco.Community.Sustainability", "id": "Umbraco.Community.Sustainability", - "version": "2.0.5", + "version": "2.0.6", "allowTelemetry": true, "extensions": [ { diff --git a/src/Umbraco.Community.Sustainability/SustainabilityComposer.cs b/src/Umbraco.Community.Sustainability/SustainabilityComposer.cs index fbeb8c1..dc3eb53 100644 --- a/src/Umbraco.Community.Sustainability/SustainabilityComposer.cs +++ b/src/Umbraco.Community.Sustainability/SustainabilityComposer.cs @@ -11,7 +11,10 @@ internal class SustainabilityComposer : IComposer { public void Compose(IUmbracoBuilder builder) { - var exitCode = Microsoft.Playwright.Program.Main(new[] { "install" }); + string value = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + Environment.SetEnvironmentVariable("PLAYWRIGHT_BROWSERS_PATH", $"{value}{Path.DirectorySeparatorChar}ms-playwright"); + + var exitCode = Microsoft.Playwright.Program.Main(new[] { "install", "chromium" }); if (exitCode != 0) { throw new Exception($"Playwright exited with code {exitCode}"); diff --git a/src/Umbraco.Community.Sustainability/Umbraco.Community.Sustainability.csproj b/src/Umbraco.Community.Sustainability/Umbraco.Community.Sustainability.csproj index e3347b1..0b5b863 100644 --- a/src/Umbraco.Community.Sustainability/Umbraco.Community.Sustainability.csproj +++ b/src/Umbraco.Community.Sustainability/Umbraco.Community.Sustainability.csproj @@ -16,7 +16,7 @@ Umbraco.Community.Sustainability True - 2.0.5 + 2.0.6 Umbraco Sustainability Community Team $([System.DateTime]::UtcNow.ToString(`yyyy`)) © Umbraco Sustainability Community Team diff --git a/src/Umbraco.Community.Sustainability/wwwroot/App_Plugins/Umbraco.Community.Sustainability/index-BOus3T3d.js.map b/src/Umbraco.Community.Sustainability/wwwroot/App_Plugins/Umbraco.Community.Sustainability/index-BOus3T3d.js.map index 997f539..5375a6a 100644 --- a/src/Umbraco.Community.Sustainability/wwwroot/App_Plugins/Umbraco.Community.Sustainability/index-BOus3T3d.js.map +++ b/src/Umbraco.Community.Sustainability/wwwroot/App_Plugins/Umbraco.Community.Sustainability/index-BOus3T3d.js.map @@ -1 +1 @@ -{"version":3,"file":"index-BOus3T3d.js","sources":["../../../../Umbraco.Community.Sustainability.UI/src/documents/manifest.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/overview/types.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/overview/menu-item/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/overview/workspace/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/overview/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/stats/types.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/stats/menu-item/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/stats/workspace/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/stats/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/api/core/ApiError.ts","../../../../Umbraco.Community.Sustainability.UI/src/api/core/CancelablePromise.ts","../../../../Umbraco.Community.Sustainability.UI/src/api/core/OpenAPI.ts","../../../../Umbraco.Community.Sustainability.UI/src/api/core/request.ts","../../../../Umbraco.Community.Sustainability.UI/src/api/services.gen.ts","../../../../Umbraco.Community.Sustainability.UI/src/repository/sources/sustainability.source.ts","../../../../Umbraco.Community.Sustainability.UI/src/repository/sustainability.repository.ts","../../../../Umbraco.Community.Sustainability.UI/src/context/sustainability.context.ts","../../../../Umbraco.Community.Sustainability.UI/src/components/carbon-rating.element.ts","../../../../Umbraco.Community.Sustainability.UI/src/index.ts"],"sourcesContent":["import { ManifestWorkspaceView } from \"@umbraco-cms/backoffice/extension-registry\";\r\n\r\nconst workspaceView: ManifestWorkspaceView = {\r\n type: 'workspaceView',\r\n alias: 'Umbraco.Community.Sustainability.Workspace',\r\n name: 'Sustainability Workspace',\r\n js: () => import('./views/sustainability-workspace-view.js'),\r\n weight: 10,\r\n meta: {\r\n icon: 'icon-eco',\r\n pathname: 'sustainability',\r\n label: 'Sustainability'\r\n },\r\n conditions: [\r\n {\r\n alias: 'Umb.Condition.WorkspaceAlias',\r\n match: 'Umb.Workspace.Document'\r\n },\r\n ]\r\n}\r\n\r\nexport const manifests = [workspaceView];\r\n","export const SUSTAINABILITY_OVERVIEW_ENTITY_TYPE = \"overview\";\r\nexport const SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE = \"overview-root\";\r\n\r\nexport type SustainabilityOverviewEntityType = typeof SUSTAINABILITY_OVERVIEW_ENTITY_TYPE;\r\nexport type SustainabilityOverviewRootEntityType = typeof SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE;","import type { ManifestMenuItem } from '@umbraco-cms/backoffice/extension-registry';\r\nimport { SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE } from '../types';\r\n\r\nconst menuItem: ManifestMenuItem = {\r\n type: 'menuItem',\r\n alias: 'Sustainability.MenuItem.Overview',\r\n name: 'Overview Menu Item',\r\n weight: 2000,\r\n meta: {\r\n label: 'Overview',\r\n icon: 'icon-eco',\r\n entityType: SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE,\r\n menus: [\"Umb.Menu.Sustainability\"],\r\n }\r\n};\r\n\r\nexport const manifests = [menuItem];","import type { ManifestWorkspace, ManifestWorkspaceContext } from \"@umbraco-cms/backoffice/extension-registry\";\r\nimport { SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE } from \"../types\";\r\n\r\nconst workspaceAlias = \"Sustainability.Workspace.Overview\";\r\nconst contextAlias = \"Sustainability.Workspace.Context\";\r\n\r\nconst workspace: ManifestWorkspace = {\r\n type: \"workspace\",\r\n alias: workspaceAlias,\r\n name: \"Overview Root Workspace\",\r\n js: () => import('./overview-workspace.element'),\r\n meta: {\r\n entityType: SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE\r\n },\r\n};\r\n\r\nconst context: ManifestWorkspaceContext = {\r\n type: 'workspaceContext',\r\n alias: contextAlias,\r\n name: 'Stats Workspace Context',\r\n js: () => import('../../../context/sustainability.context'),\r\n};\r\n\r\nexport const manifests = [\r\n context,\r\n workspace\r\n];\r\n","import { manifests as menuItems } from './menu-item/manifests';\r\nimport { manifests as workspaceManifests } from './workspace/manifests';\r\n\r\nexport const manifests = [\r\n ...workspaceManifests,\r\n ...menuItems\r\n]","export const SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE = \"stats-root\";\r\nexport const SUSTAINABILITY_STATS_ENTITY_TYPE = \"stats\";\r\n\r\nexport type SustainabilityStatsEntityType = typeof SUSTAINABILITY_STATS_ENTITY_TYPE;\r\nexport type SustainabilityStatsRootEntityType = typeof SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE;","import type { ManifestMenuItem } from '@umbraco-cms/backoffice/extension-registry';\r\nimport { SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE } from '../types';\r\n\r\nconst menuItem: ManifestMenuItem = {\r\n type: 'menuItem',\r\n alias: 'Sustainability.MenuItem.Stats',\r\n name: 'Stats Menu Item',\r\n weight: 1000,\r\n meta: {\r\n label: 'Stats',\r\n icon: 'icon-chart',\r\n entityType: SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE,\r\n menus: [\"Umb.Menu.Sustainability\"],\r\n }\r\n};\r\n\r\nexport const manifests = [menuItem];","import type { ManifestWorkspace } from \"@umbraco-cms/backoffice/extension-registry\";\r\nimport { SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE } from \"../types\";\r\n\r\nconst workspaceAlias = \"Sustainability.Workspace.Stats\";\r\n\r\nconst workspace: ManifestWorkspace = {\r\n type: \"workspace\",\r\n alias: workspaceAlias,\r\n name: \"Stats Root Workspace\",\r\n js: () => import('./stats-workspace.element'),\r\n meta: {\r\n entityType: SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE\r\n },\r\n};\r\n\r\nexport const manifests = [\r\n workspace\r\n];\r\n","import { manifests as menuItems } from './menu-item/manifests';\r\nimport { manifests as workspaceManifests } from './workspace/manifests';\r\n\r\nexport const manifests = [\r\n ...workspaceManifests,\r\n ...menuItems\r\n]","import { ManifestMenu, ManifestSection, ManifestSectionSidebarApp, ManifestSectionView } from \"@umbraco-cms/backoffice/extension-registry\";\r\n\r\nimport { manifests as overviewManifests } from './overview/manifests';\r\nimport { manifests as statsManifests } from './stats/manifests';\r\n\r\nconst sectionAlias = \"Umb.Section.Sustainability\";\r\nconst menuAlias = \"Umb.Menu.Sustainability\";\r\n\r\nconst section: ManifestSection = {\r\n type: \"section\",\r\n alias: sectionAlias,\r\n name: \"Sustainability Section\",\r\n weight: 0,\r\n meta: {\r\n label: \"Sustainability\",\r\n pathname: \"sustainability\",\r\n },\r\n conditions: [\r\n {\r\n alias: 'Umb.Condition.SectionUserPermission',\r\n match: sectionAlias\r\n }\r\n ]\r\n};\r\n\r\nconst sectionView: ManifestSectionView = {\r\n type: 'sectionView',\r\n alias: \"Umb.SectionView.Sustainability\",\r\n name: \"Sustainability Section View\",\r\n element: () => import('./sustainability-section-view.element'),\r\n meta: {\r\n label: 'Sustainability',\r\n icon: 'icon-eco',\r\n pathname: 'view'\r\n },\r\n conditions: [\r\n {\r\n alias: \"Umb.Condition.SectionAlias\",\r\n match: sectionAlias,\r\n },\r\n ]\r\n}\r\n\r\nconst menu: ManifestMenu = {\r\n type: \"menu\",\r\n alias: menuAlias,\r\n name: \"Sustainability Menu\",\r\n meta: {\r\n label: \"Sustainability\",\r\n },\r\n};\r\n\r\nconst menuSectionSidebarApp: ManifestSectionSidebarApp = {\r\n type: \"sectionSidebarApp\",\r\n kind: \"menu\",\r\n alias: \"Umb.SectionSidebar.Sustainability\",\r\n name: \"Sustainability Section Sidebar Menu\",\r\n weight: 200,\r\n meta: {\r\n label: \"Sustainability\",\r\n menu: menuAlias,\r\n },\r\n conditions: [\r\n {\r\n alias: \"Umb.Condition.SectionAlias\",\r\n match: sectionAlias,\r\n },\r\n ],\r\n};\r\n\r\nexport const manifests = [\r\n section,\r\n sectionView,\r\n menu,\r\n menuSectionSidebarApp,\r\n ...overviewManifests,\r\n ...statsManifests\r\n]\r\n","import type { ApiRequestOptions } from './ApiRequestOptions';\nimport type { ApiResult } from './ApiResult';\n\nexport class ApiError extends Error {\n\tpublic readonly url: string;\n\tpublic readonly status: number;\n\tpublic readonly statusText: string;\n\tpublic readonly body: unknown;\n\tpublic readonly request: ApiRequestOptions;\n\n\tconstructor(request: ApiRequestOptions, response: ApiResult, message: string) {\n\t\tsuper(message);\n\n\t\tthis.name = 'ApiError';\n\t\tthis.url = response.url;\n\t\tthis.status = response.status;\n\t\tthis.statusText = response.statusText;\n\t\tthis.body = response.body;\n\t\tthis.request = request;\n\t}\n}","export class CancelError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message);\n\t\tthis.name = 'CancelError';\n\t}\n\n\tpublic get isCancelled(): boolean {\n\t\treturn true;\n\t}\n}\n\nexport interface OnCancel {\n\treadonly isResolved: boolean;\n\treadonly isRejected: boolean;\n\treadonly isCancelled: boolean;\n\n\t(cancelHandler: () => void): void;\n}\n\nexport class CancelablePromise implements Promise {\n\tprivate _isResolved: boolean;\n\tprivate _isRejected: boolean;\n\tprivate _isCancelled: boolean;\n\treadonly cancelHandlers: (() => void)[];\n\treadonly promise: Promise;\n\tprivate _resolve?: (value: T | PromiseLike) => void;\n\tprivate _reject?: (reason?: unknown) => void;\n\n\tconstructor(\n\t\texecutor: (\n\t\t\tresolve: (value: T | PromiseLike) => void,\n\t\t\treject: (reason?: unknown) => void,\n\t\t\tonCancel: OnCancel\n\t\t) => void\n\t) {\n\t\tthis._isResolved = false;\n\t\tthis._isRejected = false;\n\t\tthis._isCancelled = false;\n\t\tthis.cancelHandlers = [];\n\t\tthis.promise = new Promise((resolve, reject) => {\n\t\t\tthis._resolve = resolve;\n\t\t\tthis._reject = reject;\n\n\t\t\tconst onResolve = (value: T | PromiseLike): void => {\n\t\t\t\tif (this._isResolved || this._isRejected || this._isCancelled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._isResolved = true;\n\t\t\t\tif (this._resolve) this._resolve(value);\n\t\t\t};\n\n\t\t\tconst onReject = (reason?: unknown): void => {\n\t\t\t\tif (this._isResolved || this._isRejected || this._isCancelled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._isRejected = true;\n\t\t\t\tif (this._reject) this._reject(reason);\n\t\t\t};\n\n\t\t\tconst onCancel = (cancelHandler: () => void): void => {\n\t\t\t\tif (this._isResolved || this._isRejected || this._isCancelled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.cancelHandlers.push(cancelHandler);\n\t\t\t};\n\n\t\t\tObject.defineProperty(onCancel, 'isResolved', {\n\t\t\t\tget: (): boolean => this._isResolved,\n\t\t\t});\n\n\t\t\tObject.defineProperty(onCancel, 'isRejected', {\n\t\t\t\tget: (): boolean => this._isRejected,\n\t\t\t});\n\n\t\t\tObject.defineProperty(onCancel, 'isCancelled', {\n\t\t\t\tget: (): boolean => this._isCancelled,\n\t\t\t});\n\n\t\t\treturn executor(onResolve, onReject, onCancel as OnCancel);\n\t\t});\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn \"Cancellable Promise\";\n\t}\n\n\tpublic then(\n\t\tonFulfilled?: ((value: T) => TResult1 | PromiseLike) | null,\n\t\tonRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null\n\t): Promise {\n\t\treturn this.promise.then(onFulfilled, onRejected);\n\t}\n\n\tpublic catch(\n\t\tonRejected?: ((reason: unknown) => TResult | PromiseLike) | null\n\t): Promise {\n\t\treturn this.promise.catch(onRejected);\n\t}\n\n\tpublic finally(onFinally?: (() => void) | null): Promise {\n\t\treturn this.promise.finally(onFinally);\n\t}\n\n\tpublic cancel(): void {\n\t\tif (this._isResolved || this._isRejected || this._isCancelled) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isCancelled = true;\n\t\tif (this.cancelHandlers.length) {\n\t\t\ttry {\n\t\t\t\tfor (const cancelHandler of this.cancelHandlers) {\n\t\t\t\t\tcancelHandler();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Cancellation threw an error', error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis.cancelHandlers.length = 0;\n\t\tif (this._reject) this._reject(new CancelError('Request aborted'));\n\t}\n\n\tpublic get isCancelled(): boolean {\n\t\treturn this._isCancelled;\n\t}\n}","import type { ApiRequestOptions } from './ApiRequestOptions';\n\ntype Headers = Record;\ntype Middleware = (value: T) => T | Promise;\ntype Resolver = (options: ApiRequestOptions) => Promise;\n\nexport class Interceptors {\n _fns: Middleware[];\n\n constructor() {\n this._fns = [];\n }\n\n eject(fn: Middleware): void {\n const index = this._fns.indexOf(fn);\n if (index !== -1) {\n this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];\n }\n }\n\n use(fn: Middleware): void {\n this._fns = [...this._fns, fn];\n }\n}\n\nexport type OpenAPIConfig = {\n\tBASE: string;\n\tCREDENTIALS: 'include' | 'omit' | 'same-origin';\n\tENCODE_PATH?: ((path: string) => string) | undefined;\n\tHEADERS?: Headers | Resolver | undefined;\n\tPASSWORD?: string | Resolver | undefined;\n\tTOKEN?: string | Resolver | undefined;\n\tUSERNAME?: string | Resolver | undefined;\n\tVERSION: string;\n\tWITH_CREDENTIALS: boolean;\n\tinterceptors: {\n\t\trequest: Interceptors;\n\t\tresponse: Interceptors;\n\t};\n};\n\nexport const OpenAPI: OpenAPIConfig = {\n\tBASE: '',\n\tCREDENTIALS: 'include',\n\tENCODE_PATH: undefined,\n\tHEADERS: undefined,\n\tPASSWORD: undefined,\n\tTOKEN: undefined,\n\tUSERNAME: undefined,\n\tVERSION: 'Latest',\n\tWITH_CREDENTIALS: false,\n\tinterceptors: {\n\t\trequest: new Interceptors(),\n\t\tresponse: new Interceptors(),\n\t},\n};","import { ApiError } from './ApiError';\nimport type { ApiRequestOptions } from './ApiRequestOptions';\nimport type { ApiResult } from './ApiResult';\nimport { CancelablePromise } from './CancelablePromise';\nimport type { OnCancel } from './CancelablePromise';\nimport type { OpenAPIConfig } from './OpenAPI';\n\nexport const isString = (value: unknown): value is string => {\n\treturn typeof value === 'string';\n};\n\nexport const isStringWithValue = (value: unknown): value is string => {\n\treturn isString(value) && value !== '';\n};\n\nexport const isBlob = (value: any): value is Blob => {\n\treturn value instanceof Blob;\n};\n\nexport const isFormData = (value: unknown): value is FormData => {\n\treturn value instanceof FormData;\n};\n\nexport const base64 = (str: string): string => {\n\ttry {\n\t\treturn btoa(str);\n\t} catch (err) {\n\t\t// @ts-ignore\n\t\treturn Buffer.from(str).toString('base64');\n\t}\n};\n\nexport const getQueryString = (params: Record): string => {\n\tconst qs: string[] = [];\n\n\tconst append = (key: string, value: unknown) => {\n\t\tqs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);\n\t};\n\n\tconst encodePair = (key: string, value: unknown) => {\n\t\tif (value === undefined || value === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (value instanceof Date) {\n\t\t\tappend(key, value.toISOString());\n\t\t} else if (Array.isArray(value)) {\n\t\t\tvalue.forEach(v => encodePair(key, v));\n\t\t} else if (typeof value === 'object') {\n\t\t\tObject.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v));\n\t\t} else {\n\t\t\tappend(key, value);\n\t\t}\n\t};\n\n\tObject.entries(params).forEach(([key, value]) => encodePair(key, value));\n\n\treturn qs.length ? `?${qs.join('&')}` : '';\n};\n\nconst getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {\n\tconst encoder = config.ENCODE_PATH || encodeURI;\n\n\tconst path = options.url\n\t\t.replace('{api-version}', config.VERSION)\n\t\t.replace(/{(.*?)}/g, (substring: string, group: string) => {\n\t\t\tif (options.path?.hasOwnProperty(group)) {\n\t\t\t\treturn encoder(String(options.path[group]));\n\t\t\t}\n\t\t\treturn substring;\n\t\t});\n\n\tconst url = config.BASE + path;\n\treturn options.query ? url + getQueryString(options.query) : url;\n};\n\nexport const getFormData = (options: ApiRequestOptions): FormData | undefined => {\n\tif (options.formData) {\n\t\tconst formData = new FormData();\n\n\t\tconst process = (key: string, value: unknown) => {\n\t\t\tif (isString(value) || isBlob(value)) {\n\t\t\t\tformData.append(key, value);\n\t\t\t} else {\n\t\t\t\tformData.append(key, JSON.stringify(value));\n\t\t\t}\n\t\t};\n\n\t\tObject.entries(options.formData)\n\t\t\t.filter(([, value]) => value !== undefined && value !== null)\n\t\t\t.forEach(([key, value]) => {\n\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\tvalue.forEach(v => process(key, v));\n\t\t\t\t} else {\n\t\t\t\t\tprocess(key, value);\n\t\t\t\t}\n\t\t\t});\n\n\t\treturn formData;\n\t}\n\treturn undefined;\n};\n\ntype Resolver = (options: ApiRequestOptions) => Promise;\n\nexport const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => {\n\tif (typeof resolver === 'function') {\n\t\treturn (resolver as Resolver)(options);\n\t}\n\treturn resolver;\n};\n\nexport const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => {\n\tconst [token, username, password, additionalHeaders] = await Promise.all([\n\t\t// @ts-ignore\n\t\tresolve(options, config.TOKEN),\n\t\t// @ts-ignore\n\t\tresolve(options, config.USERNAME),\n\t\t// @ts-ignore\n\t\tresolve(options, config.PASSWORD),\n\t\t// @ts-ignore\n\t\tresolve(options, config.HEADERS),\n\t]);\n\n\tconst headers = Object.entries({\n\t\tAccept: 'application/json',\n\t\t...additionalHeaders,\n\t\t...options.headers,\n\t})\n\t\t.filter(([, value]) => value !== undefined && value !== null)\n\t\t.reduce((headers, [key, value]) => ({\n\t\t\t...headers,\n\t\t\t[key]: String(value),\n\t\t}), {} as Record);\n\n\tif (isStringWithValue(token)) {\n\t\theaders['Authorization'] = `Bearer ${token}`;\n\t}\n\n\tif (isStringWithValue(username) && isStringWithValue(password)) {\n\t\tconst credentials = base64(`${username}:${password}`);\n\t\theaders['Authorization'] = `Basic ${credentials}`;\n\t}\n\n\tif (options.body !== undefined) {\n\t\tif (options.mediaType) {\n\t\t\theaders['Content-Type'] = options.mediaType;\n\t\t} else if (isBlob(options.body)) {\n\t\t\theaders['Content-Type'] = options.body.type || 'application/octet-stream';\n\t\t} else if (isString(options.body)) {\n\t\t\theaders['Content-Type'] = 'text/plain';\n\t\t} else if (!isFormData(options.body)) {\n\t\t\theaders['Content-Type'] = 'application/json';\n\t\t}\n\t}\n\n\treturn new Headers(headers);\n};\n\nexport const getRequestBody = (options: ApiRequestOptions): unknown => {\n\tif (options.body !== undefined) {\n\t\tif (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {\n\t\t\treturn JSON.stringify(options.body);\n\t\t} else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {\n\t\t\treturn options.body;\n\t\t} else {\n\t\t\treturn JSON.stringify(options.body);\n\t\t}\n\t}\n\treturn undefined;\n};\n\nexport const sendRequest = async (\n\tconfig: OpenAPIConfig,\n\toptions: ApiRequestOptions,\n\turl: string,\n\tbody: any,\n\tformData: FormData | undefined,\n\theaders: Headers,\n\tonCancel: OnCancel\n): Promise => {\n\tconst controller = new AbortController();\n\n\tlet request: RequestInit = {\n\t\theaders,\n\t\tbody: body ?? formData,\n\t\tmethod: options.method,\n\t\tsignal: controller.signal,\n\t};\n\n\tif (config.WITH_CREDENTIALS) {\n\t\trequest.credentials = config.CREDENTIALS;\n\t}\n\n\tfor (const fn of config.interceptors.request._fns) {\n\t\trequest = await fn(request);\n\t}\n\n\tonCancel(() => controller.abort());\n\n\treturn await fetch(url, request);\n};\n\nexport const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => {\n\tif (responseHeader) {\n\t\tconst content = response.headers.get(responseHeader);\n\t\tif (isString(content)) {\n\t\t\treturn content;\n\t\t}\n\t}\n\treturn undefined;\n};\n\nexport const getResponseBody = async (response: Response): Promise => {\n\tif (response.status !== 204) {\n\t\ttry {\n\t\t\tconst contentType = response.headers.get('Content-Type');\n\t\t\tif (contentType) {\n\t\t\t\tconst binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/'];\n\t\t\t\tif (contentType.includes('application/json') || contentType.includes('+json')) {\n\t\t\t\t\treturn await response.json();\n\t\t\t\t} else if (binaryTypes.some(type => contentType.includes(type))) {\n\t\t\t\t\treturn await response.blob();\n\t\t\t\t} else if (contentType.includes('multipart/form-data')) {\n\t\t\t\t\treturn await response.formData();\n\t\t\t\t} else if (contentType.includes('text/')) {\n\t\t\t\t\treturn await response.text();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}\n\treturn undefined;\n};\n\nexport const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {\n\tconst errors: Record = {\n\t\t400: 'Bad Request',\n\t\t401: 'Unauthorized',\n\t\t402: 'Payment Required',\n\t\t403: 'Forbidden',\n\t\t404: 'Not Found',\n\t\t405: 'Method Not Allowed',\n\t\t406: 'Not Acceptable',\n\t\t407: 'Proxy Authentication Required',\n\t\t408: 'Request Timeout',\n\t\t409: 'Conflict',\n\t\t410: 'Gone',\n\t\t411: 'Length Required',\n\t\t412: 'Precondition Failed',\n\t\t413: 'Payload Too Large',\n\t\t414: 'URI Too Long',\n\t\t415: 'Unsupported Media Type',\n\t\t416: 'Range Not Satisfiable',\n\t\t417: 'Expectation Failed',\n\t\t418: 'Im a teapot',\n\t\t421: 'Misdirected Request',\n\t\t422: 'Unprocessable Content',\n\t\t423: 'Locked',\n\t\t424: 'Failed Dependency',\n\t\t425: 'Too Early',\n\t\t426: 'Upgrade Required',\n\t\t428: 'Precondition Required',\n\t\t429: 'Too Many Requests',\n\t\t431: 'Request Header Fields Too Large',\n\t\t451: 'Unavailable For Legal Reasons',\n\t\t500: 'Internal Server Error',\n\t\t501: 'Not Implemented',\n\t\t502: 'Bad Gateway',\n\t\t503: 'Service Unavailable',\n\t\t504: 'Gateway Timeout',\n\t\t505: 'HTTP Version Not Supported',\n\t\t506: 'Variant Also Negotiates',\n\t\t507: 'Insufficient Storage',\n\t\t508: 'Loop Detected',\n\t\t510: 'Not Extended',\n\t\t511: 'Network Authentication Required',\n\t\t...options.errors,\n\t}\n\n\tconst error = errors[result.status];\n\tif (error) {\n\t\tthrow new ApiError(options, result, error);\n\t}\n\n\tif (!result.ok) {\n\t\tconst errorStatus = result.status ?? 'unknown';\n\t\tconst errorStatusText = result.statusText ?? 'unknown';\n\t\tconst errorBody = (() => {\n\t\t\ttry {\n\t\t\t\treturn JSON.stringify(result.body, null, 2);\n\t\t\t} catch (e) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t})();\n\n\t\tthrow new ApiError(options, result,\n\t\t\t`Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`\n\t\t);\n\t}\n};\n\n/**\n * Request method\n * @param config The OpenAPI configuration object\n * @param options The request options from the service\n * @returns CancelablePromise\n * @throws ApiError\n */\nexport const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => {\n\treturn new CancelablePromise(async (resolve, reject, onCancel) => {\n\t\ttry {\n\t\t\tconst url = getUrl(config, options);\n\t\t\tconst formData = getFormData(options);\n\t\t\tconst body = getRequestBody(options);\n\t\t\tconst headers = await getHeaders(config, options);\n\n\t\t\tif (!onCancel.isCancelled) {\n\t\t\t\tlet response = await sendRequest(config, options, url, body, formData, headers, onCancel);\n\n\t\t\t\tfor (const fn of config.interceptors.response._fns) {\n\t\t\t\t\tresponse = await fn(response);\n\t\t\t\t}\n\n\t\t\t\tconst responseBody = await getResponseBody(response);\n\t\t\t\tconst responseHeader = getResponseHeader(response, options.responseHeader);\n\n\t\t\t\tlet transformedBody = responseBody;\n\t\t\t\tif (options.responseTransformer && response.ok) {\n\t\t\t\t\ttransformedBody = await options.responseTransformer(responseBody)\n\t\t\t\t}\n\n\t\t\t\tconst result: ApiResult = {\n\t\t\t\t\turl,\n\t\t\t\t\tok: response.ok,\n\t\t\t\t\tstatus: response.status,\n\t\t\t\t\tstatusText: response.statusText,\n\t\t\t\t\tbody: responseHeader ?? transformedBody,\n\t\t\t\t};\n\n\t\t\t\tcatchErrorCodes(options, result);\n\n\t\t\t\tresolve(result.body);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treject(error);\n\t\t}\n\t});\n};","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { CancelablePromise } from './core/CancelablePromise';\nimport { OpenAPI } from './core/OpenAPI';\nimport { request as __request } from './core/request';\nimport type { CheckPageData, CheckPageResponse, GetAverageDataResponse, GetOverviewDataData, GetOverviewDataResponse, GetPageDataData, GetPageDataResponse, SavePageDataData, SavePageDataResponse } from './types.gen';\n\nexport class SustainabilityService {\n /**\n * @param data The data for the request.\n * @param data.pageGuid\n * @returns unknown OK\n * @throws ApiError\n */\n public static checkPage(data: CheckPageData = {}): CancelablePromise {\n return __request(OpenAPI, {\n method: 'GET',\n url: '/umbraco/sustainability/api/v1/checkPage',\n query: {\n pageGuid: data.pageGuid\n }\n });\n }\n \n /**\n * @returns unknown OK\n * @throws ApiError\n */\n public static getAverageData(): CancelablePromise {\n return __request(OpenAPI, {\n method: 'GET',\n url: '/umbraco/sustainability/api/v1/getAverageData'\n });\n }\n \n /**\n * @param data The data for the request.\n * @param data.pageNumber\n * @param data.pageSize\n * @param data.orderBy\n * @param data.direction\n * @returns unknown OK\n * @throws ApiError\n */\n public static getOverviewData(data: GetOverviewDataData = {}): CancelablePromise {\n return __request(OpenAPI, {\n method: 'GET',\n url: '/umbraco/sustainability/api/v1/getOverviewData',\n query: {\n pageNumber: data.pageNumber,\n pageSize: data.pageSize,\n orderBy: data.orderBy,\n direction: data.direction\n }\n });\n }\n \n /**\n * @param data The data for the request.\n * @param data.pageGuid\n * @returns unknown OK\n * @throws ApiError\n */\n public static getPageData(data: GetPageDataData = {}): CancelablePromise {\n return __request(OpenAPI, {\n method: 'GET',\n url: '/umbraco/sustainability/api/v1/getPageData',\n query: {\n pageGuid: data.pageGuid\n }\n });\n }\n \n /**\n * @param data The data for the request.\n * @param data.pageGuid\n * @param data.requestBody\n * @returns boolean OK\n * @throws ApiError\n */\n public static savePageData(data: SavePageDataData = {}): CancelablePromise {\n return __request(OpenAPI, {\n method: 'POST',\n url: '/umbraco/sustainability/api/v1/savePageData',\n query: {\n pageGuid: data.pageGuid\n },\n body: data.requestBody,\n mediaType: 'application/json'\n });\n }\n \n}","import { UmbControllerHost } from \"@umbraco-cms/backoffice/controller-api\";\r\nimport { UmbDataSourceResponse } from \"@umbraco-cms/backoffice/repository\";\r\nimport { tryExecuteAndNotify } from '@umbraco-cms/backoffice/resources';\r\nimport { SustainabilityService, type SustainabilityResponse, DirectionModel, PagedResultPageMetricModel, AveragePageMetrics } from \"../../api\";\r\n\r\nexport interface SustainabilityDataSource {\r\n\r\n checkPage(pageGuid: string): Promise>;\r\n getPageData(pageGuid: string): Promise>;\r\n savePageData(pageGuid: string, sustainabilityResponse: SustainabilityResponse): Promise>;\r\n getOverviewData(direction: DirectionModel, orderBy: string, pageNumber: number, pageSize: number): Promise>;\r\n getAverageData(): Promise>;\r\n\r\n}\r\n\r\nexport class SustainabilityManagementDataSource implements SustainabilityDataSource {\r\n\r\n #host: UmbControllerHost;\r\n\r\n constructor(host: UmbControllerHost) {\r\n this.#host = host;\r\n }\r\n\r\n async checkPage(pageGuid: string): Promise> {\r\n return await tryExecuteAndNotify(this.#host, SustainabilityService.checkPage({ pageGuid: pageGuid }));\r\n }\r\n\r\n async getPageData(pageGuid: string): Promise> {\r\n return await tryExecuteAndNotify(this.#host, SustainabilityService.getPageData({ pageGuid: pageGuid }));\r\n }\r\n\r\n async savePageData(pageGuid: string, sustainabilityResponse: SustainabilityResponse): Promise> {\r\n return await tryExecuteAndNotify(this.#host, SustainabilityService.savePageData({\r\n pageGuid: pageGuid,\r\n requestBody: sustainabilityResponse\r\n }))\r\n }\r\n\r\n async getOverviewData(direction: DirectionModel, orderBy: string, pageNumber: number, pageSize: number): Promise> {\r\n return await tryExecuteAndNotify(this.#host, SustainabilityService.getOverviewData({ direction, orderBy, pageNumber, pageSize }));\r\n }\r\n\r\n async getAverageData(): Promise> {\r\n return await tryExecuteAndNotify(this.#host, SustainabilityService.getAverageData());\r\n }\r\n\r\n}\r\n","import { UmbControllerBase } from \"@umbraco-cms/backoffice/class-api\";\r\nimport { UmbControllerHost } from \"@umbraco-cms/backoffice/controller-api\";\r\nimport { SustainabilityManagementDataSource } from \"./sources/sustainability.source\";\r\nimport { DirectionModel, SustainabilityResponse } from \"../api\";\r\n\r\nexport class SustainabilityRepository extends UmbControllerBase {\r\n #sustainabilityDataSource: SustainabilityManagementDataSource;\r\n\r\n constructor(host: UmbControllerHost) {\r\n super(host);\r\n this.#sustainabilityDataSource = new SustainabilityManagementDataSource(this);\r\n }\r\n\r\n async checkPage(pageGuid: string) {\r\n return await this.#sustainabilityDataSource.checkPage(pageGuid);\r\n }\r\n\r\n async getPageData(pageGuid: string) {\r\n return await this.#sustainabilityDataSource.getPageData(pageGuid);\r\n }\r\n\r\n async savePageData(pageGuid: string, sustainabilityResponse: SustainabilityResponse) {\r\n return await this.#sustainabilityDataSource.savePageData(pageGuid, sustainabilityResponse);\r\n }\r\n\r\n async getOverviewData(direction: DirectionModel, orderBy: string, pageNumber: number, pageSize: number) {\r\n return await this.#sustainabilityDataSource.getOverviewData(direction, orderBy, pageNumber, pageSize);\r\n }\r\n\r\n async getAverageData() {\r\n return await this.#sustainabilityDataSource.getAverageData();\r\n }\r\n}\r\n","import { AveragePageMetrics, DirectionModel, PagedResultPageMetricModel, SustainabilityResponse } from \"../api\";\r\nimport { SustainabilityRepository } from \"../repository/sustainability.repository\";\r\nimport { UmbControllerBase } from \"@umbraco-cms/backoffice/class-api\";\r\nimport { UmbContextToken } from \"@umbraco-cms/backoffice/context-api\";\r\nimport { UmbControllerHost } from \"@umbraco-cms/backoffice/controller-api\";\r\nimport { UmbObjectState } from \"@umbraco-cms/backoffice/observable-api\";\r\n\r\nexport class SustainabilityContext extends UmbControllerBase {\r\n \r\n #repository: SustainabilityRepository;\r\n\r\n #overviewData = new UmbObjectState(undefined);\r\n public readonly overviewData = this.#overviewData.asObservable();\r\n\r\n #averageData = new UmbObjectState(undefined);\r\n public readonly averageData = this.#averageData.asObservable();\r\n\r\n constructor(host: UmbControllerHost) {\r\n super(host);\r\n this.#repository = new SustainabilityRepository(this);\r\n }\r\n\r\n async checkPage(pageGuid: string, initialLoad: boolean = true) {\r\n const { data } = await this.#repository.checkPage(pageGuid);\r\n if (data) {\r\n if (!initialLoad) {\r\n await this.savePageData(pageGuid, data);\r\n }\r\n\r\n return data;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n async getPageData(pageGuid: string) {\r\n const { data } = await this.#repository.getPageData(pageGuid);\r\n if (data) {\r\n return data;\r\n }\r\n\r\n return undefined;\r\n }\r\n \r\n async savePageData(pageGuid: string, sustainabilityResponse: SustainabilityResponse) {\r\n const saved = await this.#repository.savePageData(pageGuid, sustainabilityResponse);\r\n return saved;\r\n }\r\n\r\n async getOverviewData(direction: DirectionModel, orderBy: string, pageNumber: number, pageSize: number) {\r\n const { data } = await this.#repository.getOverviewData(direction, orderBy, pageNumber, pageSize);\r\n if (data) {\r\n this.#overviewData.setValue(data);\r\n }\r\n }\r\n\r\n async getAverageData() {\r\n const { data } = await this.#repository.getAverageData();\r\n if (data) {\r\n this.#averageData.setValue(data);\r\n }\r\n }\r\n \r\n}\r\n\r\nexport default SustainabilityContext;\r\n\r\nexport const SUSTAINABILITY_CONTEXT =\r\n new UmbContextToken('SustainabilityContext');\r\n","import { UmbElementMixin } from \"@umbraco-cms/backoffice/element-api\"\r\nimport { LitElement, customElement, html, property } from \"@umbraco-cms/backoffice/external/lit\";\r\nimport { UUIInterfaceColor } from \"@umbraco-cms/backoffice/external/uui\";\r\n\r\nconst elementName = \"sustainability-carbon-rating\";\r\n\r\n@customElement(elementName)\r\nexport class SustainabilityCarbonRating extends UmbElementMixin(LitElement) {\r\n\r\n @property({type: String}) \r\n carbonRating: string | null | undefined = undefined;\r\n\r\n _getColour(carbonRating: string | null | undefined): UUIInterfaceColor {\r\n if (carbonRating == \"E\" || carbonRating == \"F\") {\r\n return \"danger\";\r\n }\r\n else if (carbonRating == \"D\") {\r\n return \"warning\";\r\n }\r\n else return \"positive\";\r\n }\r\n\r\n render() {\r\n return html`\r\n \r\n ${this.carbonRating}\r\n \r\n `\r\n }\r\n}\r\n\r\nexport default SustainabilityCarbonRating;\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n [elementName]: SustainabilityCarbonRating;\r\n }\r\n}\r\n","import { UmbEntryPointOnInit } from '@umbraco-cms/backoffice/extension-api';\r\n\r\nimport { manifests as documentManifests } from './documents/manifest.ts';\r\nimport { manifests as sectionManifests } from './section/manifests.ts';\r\n\r\nimport { UMB_AUTH_CONTEXT } from '@umbraco-cms/backoffice/auth';\r\nimport SustainabilityContext, { SUSTAINABILITY_CONTEXT } from './context/sustainability.context.ts';\r\nimport { OpenAPI } from './api/index.ts';\r\n\r\nexport * from './components/index';\r\nexport * from './repository/index';\r\n\r\nexport const onInit: UmbEntryPointOnInit = (host, extensionRegistry) => {\r\n\r\n extensionRegistry.registerMany([\r\n ...documentManifests,\r\n ...sectionManifests\r\n ]);\r\n\r\n host.consumeContext(UMB_AUTH_CONTEXT, async (auth) => {\r\n if (!auth) return;\r\n\r\n const umbOpenApi = auth.getOpenApiConfiguration();\r\n OpenAPI.BASE = umbOpenApi.base;\r\n OpenAPI.TOKEN = umbOpenApi.token;\r\n OpenAPI.WITH_CREDENTIALS = umbOpenApi.withCredentials;\r\n OpenAPI.CREDENTIALS = umbOpenApi.credentials;\r\n });\r\n\r\n host.provideContext(SUSTAINABILITY_CONTEXT, new SustainabilityContext(host));\r\n};\r\n"],"names":["workspaceView","manifests","SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE","menuItem","workspaceAlias","contextAlias","workspace","context","sustainability_context","workspaceManifests","menuItems","SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE","sectionAlias","menuAlias","section","sectionView","menu","menuSectionSidebarApp","overviewManifests","statsManifests","ApiError","request","response","message","CancelError","CancelablePromise","executor","resolve","reject","onResolve","value","onReject","reason","onCancel","cancelHandler","onFulfilled","onRejected","onFinally","error","Interceptors","fn","index","OpenAPI","isString","isStringWithValue","isBlob","isFormData","base64","str","getQueryString","params","qs","append","key","encodePair","v","k","getUrl","config","options","encoder","path","substring","group","_a","url","getFormData","formData","process","resolver","getHeaders","token","username","password","additionalHeaders","headers","credentials","getRequestBody","_b","sendRequest","body","controller","getResponseHeader","responseHeader","content","getResponseBody","contentType","binaryTypes","type","catchErrorCodes","result","errorStatus","errorStatusText","errorBody","responseBody","transformedBody","SustainabilityService","data","__request","SustainabilityManagementDataSource","host","__privateAdd","_host","__privateSet","pageGuid","tryExecuteAndNotify","__privateGet","sustainabilityResponse","direction","orderBy","pageNumber","pageSize","SustainabilityRepository","UmbControllerBase","_sustainabilityDataSource","SustainabilityContext","_repository","_overviewData","_averageData","UmbObjectState","initialLoad","SUSTAINABILITY_CONTEXT","UmbContextToken","elementName","SustainabilityCarbonRating","UmbElementMixin","LitElement","carbonRating","html","__decorateClass","property","customElement","onInit","extensionRegistry","documentManifests","sectionManifests","UMB_AUTH_CONTEXT","auth","umbOpenApi"],"mappings":";;;;;;;;;;;;;;;;AAEA,MAAMA,IAAuC;AAAA,EAC3C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,IAAI,MAAM,OAAO,6CAA0C;AAAA,EAC3D,QAAQ;AAAA,EACR,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AAAA,EACA,YAAY;AAAA,IACV;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,IACT;AAAA,EACF;AACF,GAEaC,IAAY,CAACD,CAAa,GCpB1BE,IAA2C,iBCElDC,KAA6B;AAAA,EACjC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,YAAYD;AAAA,IACZ,OAAO,CAAC,yBAAyB;AAAA,EACnC;AACF,GAEaD,KAAY,CAACE,EAAQ,GCb5BC,KAAiB,qCACjBC,KAAe,oCAEfC,KAA+B;AAAA,EACnC,MAAM;AAAA,EACN,OAAOF;AAAAA,EACP,MAAM;AAAA,EACN,IAAI,MAAM,OAAO,0CAA8B;AAAA,EAC/C,MAAM;AAAA,IACJ,YAAYF;AAAA,EACd;AACF,GAEMK,KAAoC;AAAA,EACxC,MAAM;AAAA,EACN,OAAOF;AAAA,EACP,MAAM;AAAA,EACN,IAAI,MAAM,QAAgD,QAAA,EAAA,KAAA,MAAAG,EAAA;AAC5D,GAEaP,KAAY;AAAA,EACvBM;AAAA,EACAD;AACF,GCvBaL,KAAY;AAAA,EACvB,GAAGQ;AAAAA,EACH,GAAGC;AACL,GCNaC,IAAwC,cCG/CR,KAA6B;AAAA,EACjC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,MAAM;AAAA,IACJ,OAAO;AAA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AACA;AAAM;AAEL,UAAAC,IAAaD,EAAK;AACxB,IAAA/F,EAAQ,OAAOgG,EAAW,MAC1BhG,EAAQ,QAAQgG,EAAW,OAC3BhG,EAAQ,mBAAmBgG,EAAW,iBACtChG,EAAQ,cAAcgG,EAAW;AAAA,EAAA,CAClC,GAEDtC,EAAK,eAAeqB,GAAwB,IAAIN,EAAsBf,CAAI,CAAC;AAC7E;"} \ No newline at end of file +{"version":3,"file":"index-BOus3T3d.js","sources":["../../../../Umbraco.Community.Sustainability.UI/src/documents/manifest.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/overview/types.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/overview/menu-item/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/overview/workspace/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/overview/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/stats/types.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/stats/menu-item/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/stats/workspace/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/stats/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/manifests.ts","../../../../Umbraco.Community.Sustainability.UI/src/api/core/ApiError.ts","../../../../Umbraco.Community.Sustainability.UI/src/api/core/CancelablePromise.ts","../../../../Umbraco.Community.Sustainability.UI/src/api/core/OpenAPI.ts","../../../../Umbraco.Community.Sustainability.UI/src/api/core/request.ts","../../../../Umbraco.Community.Sustainability.UI/src/api/services.gen.ts","../../../../Umbraco.Community.Sustainability.UI/src/repository/sources/sustainability.source.ts","../../../../Umbraco.Community.Sustainability.UI/src/repository/sustainability.repository.ts","../../../../Umbraco.Community.Sustainability.UI/src/context/sustainability.context.ts","../../../../Umbraco.Community.Sustainability.UI/src/components/carbon-rating.element.ts","../../../../Umbraco.Community.Sustainability.UI/src/index.ts"],"sourcesContent":["import { ManifestWorkspaceView } from \"@umbraco-cms/backoffice/extension-registry\";\r\n\r\nconst workspaceView: ManifestWorkspaceView = {\r\n type: 'workspaceView',\r\n alias: 'Umbraco.Community.Sustainability.Workspace',\r\n name: 'Sustainability Workspace',\r\n js: () => import('./views/sustainability-workspace-view.js'),\r\n weight: 10,\r\n meta: {\r\n icon: 'icon-eco',\r\n pathname: 'sustainability',\r\n label: 'Sustainability'\r\n },\r\n conditions: [\r\n {\r\n alias: 'Umb.Condition.WorkspaceAlias',\r\n match: 'Umb.Workspace.Document'\r\n },\r\n ]\r\n}\r\n\r\nexport const manifests = [workspaceView];\r\n","export const SUSTAINABILITY_OVERVIEW_ENTITY_TYPE = \"overview\";\r\nexport const SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE = \"overview-root\";\r\n\r\nexport type SustainabilityOverviewEntityType = typeof SUSTAINABILITY_OVERVIEW_ENTITY_TYPE;\r\nexport type SustainabilityOverviewRootEntityType = typeof SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE;","import type { ManifestMenuItem } from '@umbraco-cms/backoffice/extension-registry';\r\nimport { SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE } from '../types';\r\n\r\nconst menuItem: ManifestMenuItem = {\r\n type: 'menuItem',\r\n alias: 'Sustainability.MenuItem.Overview',\r\n name: 'Overview Menu Item',\r\n weight: 2000,\r\n meta: {\r\n label: 'Overview',\r\n icon: 'icon-eco',\r\n entityType: SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE,\r\n menus: [\"Umb.Menu.Sustainability\"],\r\n }\r\n};\r\n\r\nexport const manifests = [menuItem];","import type { ManifestWorkspace, ManifestWorkspaceContext } from \"@umbraco-cms/backoffice/extension-registry\";\r\nimport { SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE } from \"../types\";\r\n\r\nconst workspaceAlias = \"Sustainability.Workspace.Overview\";\r\nconst contextAlias = \"Sustainability.Workspace.Context\";\r\n\r\nconst workspace: ManifestWorkspace = {\r\n type: \"workspace\",\r\n alias: workspaceAlias,\r\n name: \"Overview Root Workspace\",\r\n js: () => import('./overview-workspace.element'),\r\n meta: {\r\n entityType: SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE\r\n },\r\n};\r\n\r\nconst context: ManifestWorkspaceContext = {\r\n type: 'workspaceContext',\r\n alias: contextAlias,\r\n name: 'Stats Workspace Context',\r\n js: () => import('../../../context/sustainability.context'),\r\n};\r\n\r\nexport const manifests = [\r\n context,\r\n workspace\r\n];\r\n","import { manifests as menuItems } from './menu-item/manifests';\r\nimport { manifests as workspaceManifests } from './workspace/manifests';\r\n\r\nexport const manifests = [\r\n ...workspaceManifests,\r\n ...menuItems\r\n]","export const SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE = \"stats-root\";\r\nexport const SUSTAINABILITY_STATS_ENTITY_TYPE = \"stats\";\r\n\r\nexport type SustainabilityStatsEntityType = typeof SUSTAINABILITY_STATS_ENTITY_TYPE;\r\nexport type SustainabilityStatsRootEntityType = typeof SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE;","import type { ManifestMenuItem } from '@umbraco-cms/backoffice/extension-registry';\r\nimport { SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE } from '../types';\r\n\r\nconst menuItem: ManifestMenuItem = {\r\n type: 'menuItem',\r\n alias: 'Sustainability.MenuItem.Stats',\r\n name: 'Stats Menu Item',\r\n weight: 1000,\r\n meta: {\r\n label: 'Stats',\r\n icon: 'icon-chart',\r\n entityType: SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE,\r\n menus: [\"Umb.Menu.Sustainability\"],\r\n }\r\n};\r\n\r\nexport const manifests = [menuItem];","import type { ManifestWorkspace } from \"@umbraco-cms/backoffice/extension-registry\";\r\nimport { SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE } from \"../types\";\r\n\r\nconst workspaceAlias = \"Sustainability.Workspace.Stats\";\r\n\r\nconst workspace: ManifestWorkspace = {\r\n type: \"workspace\",\r\n alias: workspaceAlias,\r\n name: \"Stats Root Workspace\",\r\n js: () => import('./stats-workspace.element'),\r\n meta: {\r\n entityType: SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE\r\n },\r\n};\r\n\r\nexport const manifests = [\r\n workspace\r\n];\r\n","import { manifests as menuItems } from './menu-item/manifests';\r\nimport { manifests as workspaceManifests } from './workspace/manifests';\r\n\r\nexport const manifests = [\r\n ...workspaceManifests,\r\n ...menuItems\r\n]","import { ManifestMenu, ManifestSection, ManifestSectionSidebarApp, ManifestSectionView } from \"@umbraco-cms/backoffice/extension-registry\";\r\n\r\nimport { manifests as overviewManifests } from './overview/manifests';\r\nimport { manifests as statsManifests } from './stats/manifests';\r\n\r\nconst sectionAlias = \"Umb.Section.Sustainability\";\r\nconst menuAlias = \"Umb.Menu.Sustainability\";\r\n\r\nconst section: ManifestSection = {\r\n type: \"section\",\r\n alias: sectionAlias,\r\n name: \"Sustainability Section\",\r\n weight: 0,\r\n meta: {\r\n label: \"Sustainability\",\r\n pathname: \"sustainability\",\r\n },\r\n conditions: [\r\n {\r\n alias: 'Umb.Condition.SectionUserPermission',\r\n match: sectionAlias\r\n }\r\n ]\r\n};\r\n\r\nconst sectionView: ManifestSectionView = {\r\n type: 'sectionView',\r\n alias: \"Umb.SectionView.Sustainability\",\r\n name: \"Sustainability Section View\",\r\n element: () => import('./sustainability-section-view.element'),\r\n meta: {\r\n label: 'Sustainability',\r\n icon: 'icon-eco',\r\n pathname: 'view'\r\n },\r\n conditions: [\r\n {\r\n alias: \"Umb.Condition.SectionAlias\",\r\n match: sectionAlias,\r\n },\r\n ]\r\n}\r\n\r\nconst menu: ManifestMenu = {\r\n type: \"menu\",\r\n alias: menuAlias,\r\n name: \"Sustainability Menu\",\r\n meta: {\r\n label: \"Sustainability\",\r\n },\r\n};\r\n\r\nconst menuSectionSidebarApp: ManifestSectionSidebarApp = {\r\n type: \"sectionSidebarApp\",\r\n kind: \"menu\",\r\n alias: \"Umb.SectionSidebar.Sustainability\",\r\n name: \"Sustainability Section Sidebar Menu\",\r\n weight: 200,\r\n meta: {\r\n label: \"Sustainability\",\r\n menu: menuAlias,\r\n },\r\n conditions: [\r\n {\r\n alias: \"Umb.Condition.SectionAlias\",\r\n match: sectionAlias,\r\n },\r\n ],\r\n};\r\n\r\nexport const manifests = [\r\n section,\r\n sectionView,\r\n menu,\r\n menuSectionSidebarApp,\r\n ...overviewManifests,\r\n ...statsManifests\r\n]\r\n","import type { ApiRequestOptions } from './ApiRequestOptions';\r\nimport type { ApiResult } from './ApiResult';\r\n\r\nexport class ApiError extends Error {\r\n\tpublic readonly url: string;\r\n\tpublic readonly status: number;\r\n\tpublic readonly statusText: string;\r\n\tpublic readonly body: unknown;\r\n\tpublic readonly request: ApiRequestOptions;\r\n\r\n\tconstructor(request: ApiRequestOptions, response: ApiResult, message: string) {\r\n\t\tsuper(message);\r\n\r\n\t\tthis.name = 'ApiError';\r\n\t\tthis.url = response.url;\r\n\t\tthis.status = response.status;\r\n\t\tthis.statusText = response.statusText;\r\n\t\tthis.body = response.body;\r\n\t\tthis.request = request;\r\n\t}\r\n}","export class CancelError extends Error {\r\n\tconstructor(message: string) {\r\n\t\tsuper(message);\r\n\t\tthis.name = 'CancelError';\r\n\t}\r\n\r\n\tpublic get isCancelled(): boolean {\r\n\t\treturn true;\r\n\t}\r\n}\r\n\r\nexport interface OnCancel {\r\n\treadonly isResolved: boolean;\r\n\treadonly isRejected: boolean;\r\n\treadonly isCancelled: boolean;\r\n\r\n\t(cancelHandler: () => void): void;\r\n}\r\n\r\nexport class CancelablePromise implements Promise {\r\n\tprivate _isResolved: boolean;\r\n\tprivate _isRejected: boolean;\r\n\tprivate _isCancelled: boolean;\r\n\treadonly cancelHandlers: (() => void)[];\r\n\treadonly promise: Promise;\r\n\tprivate _resolve?: (value: T | PromiseLike) => void;\r\n\tprivate _reject?: (reason?: unknown) => void;\r\n\r\n\tconstructor(\r\n\t\texecutor: (\r\n\t\t\tresolve: (value: T | PromiseLike) => void,\r\n\t\t\treject: (reason?: unknown) => void,\r\n\t\t\tonCancel: OnCancel\r\n\t\t) => void\r\n\t) {\r\n\t\tthis._isResolved = false;\r\n\t\tthis._isRejected = false;\r\n\t\tthis._isCancelled = false;\r\n\t\tthis.cancelHandlers = [];\r\n\t\tthis.promise = new Promise((resolve, reject) => {\r\n\t\t\tthis._resolve = resolve;\r\n\t\t\tthis._reject = reject;\r\n\r\n\t\t\tconst onResolve = (value: T | PromiseLike): void => {\r\n\t\t\t\tif (this._isResolved || this._isRejected || this._isCancelled) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis._isResolved = true;\r\n\t\t\t\tif (this._resolve) this._resolve(value);\r\n\t\t\t};\r\n\r\n\t\t\tconst onReject = (reason?: unknown): void => {\r\n\t\t\t\tif (this._isResolved || this._isRejected || this._isCancelled) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis._isRejected = true;\r\n\t\t\t\tif (this._reject) this._reject(reason);\r\n\t\t\t};\r\n\r\n\t\t\tconst onCancel = (cancelHandler: () => void): void => {\r\n\t\t\t\tif (this._isResolved || this._isRejected || this._isCancelled) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis.cancelHandlers.push(cancelHandler);\r\n\t\t\t};\r\n\r\n\t\t\tObject.defineProperty(onCancel, 'isResolved', {\r\n\t\t\t\tget: (): boolean => this._isResolved,\r\n\t\t\t});\r\n\r\n\t\t\tObject.defineProperty(onCancel, 'isRejected', {\r\n\t\t\t\tget: (): boolean => this._isRejected,\r\n\t\t\t});\r\n\r\n\t\t\tObject.defineProperty(onCancel, 'isCancelled', {\r\n\t\t\t\tget: (): boolean => this._isCancelled,\r\n\t\t\t});\r\n\r\n\t\t\treturn executor(onResolve, onReject, onCancel as OnCancel);\r\n\t\t});\r\n\t}\r\n\r\n\tget [Symbol.toStringTag]() {\r\n\t\treturn \"Cancellable Promise\";\r\n\t}\r\n\r\n\tpublic then(\r\n\t\tonFulfilled?: ((value: T) => TResult1 | PromiseLike) | null,\r\n\t\tonRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null\r\n\t): Promise {\r\n\t\treturn this.promise.then(onFulfilled, onRejected);\r\n\t}\r\n\r\n\tpublic catch(\r\n\t\tonRejected?: ((reason: unknown) => TResult | PromiseLike) | null\r\n\t): Promise {\r\n\t\treturn this.promise.catch(onRejected);\r\n\t}\r\n\r\n\tpublic finally(onFinally?: (() => void) | null): Promise {\r\n\t\treturn this.promise.finally(onFinally);\r\n\t}\r\n\r\n\tpublic cancel(): void {\r\n\t\tif (this._isResolved || this._isRejected || this._isCancelled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._isCancelled = true;\r\n\t\tif (this.cancelHandlers.length) {\r\n\t\t\ttry {\r\n\t\t\t\tfor (const cancelHandler of this.cancelHandlers) {\r\n\t\t\t\t\tcancelHandler();\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.warn('Cancellation threw an error', error);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.cancelHandlers.length = 0;\r\n\t\tif (this._reject) this._reject(new CancelError('Request aborted'));\r\n\t}\r\n\r\n\tpublic get isCancelled(): boolean {\r\n\t\treturn this._isCancelled;\r\n\t}\r\n}","import type { ApiRequestOptions } from './ApiRequestOptions';\r\n\r\ntype Headers = Record;\r\ntype Middleware = (value: T) => T | Promise;\r\ntype Resolver = (options: ApiRequestOptions) => Promise;\r\n\r\nexport class Interceptors {\r\n _fns: Middleware[];\r\n\r\n constructor() {\r\n this._fns = [];\r\n }\r\n\r\n eject(fn: Middleware): void {\r\n const index = this._fns.indexOf(fn);\r\n if (index !== -1) {\r\n this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];\r\n }\r\n }\r\n\r\n use(fn: Middleware): void {\r\n this._fns = [...this._fns, fn];\r\n }\r\n}\r\n\r\nexport type OpenAPIConfig = {\r\n\tBASE: string;\r\n\tCREDENTIALS: 'include' | 'omit' | 'same-origin';\r\n\tENCODE_PATH?: ((path: string) => string) | undefined;\r\n\tHEADERS?: Headers | Resolver | undefined;\r\n\tPASSWORD?: string | Resolver | undefined;\r\n\tTOKEN?: string | Resolver | undefined;\r\n\tUSERNAME?: string | Resolver | undefined;\r\n\tVERSION: string;\r\n\tWITH_CREDENTIALS: boolean;\r\n\tinterceptors: {\r\n\t\trequest: Interceptors;\r\n\t\tresponse: Interceptors;\r\n\t};\r\n};\r\n\r\nexport const OpenAPI: OpenAPIConfig = {\r\n\tBASE: '',\r\n\tCREDENTIALS: 'include',\r\n\tENCODE_PATH: undefined,\r\n\tHEADERS: undefined,\r\n\tPASSWORD: undefined,\r\n\tTOKEN: undefined,\r\n\tUSERNAME: undefined,\r\n\tVERSION: 'Latest',\r\n\tWITH_CREDENTIALS: false,\r\n\tinterceptors: {\r\n\t\trequest: new Interceptors(),\r\n\t\tresponse: new Interceptors(),\r\n\t},\r\n};","import { ApiError } from './ApiError';\r\nimport type { ApiRequestOptions } from './ApiRequestOptions';\r\nimport type { ApiResult } from './ApiResult';\r\nimport { CancelablePromise } from './CancelablePromise';\r\nimport type { OnCancel } from './CancelablePromise';\r\nimport type { OpenAPIConfig } from './OpenAPI';\r\n\r\nexport const isString = (value: unknown): value is string => {\r\n\treturn typeof value === 'string';\r\n};\r\n\r\nexport const isStringWithValue = (value: unknown): value is string => {\r\n\treturn isString(value) && value !== '';\r\n};\r\n\r\nexport const isBlob = (value: any): value is Blob => {\r\n\treturn value instanceof Blob;\r\n};\r\n\r\nexport const isFormData = (value: unknown): value is FormData => {\r\n\treturn value instanceof FormData;\r\n};\r\n\r\nexport const base64 = (str: string): string => {\r\n\ttry {\r\n\t\treturn btoa(str);\r\n\t} catch (err) {\r\n\t\t// @ts-ignore\r\n\t\treturn Buffer.from(str).toString('base64');\r\n\t}\r\n};\r\n\r\nexport const getQueryString = (params: Record): string => {\r\n\tconst qs: string[] = [];\r\n\r\n\tconst append = (key: string, value: unknown) => {\r\n\t\tqs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);\r\n\t};\r\n\r\n\tconst encodePair = (key: string, value: unknown) => {\r\n\t\tif (value === undefined || value === null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (value instanceof Date) {\r\n\t\t\tappend(key, value.toISOString());\r\n\t\t} else if (Array.isArray(value)) {\r\n\t\t\tvalue.forEach(v => encodePair(key, v));\r\n\t\t} else if (typeof value === 'object') {\r\n\t\t\tObject.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v));\r\n\t\t} else {\r\n\t\t\tappend(key, value);\r\n\t\t}\r\n\t};\r\n\r\n\tObject.entries(params).forEach(([key, value]) => encodePair(key, value));\r\n\r\n\treturn qs.length ? `?${qs.join('&')}` : '';\r\n};\r\n\r\nconst getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {\r\n\tconst encoder = config.ENCODE_PATH || encodeURI;\r\n\r\n\tconst path = options.url\r\n\t\t.replace('{api-version}', config.VERSION)\r\n\t\t.replace(/{(.*?)}/g, (substring: string, group: string) => {\r\n\t\t\tif (options.path?.hasOwnProperty(group)) {\r\n\t\t\t\treturn encoder(String(options.path[group]));\r\n\t\t\t}\r\n\t\t\treturn substring;\r\n\t\t});\r\n\r\n\tconst url = config.BASE + path;\r\n\treturn options.query ? url + getQueryString(options.query) : url;\r\n};\r\n\r\nexport const getFormData = (options: ApiRequestOptions): FormData | undefined => {\r\n\tif (options.formData) {\r\n\t\tconst formData = new FormData();\r\n\r\n\t\tconst process = (key: string, value: unknown) => {\r\n\t\t\tif (isString(value) || isBlob(value)) {\r\n\t\t\t\tformData.append(key, value);\r\n\t\t\t} else {\r\n\t\t\t\tformData.append(key, JSON.stringify(value));\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tObject.entries(options.formData)\r\n\t\t\t.filter(([, value]) => value !== undefined && value !== null)\r\n\t\t\t.forEach(([key, value]) => {\r\n\t\t\t\tif (Array.isArray(value)) {\r\n\t\t\t\t\tvalue.forEach(v => process(key, v));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocess(key, value);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\treturn formData;\r\n\t}\r\n\treturn undefined;\r\n};\r\n\r\ntype Resolver = (options: ApiRequestOptions) => Promise;\r\n\r\nexport const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => {\r\n\tif (typeof resolver === 'function') {\r\n\t\treturn (resolver as Resolver)(options);\r\n\t}\r\n\treturn resolver;\r\n};\r\n\r\nexport const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => {\r\n\tconst [token, username, password, additionalHeaders] = await Promise.all([\r\n\t\t// @ts-ignore\r\n\t\tresolve(options, config.TOKEN),\r\n\t\t// @ts-ignore\r\n\t\tresolve(options, config.USERNAME),\r\n\t\t// @ts-ignore\r\n\t\tresolve(options, config.PASSWORD),\r\n\t\t// @ts-ignore\r\n\t\tresolve(options, config.HEADERS),\r\n\t]);\r\n\r\n\tconst headers = Object.entries({\r\n\t\tAccept: 'application/json',\r\n\t\t...additionalHeaders,\r\n\t\t...options.headers,\r\n\t})\r\n\t\t.filter(([, value]) => value !== undefined && value !== null)\r\n\t\t.reduce((headers, [key, value]) => ({\r\n\t\t\t...headers,\r\n\t\t\t[key]: String(value),\r\n\t\t}), {} as Record);\r\n\r\n\tif (isStringWithValue(token)) {\r\n\t\theaders['Authorization'] = `Bearer ${token}`;\r\n\t}\r\n\r\n\tif (isStringWithValue(username) && isStringWithValue(password)) {\r\n\t\tconst credentials = base64(`${username}:${password}`);\r\n\t\theaders['Authorization'] = `Basic ${credentials}`;\r\n\t}\r\n\r\n\tif (options.body !== undefined) {\r\n\t\tif (options.mediaType) {\r\n\t\t\theaders['Content-Type'] = options.mediaType;\r\n\t\t} else if (isBlob(options.body)) {\r\n\t\t\theaders['Content-Type'] = options.body.type || 'application/octet-stream';\r\n\t\t} else if (isString(options.body)) {\r\n\t\t\theaders['Content-Type'] = 'text/plain';\r\n\t\t} else if (!isFormData(options.body)) {\r\n\t\t\theaders['Content-Type'] = 'application/json';\r\n\t\t}\r\n\t}\r\n\r\n\treturn new Headers(headers);\r\n};\r\n\r\nexport const getRequestBody = (options: ApiRequestOptions): unknown => {\r\n\tif (options.body !== undefined) {\r\n\t\tif (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) {\r\n\t\t\treturn JSON.stringify(options.body);\r\n\t\t} else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {\r\n\t\t\treturn options.body;\r\n\t\t} else {\r\n\t\t\treturn JSON.stringify(options.body);\r\n\t\t}\r\n\t}\r\n\treturn undefined;\r\n};\r\n\r\nexport const sendRequest = async (\r\n\tconfig: OpenAPIConfig,\r\n\toptions: ApiRequestOptions,\r\n\turl: string,\r\n\tbody: any,\r\n\tformData: FormData | undefined,\r\n\theaders: Headers,\r\n\tonCancel: OnCancel\r\n): Promise => {\r\n\tconst controller = new AbortController();\r\n\r\n\tlet request: RequestInit = {\r\n\t\theaders,\r\n\t\tbody: body ?? formData,\r\n\t\tmethod: options.method,\r\n\t\tsignal: controller.signal,\r\n\t};\r\n\r\n\tif (config.WITH_CREDENTIALS) {\r\n\t\trequest.credentials = config.CREDENTIALS;\r\n\t}\r\n\r\n\tfor (const fn of config.interceptors.request._fns) {\r\n\t\trequest = await fn(request);\r\n\t}\r\n\r\n\tonCancel(() => controller.abort());\r\n\r\n\treturn await fetch(url, request);\r\n};\r\n\r\nexport const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => {\r\n\tif (responseHeader) {\r\n\t\tconst content = response.headers.get(responseHeader);\r\n\t\tif (isString(content)) {\r\n\t\t\treturn content;\r\n\t\t}\r\n\t}\r\n\treturn undefined;\r\n};\r\n\r\nexport const getResponseBody = async (response: Response): Promise => {\r\n\tif (response.status !== 204) {\r\n\t\ttry {\r\n\t\t\tconst contentType = response.headers.get('Content-Type');\r\n\t\t\tif (contentType) {\r\n\t\t\t\tconst binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/'];\r\n\t\t\t\tif (contentType.includes('application/json') || contentType.includes('+json')) {\r\n\t\t\t\t\treturn await response.json();\r\n\t\t\t\t} else if (binaryTypes.some(type => contentType.includes(type))) {\r\n\t\t\t\t\treturn await response.blob();\r\n\t\t\t\t} else if (contentType.includes('multipart/form-data')) {\r\n\t\t\t\t\treturn await response.formData();\r\n\t\t\t\t} else if (contentType.includes('text/')) {\r\n\t\t\t\t\treturn await response.text();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(error);\r\n\t\t}\r\n\t}\r\n\treturn undefined;\r\n};\r\n\r\nexport const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {\r\n\tconst errors: Record = {\r\n\t\t400: 'Bad Request',\r\n\t\t401: 'Unauthorized',\r\n\t\t402: 'Payment Required',\r\n\t\t403: 'Forbidden',\r\n\t\t404: 'Not Found',\r\n\t\t405: 'Method Not Allowed',\r\n\t\t406: 'Not Acceptable',\r\n\t\t407: 'Proxy Authentication Required',\r\n\t\t408: 'Request Timeout',\r\n\t\t409: 'Conflict',\r\n\t\t410: 'Gone',\r\n\t\t411: 'Length Required',\r\n\t\t412: 'Precondition Failed',\r\n\t\t413: 'Payload Too Large',\r\n\t\t414: 'URI Too Long',\r\n\t\t415: 'Unsupported Media Type',\r\n\t\t416: 'Range Not Satisfiable',\r\n\t\t417: 'Expectation Failed',\r\n\t\t418: 'Im a teapot',\r\n\t\t421: 'Misdirected Request',\r\n\t\t422: 'Unprocessable Content',\r\n\t\t423: 'Locked',\r\n\t\t424: 'Failed Dependency',\r\n\t\t425: 'Too Early',\r\n\t\t426: 'Upgrade Required',\r\n\t\t428: 'Precondition Required',\r\n\t\t429: 'Too Many Requests',\r\n\t\t431: 'Request Header Fields Too Large',\r\n\t\t451: 'Unavailable For Legal Reasons',\r\n\t\t500: 'Internal Server Error',\r\n\t\t501: 'Not Implemented',\r\n\t\t502: 'Bad Gateway',\r\n\t\t503: 'Service Unavailable',\r\n\t\t504: 'Gateway Timeout',\r\n\t\t505: 'HTTP Version Not Supported',\r\n\t\t506: 'Variant Also Negotiates',\r\n\t\t507: 'Insufficient Storage',\r\n\t\t508: 'Loop Detected',\r\n\t\t510: 'Not Extended',\r\n\t\t511: 'Network Authentication Required',\r\n\t\t...options.errors,\r\n\t}\r\n\r\n\tconst error = errors[result.status];\r\n\tif (error) {\r\n\t\tthrow new ApiError(options, result, error);\r\n\t}\r\n\r\n\tif (!result.ok) {\r\n\t\tconst errorStatus = result.status ?? 'unknown';\r\n\t\tconst errorStatusText = result.statusText ?? 'unknown';\r\n\t\tconst errorBody = (() => {\r\n\t\t\ttry {\r\n\t\t\t\treturn JSON.stringify(result.body, null, 2);\r\n\t\t\t} catch (e) {\r\n\t\t\t\treturn undefined;\r\n\t\t\t}\r\n\t\t})();\r\n\r\n\t\tthrow new ApiError(options, result,\r\n\t\t\t`Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`\r\n\t\t);\r\n\t}\r\n};\r\n\r\n/**\r\n * Request method\r\n * @param config The OpenAPI configuration object\r\n * @param options The request options from the service\r\n * @returns CancelablePromise\r\n * @throws ApiError\r\n */\r\nexport const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => {\r\n\treturn new CancelablePromise(async (resolve, reject, onCancel) => {\r\n\t\ttry {\r\n\t\t\tconst url = getUrl(config, options);\r\n\t\t\tconst formData = getFormData(options);\r\n\t\t\tconst body = getRequestBody(options);\r\n\t\t\tconst headers = await getHeaders(config, options);\r\n\r\n\t\t\tif (!onCancel.isCancelled) {\r\n\t\t\t\tlet response = await sendRequest(config, options, url, body, formData, headers, onCancel);\r\n\r\n\t\t\t\tfor (const fn of config.interceptors.response._fns) {\r\n\t\t\t\t\tresponse = await fn(response);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst responseBody = await getResponseBody(response);\r\n\t\t\t\tconst responseHeader = getResponseHeader(response, options.responseHeader);\r\n\r\n\t\t\t\tlet transformedBody = responseBody;\r\n\t\t\t\tif (options.responseTransformer && response.ok) {\r\n\t\t\t\t\ttransformedBody = await options.responseTransformer(responseBody)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst result: ApiResult = {\r\n\t\t\t\t\turl,\r\n\t\t\t\t\tok: response.ok,\r\n\t\t\t\t\tstatus: response.status,\r\n\t\t\t\t\tstatusText: response.statusText,\r\n\t\t\t\t\tbody: responseHeader ?? transformedBody,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcatchErrorCodes(options, result);\r\n\r\n\t\t\t\tresolve(result.body);\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\treject(error);\r\n\t\t}\r\n\t});\r\n};","// This file is auto-generated by @hey-api/openapi-ts\r\n\r\nimport type { CancelablePromise } from './core/CancelablePromise';\r\nimport { OpenAPI } from './core/OpenAPI';\r\nimport { request as __request } from './core/request';\r\nimport type { CheckPageData, CheckPageResponse, GetAverageDataResponse, GetOverviewDataData, GetOverviewDataResponse, GetPageDataData, GetPageDataResponse, SavePageDataData, SavePageDataResponse } from './types.gen';\r\n\r\nexport class SustainabilityService {\r\n /**\r\n * @param data The data for the request.\r\n * @param data.pageGuid\r\n * @returns unknown OK\r\n * @throws ApiError\r\n */\r\n public static checkPage(data: CheckPageData = {}): CancelablePromise {\r\n return __request(OpenAPI, {\r\n method: 'GET',\r\n url: '/umbraco/sustainability/api/v1/checkPage',\r\n query: {\r\n pageGuid: data.pageGuid\r\n }\r\n });\r\n }\r\n \r\n /**\r\n * @returns unknown OK\r\n * @throws ApiError\r\n */\r\n public static getAverageData(): CancelablePromise {\r\n return __request(OpenAPI, {\r\n method: 'GET',\r\n url: '/umbraco/sustainability/api/v1/getAverageData'\r\n });\r\n }\r\n \r\n /**\r\n * @param data The data for the request.\r\n * @param data.pageNumber\r\n * @param data.pageSize\r\n * @param data.orderBy\r\n * @param data.direction\r\n * @returns unknown OK\r\n * @throws ApiError\r\n */\r\n public static getOverviewData(data: GetOverviewDataData = {}): CancelablePromise {\r\n return __request(OpenAPI, {\r\n method: 'GET',\r\n url: '/umbraco/sustainability/api/v1/getOverviewData',\r\n query: {\r\n pageNumber: data.pageNumber,\r\n pageSize: data.pageSize,\r\n orderBy: data.orderBy,\r\n direction: data.direction\r\n }\r\n });\r\n }\r\n \r\n /**\r\n * @param data The data for the request.\r\n * @param data.pageGuid\r\n * @returns unknown OK\r\n * @throws ApiError\r\n */\r\n public static getPageData(data: GetPageDataData = {}): CancelablePromise {\r\n return __request(OpenAPI, {\r\n method: 'GET',\r\n url: '/umbraco/sustainability/api/v1/getPageData',\r\n query: {\r\n pageGuid: data.pageGuid\r\n }\r\n });\r\n }\r\n \r\n /**\r\n * @param data The data for the request.\r\n * @param data.pageGuid\r\n * @param data.requestBody\r\n * @returns boolean OK\r\n * @throws ApiError\r\n */\r\n public static savePageData(data: SavePageDataData = {}): CancelablePromise {\r\n return __request(OpenAPI, {\r\n method: 'POST',\r\n url: '/umbraco/sustainability/api/v1/savePageData',\r\n query: {\r\n pageGuid: data.pageGuid\r\n },\r\n body: data.requestBody,\r\n mediaType: 'application/json'\r\n });\r\n }\r\n \r\n}","import { UmbControllerHost } from \"@umbraco-cms/backoffice/controller-api\";\r\nimport { UmbDataSourceResponse } from \"@umbraco-cms/backoffice/repository\";\r\nimport { tryExecuteAndNotify } from '@umbraco-cms/backoffice/resources';\r\nimport { SustainabilityService, type SustainabilityResponse, DirectionModel, PagedResultPageMetricModel, AveragePageMetrics } from \"../../api\";\r\n\r\nexport interface SustainabilityDataSource {\r\n\r\n checkPage(pageGuid: string): Promise>;\r\n getPageData(pageGuid: string): Promise>;\r\n savePageData(pageGuid: string, sustainabilityResponse: SustainabilityResponse): Promise>;\r\n getOverviewData(direction: DirectionModel, orderBy: string, pageNumber: number, pageSize: number): Promise>;\r\n getAverageData(): Promise>;\r\n\r\n}\r\n\r\nexport class SustainabilityManagementDataSource implements SustainabilityDataSource {\r\n\r\n #host: UmbControllerHost;\r\n\r\n constructor(host: UmbControllerHost) {\r\n this.#host = host;\r\n }\r\n\r\n async checkPage(pageGuid: string): Promise> {\r\n return await tryExecuteAndNotify(this.#host, SustainabilityService.checkPage({ pageGuid: pageGuid }));\r\n }\r\n\r\n async getPageData(pageGuid: string): Promise> {\r\n return await tryExecuteAndNotify(this.#host, SustainabilityService.getPageData({ pageGuid: pageGuid }));\r\n }\r\n\r\n async savePageData(pageGuid: string, sustainabilityResponse: SustainabilityResponse): Promise> {\r\n return await tryExecuteAndNotify(this.#host, SustainabilityService.savePageData({\r\n pageGuid: pageGuid,\r\n requestBody: sustainabilityResponse\r\n }))\r\n }\r\n\r\n async getOverviewData(direction: DirectionModel, orderBy: string, pageNumber: number, pageSize: number): Promise> {\r\n return await tryExecuteAndNotify(this.#host, SustainabilityService.getOverviewData({ direction, orderBy, pageNumber, pageSize }));\r\n }\r\n\r\n async getAverageData(): Promise> {\r\n return await tryExecuteAndNotify(this.#host, SustainabilityService.getAverageData());\r\n }\r\n\r\n}\r\n","import { UmbControllerBase } from \"@umbraco-cms/backoffice/class-api\";\r\nimport { UmbControllerHost } from \"@umbraco-cms/backoffice/controller-api\";\r\nimport { SustainabilityManagementDataSource } from \"./sources/sustainability.source\";\r\nimport { DirectionModel, SustainabilityResponse } from \"../api\";\r\n\r\nexport class SustainabilityRepository extends UmbControllerBase {\r\n #sustainabilityDataSource: SustainabilityManagementDataSource;\r\n\r\n constructor(host: UmbControllerHost) {\r\n super(host);\r\n this.#sustainabilityDataSource = new SustainabilityManagementDataSource(this);\r\n }\r\n\r\n async checkPage(pageGuid: string) {\r\n return await this.#sustainabilityDataSource.checkPage(pageGuid);\r\n }\r\n\r\n async getPageData(pageGuid: string) {\r\n return await this.#sustainabilityDataSource.getPageData(pageGuid);\r\n }\r\n\r\n async savePageData(pageGuid: string, sustainabilityResponse: SustainabilityResponse) {\r\n return await this.#sustainabilityDataSource.savePageData(pageGuid, sustainabilityResponse);\r\n }\r\n\r\n async getOverviewData(direction: DirectionModel, orderBy: string, pageNumber: number, pageSize: number) {\r\n return await this.#sustainabilityDataSource.getOverviewData(direction, orderBy, pageNumber, pageSize);\r\n }\r\n\r\n async getAverageData() {\r\n return await this.#sustainabilityDataSource.getAverageData();\r\n }\r\n}\r\n","import { AveragePageMetrics, DirectionModel, PagedResultPageMetricModel, SustainabilityResponse } from \"../api\";\r\nimport { SustainabilityRepository } from \"../repository/sustainability.repository\";\r\nimport { UmbControllerBase } from \"@umbraco-cms/backoffice/class-api\";\r\nimport { UmbContextToken } from \"@umbraco-cms/backoffice/context-api\";\r\nimport { UmbControllerHost } from \"@umbraco-cms/backoffice/controller-api\";\r\nimport { UmbObjectState } from \"@umbraco-cms/backoffice/observable-api\";\r\n\r\nexport class SustainabilityContext extends UmbControllerBase {\r\n \r\n #repository: SustainabilityRepository;\r\n\r\n #overviewData = new UmbObjectState(undefined);\r\n public readonly overviewData = this.#overviewData.asObservable();\r\n\r\n #averageData = new UmbObjectState(undefined);\r\n public readonly averageData = this.#averageData.asObservable();\r\n\r\n constructor(host: UmbControllerHost) {\r\n super(host);\r\n this.#repository = new SustainabilityRepository(this);\r\n }\r\n\r\n async checkPage(pageGuid: string, initialLoad: boolean = true) {\r\n const { data } = await this.#repository.checkPage(pageGuid);\r\n if (data) {\r\n if (!initialLoad) {\r\n await this.savePageData(pageGuid, data);\r\n }\r\n\r\n return data;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n async getPageData(pageGuid: string) {\r\n const { data } = await this.#repository.getPageData(pageGuid);\r\n if (data) {\r\n return data;\r\n }\r\n\r\n return undefined;\r\n }\r\n \r\n async savePageData(pageGuid: string, sustainabilityResponse: SustainabilityResponse) {\r\n const saved = await this.#repository.savePageData(pageGuid, sustainabilityResponse);\r\n return saved;\r\n }\r\n\r\n async getOverviewData(direction: DirectionModel, orderBy: string, pageNumber: number, pageSize: number) {\r\n const { data } = await this.#repository.getOverviewData(direction, orderBy, pageNumber, pageSize);\r\n if (data) {\r\n this.#overviewData.setValue(data);\r\n }\r\n }\r\n\r\n async getAverageData() {\r\n const { data } = await this.#repository.getAverageData();\r\n if (data) {\r\n this.#averageData.setValue(data);\r\n }\r\n }\r\n \r\n}\r\n\r\nexport default SustainabilityContext;\r\n\r\nexport const SUSTAINABILITY_CONTEXT =\r\n new UmbContextToken('SustainabilityContext');\r\n","import { UmbElementMixin } from \"@umbraco-cms/backoffice/element-api\"\r\nimport { LitElement, customElement, html, property } from \"@umbraco-cms/backoffice/external/lit\";\r\nimport { UUIInterfaceColor } from \"@umbraco-cms/backoffice/external/uui\";\r\n\r\nconst elementName = \"sustainability-carbon-rating\";\r\n\r\n@customElement(elementName)\r\nexport class SustainabilityCarbonRating extends UmbElementMixin(LitElement) {\r\n\r\n @property({type: String}) \r\n carbonRating: string | null | undefined = undefined;\r\n\r\n _getColour(carbonRating: string | null | undefined): UUIInterfaceColor {\r\n if (carbonRating == \"E\" || carbonRating == \"F\") {\r\n return \"danger\";\r\n }\r\n else if (carbonRating == \"D\") {\r\n return \"warning\";\r\n }\r\n else return \"positive\";\r\n }\r\n\r\n render() {\r\n return html`\r\n \r\n ${this.carbonRating}\r\n \r\n `\r\n }\r\n}\r\n\r\nexport default SustainabilityCarbonRating;\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n [elementName]: SustainabilityCarbonRating;\r\n }\r\n}\r\n","import { UmbEntryPointOnInit } from '@umbraco-cms/backoffice/extension-api';\r\n\r\nimport { manifests as documentManifests } from './documents/manifest.ts';\r\nimport { manifests as sectionManifests } from './section/manifests.ts';\r\n\r\nimport { UMB_AUTH_CONTEXT } from '@umbraco-cms/backoffice/auth';\r\nimport SustainabilityContext, { SUSTAINABILITY_CONTEXT } from './context/sustainability.context.ts';\r\nimport { OpenAPI } from './api/index.ts';\r\n\r\nexport * from './components/index';\r\nexport * from './repository/index';\r\n\r\nexport const onInit: UmbEntryPointOnInit = (host, extensionRegistry) => {\r\n\r\n extensionRegistry.registerMany([\r\n ...documentManifests,\r\n ...sectionManifests\r\n ]);\r\n\r\n host.consumeContext(UMB_AUTH_CONTEXT, async (auth) => {\r\n if (!auth) return;\r\n\r\n const umbOpenApi = auth.getOpenApiConfiguration();\r\n OpenAPI.BASE = umbOpenApi.base;\r\n OpenAPI.TOKEN = umbOpenApi.token;\r\n OpenAPI.WITH_CREDENTIALS = umbOpenApi.withCredentials;\r\n OpenAPI.CREDENTIALS = umbOpenApi.credentials;\r\n });\r\n\r\n host.provideContext(SUSTAINABILITY_CONTEXT, new SustainabilityContext(host));\r\n};\r\n"],"names":["workspaceView","manifests","SUSTAINABILITY_OVERVIEW_ROOT_ENTITY_TYPE","menuItem","workspaceAlias","contextAlias","workspace","context","sustainability_context","workspaceManifests","menuItems","SUSTAINABILITY_STATS_ROOT_ENTITY_TYPE","sectionAlias","menuAlias","section","sectionView","menu","menuSectionSidebarApp","overviewManifests","statsManifests","ApiError","request","response","message","CancelError","CancelablePromise","executor","resolve","reject","onResolve","value","onReject","reason","onCancel","cancelHandler","onFulfilled","onRejected","onFinally","error","Interceptors","fn","index","OpenAPI","isString","isStringWithValue","isBlob","isFormData","base64","str","getQueryString","params","qs","append","key","encodePair","v","k","getUrl","config","options","encoder","path","substring","group","_a","url","getFormData","formData","process","resolver","getHeaders","token","username","password","additionalHeaders","headers","credentials","getRequestBody","_b","sendRequest","body","controller","getResponseHeader","responseHeader","content","getResponseBody","contentType","binaryTypes","type","catchErrorCodes","result","errorStatus","errorStatusText","errorBody","responseBody","transformedBody","SustainabilityService","data","__request","SustainabilityManagementDataSource","host","__privateAdd","_host","__privateSet","pageGuid","tryExecuteAndNotify","__privateGet","sustainabilityResponse","direction","orderBy","pageNumber","pageSize","SustainabilityRepository","UmbControllerBase","_sustainabilityDataSource","SustainabilityContext","_repository","_overviewData","_averageData","UmbObjectState","initialLoad","SUSTAINABILITY_CONTEXT","UmbContextToken","elementName","SustainabilityCarbonRating","UmbElementMixin","LitElement","carbonRating","html","__decorateClass","property","customElement","onInit","extensionRegistry","documentManifests","section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D,EAAK;AACxB,IAAA/F,EAAQ,OAAOgG,EAAW,MAC1BhG,EAAQ,QAAQgG,EAAW,OAC3BhG,EAAQ,mBAAmBgG,EAAW,iBACtChG,EAAQ,cAAcgG,EAAW;AAAA,EAAA,CAClC,GAEDtC,EAAK,eAAeqB,GAAwB,IAAIN,EAAsBf,CAAI,CAAC;AAC7E;"} \ No newline at end of file diff --git a/src/Umbraco.Community.Sustainability/wwwroot/App_Plugins/Umbraco.Community.Sustainability/stats-workspace.element-Ug3H0Tey.js.map b/src/Umbraco.Community.Sustainability/wwwroot/App_Plugins/Umbraco.Community.Sustainability/stats-workspace.element-Ug3H0Tey.js.map index 5cab555..40765d5 100644 --- a/src/Umbraco.Community.Sustainability/wwwroot/App_Plugins/Umbraco.Community.Sustainability/stats-workspace.element-Ug3H0Tey.js.map +++ b/src/Umbraco.Community.Sustainability/wwwroot/App_Plugins/Umbraco.Community.Sustainability/stats-workspace.element-Ug3H0Tey.js.map @@ -1 +1 @@ -{"version":3,"file":"stats-workspace.element-Ug3H0Tey.js","sources":["../../../../Umbraco.Community.Sustainability.UI/src/api/types.gen.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/stats/workspace/stats-workspace.element.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nexport type AveragePageMetrics = {\n carbonRating?: string | null;\n pageSize?: number | null;\n emissions?: number | null;\n};\n\nexport enum DirectionModel {\n ASCENDING = 'Ascending',\n DESCENDING = 'Descending'\n}\n\nexport enum EventMessageTypeModel {\n DEFAULT = 'Default',\n INFO = 'Info',\n ERROR = 'Error',\n SUCCESS = 'Success',\n WARNING = 'Warning'\n}\n\nexport type ExternalResource = {\n url?: string | null;\n size?: number | null;\n};\n\nexport type ExternalResourceGroup = {\n type: ResourceGroupType;\n name?: string | null;\n totalSize: number;\n resources?: Array<(ExternalResource)> | null;\n};\n\nexport type NotificationHeaderModel = {\n message: string;\n category: string;\n type: EventMessageTypeModel;\n};\n\nexport type PageMetric = {\n id: number;\n nodeKey?: string | null;\n nodeName?: string | null;\n requestedBy?: string | null;\n requestDate: string;\n totalSize: number;\n totalEmissions: number;\n carbonRating?: string | null;\n pageData?: string | null;\n pageDataObject?: SustainabilityResponse | null;\n};\n\nexport type PagedResultPageMetricModel = {\n pageNumber: number;\n pageSize: number;\n readonly totalPages: number;\n totalItems: number;\n items?: Array<(PageMetric)> | null;\n};\n\nexport enum ResourceGroupType {\n IMAGES = 'Images',\n SCRIPTS = 'Scripts',\n LINKS = 'Links',\n CSS = 'Css',\n OTHER = 'Other'\n}\n\nexport type SustainabilityResponse = {\n lastRunDate: string;\n totalSize: number;\n totalEmissions: number;\n carbonRating?: string | null;\n resourceGroups?: Array<(ExternalResourceGroup)> | null;\n};\n\nexport type CheckPageData = {\n pageGuid?: string;\n};\n\nexport type CheckPageResponse = SustainabilityResponse;\n\nexport type GetAverageDataResponse = AveragePageMetrics;\n\nexport type GetOverviewDataData = {\n direction?: DirectionModel;\n orderBy?: string;\n pageNumber?: number;\n pageSize?: number;\n};\n\nexport type GetOverviewDataResponse = PagedResultPageMetricModel;\n\nexport type GetPageDataData = {\n pageGuid?: string;\n};\n\nexport type GetPageDataResponse = SustainabilityResponse;\n\nexport type SavePageDataData = {\n pageGuid?: string;\n requestBody?: SustainabilityResponse;\n};\n\nexport type SavePageDataResponse = boolean;\n\nexport type $OpenApiTs = {\n '/umbraco/sustainability/api/v1/checkPage': {\n get: {\n req: CheckPageData;\n res: {\n /**\n * OK\n */\n 200: SustainabilityResponse;\n };\n };\n };\n '/umbraco/sustainability/api/v1/getAverageData': {\n get: {\n res: {\n /**\n * OK\n */\n 200: AveragePageMetrics;\n };\n };\n };\n '/umbraco/sustainability/api/v1/getOverviewData': {\n get: {\n req: GetOverviewDataData;\n res: {\n /**\n * OK\n */\n 200: PagedResultPageMetricModel;\n };\n };\n };\n '/umbraco/sustainability/api/v1/getPageData': {\n get: {\n req: GetPageDataData;\n res: {\n /**\n * OK\n */\n 200: SustainabilityResponse;\n };\n };\n };\n '/umbraco/sustainability/api/v1/savePageData': {\n post: {\n req: SavePageDataData;\n res: {\n /**\n * OK\n */\n 200: boolean;\n };\n };\n };\n};","import { css, customElement, html, property, repeat, state } from \"@umbraco-cms/backoffice/external/lit\";\r\nimport { DirectionModel, PageMetric, PagedResultPageMetricModel } from \"../../../api\";\r\nimport SustainabilityContext, { SUSTAINABILITY_CONTEXT } from \"../../../context/sustainability.context\";\r\nimport { UUIPaginationEvent } from \"@umbraco-cms/backoffice/external/uui\";\r\nimport { UmbLitElement } from \"@umbraco-cms/backoffice/lit-element\";\r\n\r\nconst elementName = \"stats-workspace\";\r\n\r\n@customElement(elementName)\r\nexport class StatsRootWorkspaceElement extends UmbLitElement {\r\n\r\n #sustainabilityContext?: SustainabilityContext;\r\n\r\n #localizeDateOptions: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: '2-digit',\r\n day: '2-digit',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n hour12: true\r\n };\r\n\r\n @state()\r\n _data?: PagedResultPageMetricModel;\r\n\r\n @property({ type: Boolean })\r\n _loaded?: boolean = false\r\n\r\n @state()\r\n _sortingDesc = false;\r\n\r\n @state()\r\n _orderDirection: DirectionModel = DirectionModel.DESCENDING;\r\n\r\n @state()\r\n _orderBy: string = \"RequestDate\";\r\n\r\n @state()\r\n _pageNumber = 1;\r\n\r\n @state()\r\n _pageSize = 10;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.consumeContext(SUSTAINABILITY_CONTEXT, (instance) => {\r\n this.#sustainabilityContext = instance;\r\n\r\n this.observe(this.#sustainabilityContext.overviewData, (data) => {\r\n if (!data) return;\r\n this._loaded = true;\r\n this._data = data;\r\n });\r\n\r\n this.#getStatsData();\r\n });\r\n }\r\n\r\n #getStatsData() {\r\n if (!this._sortingDesc) {\r\n this._orderDirection = DirectionModel.DESCENDING;\r\n }\r\n else this._orderDirection = DirectionModel.ASCENDING;\r\n\r\n this.#sustainabilityContext?.getOverviewData(this._orderDirection, this._orderBy, this._pageNumber, this._pageSize);\r\n }\r\n\r\n #onChange(event: UUIPaginationEvent) {\r\n this._pageNumber = event.target.current;\r\n this.#getStatsData();\r\n }\r\n\r\n private _sortingHandler(column: string) {\r\n this._sortingDesc = this._orderBy === column ? !this._sortingDesc : false;\r\n this._orderBy = column;\r\n this._pageNumber = 1;\r\n\r\n this.#getStatsData();\r\n }\r\n\r\n #renderPagination() {\r\n if (this._data?.totalPages === 1) return;\r\n return html`\r\n \r\n \r\n `;\r\n }\r\n\r\n render() {\r\n if (!this._loaded) {\r\n return html`\r\n
\r\n \r\n
`;\r\n }\r\n else {\r\n return html`\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n this._sortingHandler('RequestDate')}>\r\n Last Run Date\r\n \r\n \r\n \r\n \r\n \r\n this._sortingHandler('CarbonRating')}>\r\n Carbon Rating\r\n \r\n \r\n \r\n \r\n Images\r\n Scripts\r\n Links\r\n CSS\r\n Other\r\n \r\n this._sortingHandler('TotalSize')}>\r\n Page Size\r\n \r\n \r\n \r\n \r\n \r\n this._sortingHandler('TotalEmissions')}>\r\n CO₂ per page view\r\n \r\n \r\n \r\n \r\n \r\n ${repeat(\r\n this._data?.items!,\r\n (item: PageMetric) => item,\r\n (item: PageMetric) => html`\r\n \r\n \r\n \r\n ${item.nodeName}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n ${item.pageDataObject?.resourceGroups?.find(x => x.name === 'Images')?.resources?.length}\r\n \r\n\r\n \r\n ${item.pageDataObject?.resourceGroups?.find(x => x.name === 'Scripts')?.resources?.length}\r\n \r\n\r\n \r\n ${item.pageDataObject?.resourceGroups?.find(x => x.name === 'Links')?.resources?.length}\r\n \r\n\r\n \r\n ${item.pageDataObject?.resourceGroups?.find(x => x.name === 'CSS')?.resources?.length}\r\n \r\n\r\n \r\n ${item.pageDataObject?.resourceGroups?.find(x => x.name === 'Other')?.resources?.length}\r\n \r\n\r\n \r\n ${(item.totalSize / 1024).toFixed(2)}KB\r\n \r\n\r\n \r\n ${item.totalEmissions.toFixed(4)}g\r\n \r\n \r\n `\r\n )}\r\n \r\n\r\n ${this.#renderPagination()}\r\n \r\n
\r\n
\r\n `;\r\n }\r\n }\r\n\r\n static styles = [\r\n css`\r\n #loader-container {\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\tjustify-content: center;\r\n\t\t\t\talign-items: center;\r\n\t\t\t\tmargin: 0 var(--uui-size-space-4);\r\n\t\t\t}\r\n `\r\n ]\r\n}\r\n\r\nexport default StatsRootWorkspaceElement;\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n [elementName]: StatsRootWorkspaceElement;\r\n }\r\n}\r\n"],"names":["DirectionModel","_sustainabilityContext","_localizeDateOptions","_getStatsData","getStatsData_fn","_onChange","onChange_fn","_renderPagination","renderPagination_fn","elementName","StatsRootWorkspaceElement","UmbLitElement","__privateAdd","SUSTAINABILITY_CONTEXT","instance","__privateSet","__privateGet","data","__privateMethod","column","html","repeat","_a","item","_d","_c","_b","x","_h","_g","_f","_e","_l","_k","_j","_i","_p","_o","_n","_m","_t","_s","_r","_q","event","css","__decorateClass","state","property","customElement","StatsRootWorkspaceElement$1"],"mappings":";;;AAQY,IAAAA,sBAAAA,OACRA,EAAA,YAAY,aACZA,EAAA,aAAa,cAFLA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;uJCRZC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC;AAMA,MAAMC,IAAc;AAGP,IAAAC,IAAN,cAAwCC,EAAe;AAAA,EAkC5D,cAAc;AACN,aAeRC,EAAA,MAAAT,CAAA,GASAS,EAAA,MAAAP,CAAA,GAaAO,EAAA,MAAAL,CAAA,GAtEAK,EAAA,MAAAX,GAAA,MAAA,GAEmDW,EAAA,MAAAV,GAAA;AAAA,MACjD,MAAM;AAAA,MACN,OAAO;AAAA,MACP,KAAK;AAAA,MACL,MAAM;AAAA,MACN,QAAQ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kBACxBP,QAAKb,GAASC,CAAA,CAAA;AAAA;AAAA;AAG9B;AAjFWI,EAmNJ,SAAS;AAAA,EACdmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQF;AA9MAC,EAAA;AAAA,EADCC,EAAM;AAAA,GAbIrC,EAcX,WAAA,SAAA,CAAA;AAGAoC,EAAA;AAAA,EADCE,EAAS,EAAE,MAAM,SAAS;AAAA,GAhBhBtC,EAiBX,WAAA,WAAA,CAAA;AAGAoC,EAAA;AAAA,EADCC,EAAM;AAAA,GAnBIrC,EAoBX,WAAA,gBAAA,CAAA;AAGAoC,EAAA;AAAA,EADCC,EAAM;AAAA,GAtBIrC,EAuBX,WAAA,mBAAA,CAAA;AAGAoC,EAAA;AAAA,EADCC,EAAM;AAAA,GAzBIrC,EA0BX,WAAA,YAAA,CAAA;AAGAoC,EAAA;AAAA,EADCC,EAAM;AAAA,GA5BIrC,EA6BX,WAAA,eAAA,CAAA;AAGAoC,EAAA;AAAA,EADCC,EAAM;AAAA,GA/BIrC,EAgCX,WAAA,aAAA,CAAA;AAhCWA,IAANoC,EAAA;AAAA,EADNG,EAAcxC,CAAW;AAAA,GACbC,CAAA;AA+Nb,MAAAwC,IAAexC;"} \ No newline at end of file +{"version":3,"file":"stats-workspace.element-Ug3H0Tey.js","sources":["../../../../Umbraco.Community.Sustainability.UI/src/api/types.gen.ts","../../../../Umbraco.Community.Sustainability.UI/src/section/stats/workspace/stats-workspace.element.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\r\n\r\nexport type AveragePageMetrics = {\r\n carbonRating?: string | null;\r\n pageSize?: number | null;\r\n emissions?: number | null;\r\n};\r\n\r\nexport enum DirectionModel {\r\n ASCENDING = 'Ascending',\r\n DESCENDING = 'Descending'\r\n}\r\n\r\nexport enum EventMessageTypeModel {\r\n DEFAULT = 'Default',\r\n INFO = 'Info',\r\n ERROR = 'Error',\r\n SUCCESS = 'Success',\r\n WARNING = 'Warning'\r\n}\r\n\r\nexport type ExternalResource = {\r\n url?: string | null;\r\n size?: number | null;\r\n};\r\n\r\nexport type ExternalResourceGroup = {\r\n type: ResourceGroupType;\r\n name?: string | null;\r\n totalSize: number;\r\n resources?: Array<(ExternalResource)> | null;\r\n};\r\n\r\nexport type NotificationHeaderModel = {\r\n message: string;\r\n category: string;\r\n type: EventMessageTypeModel;\r\n};\r\n\r\nexport type PageMetric = {\r\n id: number;\r\n nodeKey?: string | null;\r\n nodeName?: string | null;\r\n requestedBy?: string | null;\r\n requestDate: string;\r\n totalSize: number;\r\n totalEmissions: number;\r\n carbonRating?: string | null;\r\n pageData?: string | null;\r\n pageDataObject?: SustainabilityResponse | null;\r\n};\r\n\r\nexport type PagedResultPageMetricModel = {\r\n pageNumber: number;\r\n pageSize: number;\r\n readonly totalPages: number;\r\n totalItems: number;\r\n items?: Array<(PageMetric)> | null;\r\n};\r\n\r\nexport enum ResourceGroupType {\r\n IMAGES = 'Images',\r\n SCRIPTS = 'Scripts',\r\n LINKS = 'Links',\r\n CSS = 'Css',\r\n OTHER = 'Other'\r\n}\r\n\r\nexport type SustainabilityResponse = {\r\n lastRunDate: string;\r\n totalSize: number;\r\n totalEmissions: number;\r\n carbonRating?: string | null;\r\n resourceGroups?: Array<(ExternalResourceGroup)> | null;\r\n};\r\n\r\nexport type CheckPageData = {\r\n pageGuid?: string;\r\n};\r\n\r\nexport type CheckPageResponse = SustainabilityResponse;\r\n\r\nexport type GetAverageDataResponse = AveragePageMetrics;\r\n\r\nexport type GetOverviewDataData = {\r\n direction?: DirectionModel;\r\n orderBy?: string;\r\n pageNumber?: number;\r\n pageSize?: number;\r\n};\r\n\r\nexport type GetOverviewDataResponse = PagedResultPageMetricModel;\r\n\r\nexport type GetPageDataData = {\r\n pageGuid?: string;\r\n};\r\n\r\nexport type GetPageDataResponse = SustainabilityResponse;\r\n\r\nexport type SavePageDataData = {\r\n pageGuid?: string;\r\n requestBody?: SustainabilityResponse;\r\n};\r\n\r\nexport type SavePageDataResponse = boolean;\r\n\r\nexport type $OpenApiTs = {\r\n '/umbraco/sustainability/api/v1/checkPage': {\r\n get: {\r\n req: CheckPageData;\r\n res: {\r\n /**\r\n * OK\r\n */\r\n 200: SustainabilityResponse;\r\n };\r\n };\r\n };\r\n '/umbraco/sustainability/api/v1/getAverageData': {\r\n get: {\r\n res: {\r\n /**\r\n * OK\r\n */\r\n 200: AveragePageMetrics;\r\n };\r\n };\r\n };\r\n '/umbraco/sustainability/api/v1/getOverviewData': {\r\n get: {\r\n req: GetOverviewDataData;\r\n res: {\r\n /**\r\n * OK\r\n */\r\n 200: PagedResultPageMetricModel;\r\n };\r\n };\r\n };\r\n '/umbraco/sustainability/api/v1/getPageData': {\r\n get: {\r\n req: GetPageDataData;\r\n res: {\r\n /**\r\n * OK\r\n */\r\n 200: SustainabilityResponse;\r\n };\r\n };\r\n };\r\n '/umbraco/sustainability/api/v1/savePageData': {\r\n post: {\r\n req: SavePageDataData;\r\n res: {\r\n /**\r\n * OK\r\n */\r\n 200: boolean;\r\n };\r\n };\r\n };\r\n};","import { css, customElement, html, property, repeat, state } from \"@umbraco-cms/backoffice/external/lit\";\r\nimport { DirectionModel, PageMetric, PagedResultPageMetricModel } from \"../../../api\";\r\nimport SustainabilityContext, { SUSTAINABILITY_CONTEXT } from \"../../../context/sustainability.context\";\r\nimport { UUIPaginationEvent } from \"@umbraco-cms/backoffice/external/uui\";\r\nimport { UmbLitElement } from \"@umbraco-cms/backoffice/lit-element\";\r\n\r\nconst elementName = \"stats-workspace\";\r\n\r\n@customElement(elementName)\r\nexport class StatsRootWorkspaceElement extends UmbLitElement {\r\n\r\n #sustainabilityContext?: SustainabilityContext;\r\n\r\n #localizeDateOptions: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: '2-digit',\r\n day: '2-digit',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n hour12: true\r\n };\r\n\r\n @state()\r\n _data?: PagedResultPageMetricModel;\r\n\r\n @property({ type: Boolean })\r\n _loaded?: boolean = false\r\n\r\n @state()\r\n _sortingDesc = false;\r\n\r\n @state()\r\n _orderDirection: DirectionModel = DirectionModel.DESCENDING;\r\n\r\n @state()\r\n _orderBy: string = \"RequestDate\";\r\n\r\n @state()\r\n _pageNumber = 1;\r\n\r\n @state()\r\n _pageSize = 10;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.consumeContext(SUSTAINABILITY_CONTEXT, (instance) => {\r\n this.#sustainabilityContext = instance;\r\n\r\n this.observe(this.#sustainabilityContext.overviewData, (data) => {\r\n if (!data) return;\r\n this._loaded = true;\r\n this._data = data;\r\n });\r\n\r\n this.#getStatsData();\r\n });\r\n }\r\n\r\n #getStatsData() {\r\n if (!this._sortingDesc) {\r\n this._orderDirection = DirectionModel.DESCENDING;\r\n }\r\n else this._orderDirection = DirectionModel.ASCENDING;\r\n\r\n this.#sustainabilityContext?.getOverviewData(this._orderDirection, this._orderBy, this._pageNumber, this._pageSize);\r\n }\r\n\r\n #onChange(event: UUIPaginationEvent) {\r\n this._pageNumber = event.target.current;\r\n this.#getStatsData();\r\n }\r\n\r\n private _sortingHandler(column: string) {\r\n this._sortingDesc = this._orderBy === column ? !this._sortingDesc : false;\r\n this._orderBy = column;\r\n this._pageNumber = 1;\r\n\r\n this.#getStatsData();\r\n }\r\n\r\n #renderPagination() {\r\n if (this._data?.totalPages === 1) return;\r\n return html`\r\n \r\n \r\n `;\r\n }\r\n\r\n render() {\r\n if (!this._loaded) {\r\n return html`\r\n
\r\n \r\n
`;\r\n }\r\n else {\r\n return html`\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n this._sortingHandler('RequestDate')}>\r\n Last Run Date\r\n \r\n \r\n \r\n \r\n \r\n this._sortingHandler('CarbonRating')}>\r\n Carbon Rating\r\n \r\n \r\n \r\n \r\n Images\r\n Scripts\r\n Links\r\n CSS\r\n Other\r\n \r\n this._sortingHandler('TotalSize')}>\r\n Page Size\r\n \r\n \r\n \r\n \r\n \r\n this._sortingHandler('TotalEmissions')}>\r\n CO₂ per page view\r\n \r\n \r\n \r\n \r\n \r\n ${repeat(\r\n this._data?.items!,\r\n (item: PageMetric) => item,\r\n (item: PageMetric) => html`\r\n \r\n \r\n \r\n ${item.nodeName}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n ${item.pageDataObject?.resourceGroups?.find(x => x.name === 'Images')?.resources?.length}\r\n \r\n\r\n \r\n ${item.pageDataObject?.resourceGroups?.find(x => x.name === 'Scripts')?.resources?.length}\r\n \r\n\r\n \r\n ${item.pageDataObject?.resourceGroups?.find(x => x.name === 'Links')?.resources?.length}\r\n \r\n\r\n \r\n ${item.pageDataObject?.resourceGroups?.find(x => x.name === 'CSS')?.resources?.length}\r\n \r\n\r\n \r\n ${item.pageDataObject?.resourceGroups?.find(x => x.name === 'Other')?.resources?.length}\r\n \r\n\r\n \r\n ${(item.totalSize / 1024).toFixed(2)}KB\r\n \r\n\r\n \r\n ${item.totalEmissions.toFixed(4)}g\r\n \r\n \r\n `\r\n )}\r\n \r\n\r\n ${this.#renderPagination()}\r\n \r\n
\r\n
\r\n `;\r\n }\r\n }\r\n\r\n static styles = [\r\n css`\r\n #loader-container {\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\tjustify-content: center;\r\n\t\t\t\talign-items: center;\r\n\t\t\t\tmargin: 0 var(--uui-size-space-4);\r\n\t\t\t}\r\n `\r\n ]\r\n}\r\n\r\nexport default StatsRootWorkspaceElement;\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n [elementName]: StatsRootWorkspaceElement;\r\n }\r\n}\r\n"],"names":["DirectionModel","_sustainabilityContext","_localizeDateOptions","_getStatsData","getStatsData_fn","_onChange","onChange_fn","_renderPagination","renderPagination_fn","elementName","StatsRootWorkspaceElement","UmbLitElement","__privateAdd","SUSTAINABILITY_CONTEXT","instance","__privateSet","__privateGet","data","__privateMethod","column","html","repeat","_a","item","_d","_c","_b","x","_h","_g","_f","_e","_l","_k","_j","_i","_p","_o","_n","_m","_t","_s","_r","_q","event","css","__decorateClass","state","property","customElement","StatsRootWorkspaceElement$1"],"mappings":";;;AAQY,IAAAA,sBAAAA,OACRA,EAAA,YAAY,aACZA,EAAA,aAAa,cAFLA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;uJCRZC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC;AAMA,MAAMC,IAAc;AAGP,IAAAC,IAAN,cAAwCC,EAAe;AAAA,EAkC5D,cAAc;AACN,aAeRC,EAAA,MAAAT,CAAA,GASAS,EAAA,MAAAP,CAAA,GAaAO,EAAA,MAAAL,CAAA,GAtEAK,EAAA,MAAAX,GAAA,MAAA,GAEmDW,EAAA,MAAAV,GAAA;AAAA,MACjD,MAAM;AAAA,MACN,OAAO;AAAA,MACP,KAAK;AAAA,MACL,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,QAAQ;AAAA,IAAA,CACV,GAMoB,KAAA,UAAA,IAGL,KAAA,eAAA,IAGf,KAAA,kBAAkCF,EAAe,YAG9B,KAAA,WAAA,eAGL,KAAA,cAAA,GAGF,KAAA,YAAA,IAKL,KAAA,eAAea,GAAwB,CAACC,MAAa;AACxD,MAAAC,EAAA,MAAKd,GAAyBa,CAAA,GAE9B,KAAK,QAAQE,EAAA,MAAKf,CAAuB,EAAA,cAAc,CAACgB,MAAS;AAC/D,QAAKA,MACL,KAAK,UAAU,IACf,KAAK,QAAQA;AAAA,MAAA,CACd,GAEDC,EAAA,MAAKf,GAALC,CAAA,EAAA,KAAA,IAAA;AAAA,IAAA,CACD;AAAA,EACH;AAAA,EAgBQ,gBAAgBe,GAAgB;AACtC,SAAK,eAAe,KAAK,aAAaA,IAAS,CAAC,KAAK,eAAe,IACpE,KAAK,WAAWA,GAChB,KAAK,cAAc,GAEnBD,EAAA,MAAKf,GAALC,CAAA,EAAA,KAAA,IAAA;AAAA,EACF;AAAA,EAaA,SAAS;;AACH,WAAC,KAAK,UAODgB;AAAA;A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oC,EAAA;AAAA,EADNG,EAAcxC,CAAW;AAAA,GACbC,CAAA;AA+Nb,MAAAwC,IAAexC;"} \ No newline at end of file diff --git a/src/Umbraco.Community.Sustainability/wwwroot/App_Plugins/Umbraco.Community.Sustainability/umbraco-package.json b/src/Umbraco.Community.Sustainability/wwwroot/App_Plugins/Umbraco.Community.Sustainability/umbraco-package.json index 787ab50..1fc0591 100644 --- a/src/Umbraco.Community.Sustainability/wwwroot/App_Plugins/Umbraco.Community.Sustainability/umbraco-package.json +++ b/src/Umbraco.Community.Sustainability/wwwroot/App_Plugins/Umbraco.Community.Sustainability/umbraco-package.json @@ -2,7 +2,7 @@ "$schema": "../umbraco-package-schema.json", "name": "Umbraco.Community.Sustainability", "id": "Umbraco.Community.Sustainability", - "version": "2.0.5", + "version": "2.0.6", "allowTelemetry": true, "extensions": [ {