@epigraph/epigraph-std-lib 4.0.0-alpha → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -14
- package/dist/Epigraph/epigraph.js +20 -84
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +69 -0
- package/dist/EpigraphLibs/EpigraphAnalytics/generics/queue.d.ts +3 -2
- package/dist/EpigraphLibs/EpigraphAnalytics/types/index.d.ts +7 -0
- package/dist/EpigraphLibs/{epigraphLogger.js → EpigraphLogger/epigraphLogger.js} +19 -19
- package/dist/EpigraphLibs/{epigraphNexusApi.js → EpigraphNexusApi/epigraphNexusApi.js} +1 -1
- package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js +69 -0
- package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js +67 -0
- package/dist/lib/Epigraph/constants/enums.js +4 -0
- package/dist/lib/Epigraph/epigraphBaseSolution.js +70 -0
- package/dist/lib/EpigraphLibs/EpigraphAnalytics/consent-plugins/consent-plugin-names.js +4 -0
- package/dist/lib/EpigraphLibs/EpigraphAnalytics/consent-plugins/one-trust-consent-plugin.js +29 -0
- package/dist/lib/EpigraphLibs/EpigraphAnalytics/generics/node.js +22 -0
- package/dist/lib/EpigraphLibs/EpigraphAnalytics/generics/queue.js +23 -0
- package/dist/lib/EpigraphLibs/EpigraphAnalytics/generics/single-linked-list.js +30 -0
- package/dist/lib/EpigraphLibs/EpigraphAnalytics/plugins/ga3-analytics-plugin.js +87 -0
- package/dist/lib/EpigraphLibs/EpigraphAnalytics/plugins/ga4-analytics-plugin.js +121 -0
- package/dist/lib/EpigraphLibs/EpigraphAnalytics/plugins/nexus-analytics-plugin.js +45 -0
- package/dist/lib/EpigraphLibs/EpigraphUnitsConverter/conversions.js +26 -0
- package/dist/lib/EpigraphLibs/EpigraphUnitsConverter/enums.js +5 -0
- package/dist/node_modules/lit-html/async-directive.js +67 -0
- package/dist/node_modules/lit-html/directive-helpers.js +10 -0
- package/dist/node_modules/lit-html/directive.js +27 -0
- package/dist/node_modules/lit-html/directives/ref.js +40 -0
- package/dist/node_modules/lit-html/lit-html.js +225 -0
- package/dist/vite-env.d.ts +1 -0
- package/package.json +41 -74
- package/dist/EpigraphLibs/epigraphAnalytics.js +0 -399
- package/dist/EpigraphLibs/epigraphQrCodeGenerator.js +0 -938
- package/dist/EpigraphLibs/epigraphUnitsConverter.js +0 -88
- package/dist/ThirdPartyLibs/modelViewer.d.ts +0 -2
- package/dist/ThirdPartyLibs/modelViewer.js +0 -8608
- package/dist/ThirdPartyLibs/three-gltf-extensions/exporters/KHR_materials_variants/KHR_materials_variants_exporter.d.ts +0 -9
- package/dist/ThirdPartyLibs/three-gltf-extensions/loaders/KHR_materials_variants/KHR_materials_variants.d.ts +0 -6
- package/dist/ThirdPartyLibs/threejs.d.ts +0 -13
- package/dist/ThirdPartyLibs/threejs.js +0 -800
- package/dist/chunks/VerticalBlurShader.B0rdEBFu.js +0 -26381
- /package/dist/EpigraphLibs/{epigraphResultFactory.js → EpigraphResultFactory/epigraphResultFactory.js} +0 -0
- /package/dist/EpigraphLibs/{epigraphUrlProcessor.js → EpigraphUrlProcessor/epigraphUrlProcessor.js} +0 -0
package/README.md
CHANGED
|
@@ -17,14 +17,6 @@ A global object that must only be initialized once per session and provides some
|
|
|
17
17
|
| EpigraphUrlProcessor | |
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
### 3rd PARTY LIBRARY EXPORTS
|
|
21
|
-
|
|
22
|
-
| Name | Version |
|
|
23
|
-
|---|---|
|
|
24
|
-
| [three](https://threejs.org/) |  |
|
|
25
|
-
| [model-viewer](https://modelviewer.dev/) |  |
|
|
26
|
-
|
|
27
|
-
|
|
28
20
|
# HOW TO:
|
|
29
21
|
|
|
30
22
|
### Add a new EpigraphLibrary:
|
|
@@ -46,9 +38,6 @@ import { Epigraph } from "@epigraph/epigraph-std-lib/dist/Epigraph/epigraph";
|
|
|
46
38
|
// Epigraph libs
|
|
47
39
|
import { EpigraphAnalytics } from "@epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphAnalytics";
|
|
48
40
|
|
|
49
|
-
// Third Party libs
|
|
50
|
-
import { Scene } from "@epigraph/epigraph-std-lib/dist/ThirdPartyLibs/threejs";
|
|
51
|
-
|
|
52
41
|
```
|
|
53
42
|
|
|
54
43
|
Exported Submodules:
|
|
@@ -62,9 +51,6 @@ Exported Submodules:
|
|
|
62
51
|
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphResultFactory | A Result Factory modules that exports handy ways to generate Result objects across our solutions |
|
|
63
52
|
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphUnitsConverter | A Utility class that allows conversion between different standard unit, including but not limited to Distance, Color, etc. |
|
|
64
53
|
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphUrlProcessor | A Utility class that provides various methods to generate, process, manipulate URLs |
|
|
65
|
-
| @epigraph/epigraph-std-lib/dist/ThirdPartyLibs/threejs | A three.js modules that exports the three.js library |
|
|
66
|
-
| @epigraph/epigraph-std-lib/dist/ThirdPartyLibs/modelViewer | A model-viewer modules that exports the model-viewer library |
|
|
67
|
-
|
|
68
54
|
|
|
69
55
|
|
|
70
56
|
### Write a test:
|
|
@@ -1,80 +1,16 @@
|
|
|
1
|
-
import { EpigraphLogger as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
class
|
|
6
|
-
constructor(e, t) {
|
|
7
|
-
super(), this._isReady = !1, this._elementName = "epigraph-base-solution-html", this._solutionVersion = "", this._loggerContextOverride = "[EPIGRAPH BASE SOLUTION]", this.attachShadow({ mode: "open" }), this._environment = t, this._solutionVersion = e, this._xPath = i.generateXPath(this), this._uuid = i.safeGenerateUuid() ?? this._xPath, new i(this), window.epigraph.logger.info({
|
|
8
|
-
title: "Epigraph Base Solution Ready",
|
|
9
|
-
contextOverride: this._loggerContextOverride
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
get isReady() {
|
|
13
|
-
return this._isReady;
|
|
14
|
-
}
|
|
15
|
-
get environment() {
|
|
16
|
-
return this._environment;
|
|
17
|
-
}
|
|
18
|
-
get elementName() {
|
|
19
|
-
return this._elementName;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* This is the npm package version of this solution.
|
|
23
|
-
*/
|
|
24
|
-
get solutionVersion() {
|
|
25
|
-
return this._solutionVersion;
|
|
26
|
-
}
|
|
27
|
-
get uuid() {
|
|
28
|
-
return this._uuid;
|
|
29
|
-
}
|
|
30
|
-
get xPath() {
|
|
31
|
-
return this._xPath;
|
|
32
|
-
}
|
|
33
|
-
disconnectedCallback() {
|
|
34
|
-
window.epigraph.deregisterActiveComponent(this);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
class C extends p {
|
|
38
|
-
constructor(e, t) {
|
|
39
|
-
super(), this._isReady = !1, this._elementName = "epigraph-base-solution-lit", this._solutionVersion = "", this._loggerContextOverride = "[EPIGRAPH BASE SOLUTION]", this._environment = t, this._solutionVersion = e, this._xPath = i.generateXPath(this), this._uuid = i.safeGenerateUuid() ?? this._xPath, new i(this), this._isReady = !0, window.epigraph.logger.info({
|
|
40
|
-
title: "Epigraph Base Solution Ready",
|
|
41
|
-
contextOverride: this._loggerContextOverride
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
get isReady() {
|
|
45
|
-
return this._isReady;
|
|
46
|
-
}
|
|
47
|
-
get environment() {
|
|
48
|
-
return this._environment;
|
|
49
|
-
}
|
|
50
|
-
get elementName() {
|
|
51
|
-
return this._elementName;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* This is the npm package version of this solution.
|
|
55
|
-
*/
|
|
56
|
-
get solutionVersion() {
|
|
57
|
-
return this._solutionVersion;
|
|
58
|
-
}
|
|
59
|
-
get uuid() {
|
|
60
|
-
return this._uuid;
|
|
61
|
-
}
|
|
62
|
-
get xPath() {
|
|
63
|
-
return this._xPath;
|
|
64
|
-
}
|
|
65
|
-
disconnectedCallback() {
|
|
66
|
-
window.epigraph.deregisterActiveComponent(this);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
class i {
|
|
1
|
+
import { EpigraphLogger as a, LoggerModeNames as r } from "../EpigraphLibs/EpigraphLogger/epigraphLogger.js";
|
|
2
|
+
import { ENVIRONMENT_TYPE as s } from "../lib/Epigraph/constants/enums.js";
|
|
3
|
+
import { EpigraphUrlProcessor as p, QUERY_PARAMETER_NAMES as l } from "../EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js";
|
|
4
|
+
import { EpigraphBaseSolutionHtmlElement as w, EpigraphBaseSolutionLitElement as I } from "../lib/Epigraph/epigraphBaseSolution.js";
|
|
5
|
+
class g {
|
|
70
6
|
constructor(e) {
|
|
71
|
-
if (this._loggerContext = "EPIGRAPH", this._isReady = !1, this._logger = new
|
|
7
|
+
if (this._loggerContext = "EPIGRAPH", this._isReady = !1, this._logger = new a("EPIGRAPH LOGGER"), this._environment = s.DEVELOPMENT, this._activeComponentsInSession = /* @__PURE__ */ new Map(), this._staleComponentsInSession = /* @__PURE__ */ new Map(), window.epigraph)
|
|
72
8
|
return window.epigraph.registerActiveComponent(e), window.epigraph;
|
|
73
9
|
window.epigraph = this, window.epigraph.registerActiveComponent(e), this.logBranding(), this._initializer = e, this._environment = this._initializer.environment;
|
|
74
10
|
const t = this.getLoggerModeNameFromEnvironment();
|
|
75
|
-
this._logger.setCurrentMode(t), this._urlProcessor = new
|
|
76
|
-
const
|
|
77
|
-
this._epigraphSessionId =
|
|
11
|
+
this._logger.setCurrentMode(t), this._urlProcessor = new p(), this.id = g.safeGenerateUuid();
|
|
12
|
+
const i = this._urlProcessor.getParameterInUrl(l.epigraphSessionId);
|
|
13
|
+
this._epigraphSessionId = i ?? g.safeGenerateUuid(), this._logger.info({ title: "Epigraph Object Ready!!", details: this, contextOverride: this._loggerContext }), this._isReady = !0;
|
|
78
14
|
}
|
|
79
15
|
get isReady() {
|
|
80
16
|
return this._isReady;
|
|
@@ -135,8 +71,8 @@ class i {
|
|
|
135
71
|
* @returns {LoggerModeNames} A valid logger mode name.
|
|
136
72
|
*/
|
|
137
73
|
getLoggerModeNameFromEnvironment() {
|
|
138
|
-
let e =
|
|
139
|
-
return this._environment ===
|
|
74
|
+
let e = r.Dev;
|
|
75
|
+
return this._environment === s.STAGING ? e = r.Staging : this._environment === s.PRODUCTION && (e = r.Release), e;
|
|
140
76
|
}
|
|
141
77
|
/**
|
|
142
78
|
* Generates a random UUID using crypto.randomUUID with a fallback on custom generator,
|
|
@@ -160,19 +96,19 @@ class i {
|
|
|
160
96
|
* @returns {string} The generated XPath.
|
|
161
97
|
*/
|
|
162
98
|
static generateXPath(e) {
|
|
163
|
-
let t = "",
|
|
164
|
-
for (;
|
|
165
|
-
let
|
|
166
|
-
for (;
|
|
167
|
-
|
|
168
|
-
t = `/${
|
|
99
|
+
let t = "", i = e;
|
|
100
|
+
for (; i; ) {
|
|
101
|
+
let o = 1, n = i.previousSibling;
|
|
102
|
+
for (; n; )
|
|
103
|
+
n.nodeName === i.nodeName && o++, n = n.previousSibling;
|
|
104
|
+
t = `/${i.nodeName.toLowerCase() + (o > 1 ? `[${o}]` : "")}${t}`, i = i.parentNode;
|
|
169
105
|
}
|
|
170
106
|
return t;
|
|
171
107
|
}
|
|
172
108
|
}
|
|
173
109
|
export {
|
|
174
|
-
|
|
175
|
-
|
|
110
|
+
s as ENVIRONMENT_TYPE,
|
|
111
|
+
g as Epigraph,
|
|
176
112
|
w as EpigraphBaseSolutionHtmlElement,
|
|
177
|
-
|
|
113
|
+
I as EpigraphBaseSolutionLitElement
|
|
178
114
|
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { GA3AnalyticsPlugin as c } from "../../lib/EpigraphLibs/EpigraphAnalytics/plugins/ga3-analytics-plugin.js";
|
|
2
|
+
import { GA4AnalyticsPlugin as f } from "../../lib/EpigraphLibs/EpigraphAnalytics/plugins/ga4-analytics-plugin.js";
|
|
3
|
+
import { NexusAnalyticsPlugin as m } from "../../lib/EpigraphLibs/EpigraphAnalytics/plugins/nexus-analytics-plugin.js";
|
|
4
|
+
import { OneTrustConsentPlugin as e } from "../../lib/EpigraphLibs/EpigraphAnalytics/consent-plugins/one-trust-consent-plugin.js";
|
|
5
|
+
import { ConsentPluginNames as l } from "../../lib/EpigraphLibs/EpigraphAnalytics/consent-plugins/consent-plugin-names.js";
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright (c) 2023 Epigraph LLC. All Rights Reserved.
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the 'License');
|
|
11
|
+
* you may not use this file except in compliance with the License.
|
|
12
|
+
* You may obtain a copy of the License at
|
|
13
|
+
*
|
|
14
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
* distributed under the License is distributed on an 'AS IS' BASIS,
|
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
* See the License for the specific language governing permissions and
|
|
20
|
+
* limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
var s;
|
|
23
|
+
const i = Symbol("analyticsPluginsMap");
|
|
24
|
+
s = i;
|
|
25
|
+
class a {
|
|
26
|
+
constructor(n, t) {
|
|
27
|
+
this[s] = /* @__PURE__ */ new Map(), this._consentPlugin = null, n && t && (this._consentPlugin = this.buildConsentPlugin(n, t));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Epigraph Analytics uses plugins to send events to multiple trackers at a time. You can create a customer tracker
|
|
31
|
+
* by implementing the IAnalyticsPlugin and then adding it via this function. This will also hold only a single
|
|
32
|
+
* instance of a plugin with a given Tracking Identifier.
|
|
33
|
+
*
|
|
34
|
+
* @param plugin
|
|
35
|
+
*/
|
|
36
|
+
addEventPlugin(n) {
|
|
37
|
+
this[i].has(n.getUniquePluginIdentifier()) || (this[i].set(
|
|
38
|
+
n.getUniquePluginIdentifier(),
|
|
39
|
+
n
|
|
40
|
+
), n.setupPlugin());
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Send an Event to all plugins
|
|
44
|
+
*
|
|
45
|
+
* @param eventData
|
|
46
|
+
*/
|
|
47
|
+
sendEvent(n) {
|
|
48
|
+
this[i].forEach((t) => {
|
|
49
|
+
t.sendEvent(n, this._consentPlugin);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Returns an IConsentPlugin if something is passed to it. Returns null if we can't find the plugin named.
|
|
54
|
+
* @param consentPluginName
|
|
55
|
+
* @param consentIdentifier
|
|
56
|
+
* @private
|
|
57
|
+
*/
|
|
58
|
+
buildConsentPlugin(n, t) {
|
|
59
|
+
return n.toLowerCase() === l.OneTrust.toLowerCase() ? new e(t) : null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
l as ConsentPluginNames,
|
|
64
|
+
a as EpigraphAnalytics,
|
|
65
|
+
c as GA3AnalyticsPlugin,
|
|
66
|
+
f as GA4AnalyticsPlugin,
|
|
67
|
+
m as NexusAnalyticsPlugin,
|
|
68
|
+
e as OneTrustConsentPlugin
|
|
69
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as SLL } from './single-linked-list.js';
|
|
2
|
+
import { AnalyticsEvent } from '../analytics-event-interface.ts';
|
|
2
3
|
declare const $queue: unique symbol;
|
|
3
4
|
declare const $size: unique symbol;
|
|
4
5
|
export default class Queue {
|
|
@@ -7,7 +8,7 @@ export default class Queue {
|
|
|
7
8
|
constructor();
|
|
8
9
|
get queue(): SLL;
|
|
9
10
|
get size(): number;
|
|
10
|
-
enqueue(data:
|
|
11
|
-
dequeue():
|
|
11
|
+
enqueue(data: AnalyticsEvent): void;
|
|
12
|
+
dequeue(): AnalyticsEvent;
|
|
12
13
|
}
|
|
13
14
|
export {};
|
|
@@ -58,14 +58,14 @@ class a {
|
|
|
58
58
|
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
59
59
|
* that was provided at the time of initialisation of this class.
|
|
60
60
|
*/
|
|
61
|
-
info({ title: o, details:
|
|
61
|
+
info({ title: o, details: r = "", contextOverride: e = void 0 }) {
|
|
62
62
|
if (!this._isLogTypeAllowedInCurrentMode(
|
|
63
63
|
"info"
|
|
64
64
|
/* Info */
|
|
65
65
|
))
|
|
66
66
|
return;
|
|
67
|
-
const
|
|
68
|
-
console.groupCollapsed(`[${
|
|
67
|
+
const n = e || this.context;
|
|
68
|
+
console.groupCollapsed(`[${n}]: ${o}`), console.log(r), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* A warning log type that let's the user know that some action that could be dangerous was just
|
|
@@ -78,14 +78,14 @@ class a {
|
|
|
78
78
|
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
79
79
|
* that was provided at the time of initialisation of this class.
|
|
80
80
|
*/
|
|
81
|
-
warn({ title: o, details:
|
|
81
|
+
warn({ title: o, details: r = "", contextOverride: e = void 0 }) {
|
|
82
82
|
if (!this._isLogTypeAllowedInCurrentMode(
|
|
83
83
|
"warn"
|
|
84
84
|
/* Warn */
|
|
85
85
|
))
|
|
86
86
|
return;
|
|
87
|
-
const
|
|
88
|
-
console.groupCollapsed(`%c[${
|
|
87
|
+
const n = e || this.context;
|
|
88
|
+
console.groupCollapsed(`%c[${n}]: ${o}`, "color: orange;"), console.warn(r), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* A critical error log type that let's the user know that some action that was unexpected and required immediate attention.
|
|
@@ -97,14 +97,14 @@ class a {
|
|
|
97
97
|
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
98
98
|
* that was provided at the time of initialisation of this class.
|
|
99
99
|
*/
|
|
100
|
-
error({ title: o, details:
|
|
100
|
+
error({ title: o, details: r = "", contextOverride: e = void 0 }) {
|
|
101
101
|
if (!this._isLogTypeAllowedInCurrentMode(
|
|
102
102
|
"error"
|
|
103
103
|
/* Error */
|
|
104
104
|
))
|
|
105
105
|
return;
|
|
106
|
-
const
|
|
107
|
-
console.groupCollapsed(`%c[${
|
|
106
|
+
const n = e || this.context;
|
|
107
|
+
console.groupCollapsed(`%c[${n}]: ${o}`, "color: red;"), console.error(r), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* A table log type that can show an object in an organised manner within the console.
|
|
@@ -121,15 +121,15 @@ class a {
|
|
|
121
121
|
*/
|
|
122
122
|
table({
|
|
123
123
|
title: o,
|
|
124
|
-
details:
|
|
124
|
+
details: r = {},
|
|
125
125
|
contextOverride: e = void 0,
|
|
126
|
-
logType:
|
|
126
|
+
logType: n = "info"
|
|
127
127
|
/* Info */
|
|
128
128
|
}) {
|
|
129
|
-
if (!this._isLogTypeAllowedInCurrentMode(
|
|
129
|
+
if (!this._isLogTypeAllowedInCurrentMode(n))
|
|
130
130
|
return;
|
|
131
131
|
const s = e || this.context;
|
|
132
|
-
console.groupCollapsed(`[${s}]: ${o}`), console.table(
|
|
132
|
+
console.groupCollapsed(`[${s}]: ${o}`), console.table(r), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
135
|
* Begins an expanded group with the browser's console window.
|
|
@@ -146,14 +146,14 @@ class a {
|
|
|
146
146
|
*/
|
|
147
147
|
group({
|
|
148
148
|
title: o,
|
|
149
|
-
contextOverride:
|
|
149
|
+
contextOverride: r = void 0,
|
|
150
150
|
logType: e = "info"
|
|
151
151
|
/* Info */
|
|
152
152
|
}) {
|
|
153
153
|
if (!this._isLogTypeAllowedInCurrentMode(e))
|
|
154
154
|
return;
|
|
155
|
-
const
|
|
156
|
-
console.group(`%c ${
|
|
155
|
+
const n = r || this.context;
|
|
156
|
+
console.group(`%c ${n} GROUP`, o);
|
|
157
157
|
}
|
|
158
158
|
/**
|
|
159
159
|
* Begins a collapsed group with the browser's console window.
|
|
@@ -170,14 +170,14 @@ class a {
|
|
|
170
170
|
*/
|
|
171
171
|
groupCollapsed({
|
|
172
172
|
title: o,
|
|
173
|
-
contextOverride:
|
|
173
|
+
contextOverride: r = void 0,
|
|
174
174
|
logType: e = "info"
|
|
175
175
|
/* Info */
|
|
176
176
|
}) {
|
|
177
177
|
if (!this._isLogTypeAllowedInCurrentMode(e))
|
|
178
178
|
return;
|
|
179
|
-
const
|
|
180
|
-
console.groupCollapsed(`%c ${
|
|
179
|
+
const n = r || this.context;
|
|
180
|
+
console.groupCollapsed(`%c ${n} GROUP`, o);
|
|
181
181
|
}
|
|
182
182
|
/**
|
|
183
183
|
* Similar to the console.groupEnd(). Useful for ending either a group or
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { failureResult as p, successResult as u } from "
|
|
1
|
+
import { failureResult as p, successResult as u } from "../EpigraphResultFactory/epigraphResultFactory.js";
|
|
2
2
|
class x {
|
|
3
3
|
/**
|
|
4
4
|
* Constructs a new instance of the class with the provided parameters.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { LitElement as s, css as i, html as l } from "lit";
|
|
2
|
+
import { createRef as c, ref as m } from "../../node_modules/lit-html/directives/ref.js";
|
|
3
|
+
import d from "qr-creator";
|
|
4
|
+
class a extends s {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments), this._qrCodeGenCanvasRef = c();
|
|
7
|
+
}
|
|
8
|
+
static {
|
|
9
|
+
this.webComponentName = "epigraph-qr-code-generator";
|
|
10
|
+
}
|
|
11
|
+
static {
|
|
12
|
+
this.styles = i`
|
|
13
|
+
:host {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Converts any given data uri to a blob.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} dataUri Raw data URI, either fetched from an HTML Canvas or any other valid source.
|
|
22
|
+
* @returns {Blob} The generate blob.
|
|
23
|
+
*/
|
|
24
|
+
dataUritoBlob(e) {
|
|
25
|
+
const t = atob(e.split(",")[1]), r = e.split(",")[0].split(":")[1].split(";")[0], o = [];
|
|
26
|
+
for (let n = 0; n < t.length; n++)
|
|
27
|
+
o.push(t.charCodeAt(n));
|
|
28
|
+
return new Blob([new Uint8Array(o)], { type: r });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Generates a QR code as image data url for the qrCodeContent provided.
|
|
32
|
+
*
|
|
33
|
+
* @param {string} qrCodeContent The content to be embedded in the QR code.
|
|
34
|
+
* @returns {string} Session data URL for the generated QR code.
|
|
35
|
+
*/
|
|
36
|
+
generateQrCode(e = {
|
|
37
|
+
text: "www.epigraph.us",
|
|
38
|
+
radius: 0.5,
|
|
39
|
+
// 0.0 to 0.5
|
|
40
|
+
ecLevel: "H",
|
|
41
|
+
// L, M, Q, H
|
|
42
|
+
fill: "black",
|
|
43
|
+
// foreground color
|
|
44
|
+
background: null,
|
|
45
|
+
// color or null for transparent
|
|
46
|
+
size: 256
|
|
47
|
+
// in pixels
|
|
48
|
+
}) {
|
|
49
|
+
if (!this._qrCodeGenCanvasRef.value)
|
|
50
|
+
return "";
|
|
51
|
+
d.render(e, this._qrCodeGenCanvasRef.value);
|
|
52
|
+
const t = this._qrCodeGenCanvasRef.value.toDataURL(), r = this.dataUritoBlob(t);
|
|
53
|
+
return URL.createObjectURL(r);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Override for the LitElement's render method.
|
|
57
|
+
*
|
|
58
|
+
* @returns {html} HTML to be rendered by this component.
|
|
59
|
+
*/
|
|
60
|
+
render() {
|
|
61
|
+
return l`
|
|
62
|
+
<canvas id="qrCode" ${m(this._qrCodeGenCanvasRef)}></canvas>
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
window.customElements.get(a.webComponentName) === void 0 && window.customElements.define(a.webComponentName, a);
|
|
67
|
+
export {
|
|
68
|
+
a as EpigraphQrCodeGenerator
|
|
69
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ConversionFactors as s } from "../../lib/EpigraphLibs/EpigraphUnitsConverter/conversions.js";
|
|
2
|
+
import { UnitTypes as o, DistanceUnits as t } from "../../lib/EpigraphLibs/EpigraphUnitsConverter/enums.js";
|
|
3
|
+
class e {
|
|
4
|
+
constructor(i, r) {
|
|
5
|
+
if (this._type = o.DISTANCE, this._rawValue = i, this._rawValueUnit = r, r !== t.meter) {
|
|
6
|
+
const n = e.convert(this._rawValue, r, t.meter);
|
|
7
|
+
this._rawValue = n.value, this._rawValueUnit = n.valueUnit;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
get type() {
|
|
11
|
+
return this._type;
|
|
12
|
+
}
|
|
13
|
+
static buildConvertedUnitResult(i, r) {
|
|
14
|
+
return {
|
|
15
|
+
value: i,
|
|
16
|
+
valueUnit: r,
|
|
17
|
+
valueWithUnit: `${i.toFixed(2)}${r}`
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static convert(i, r, n) {
|
|
21
|
+
let a = i, u = n;
|
|
22
|
+
if (r === n)
|
|
23
|
+
return e.buildConvertedUnitResult(a, u);
|
|
24
|
+
const l = s[`${r}-${n}`];
|
|
25
|
+
return a = i * l, e.buildConvertedUnitResult(a, u);
|
|
26
|
+
}
|
|
27
|
+
/** ----------------- METRIC UNITS ----------------- */
|
|
28
|
+
get inMillimeters() {
|
|
29
|
+
return e.convert(this._rawValue, this._rawValueUnit, t.millimeter);
|
|
30
|
+
}
|
|
31
|
+
get inCentimeters() {
|
|
32
|
+
return e.convert(this._rawValue, this._rawValueUnit, t.centimeter);
|
|
33
|
+
}
|
|
34
|
+
get inDecimeters() {
|
|
35
|
+
return e.convert(this._rawValue, this._rawValueUnit, t.decimeter);
|
|
36
|
+
}
|
|
37
|
+
get inMeters() {
|
|
38
|
+
return e.convert(this._rawValue, this._rawValueUnit, t.meter);
|
|
39
|
+
}
|
|
40
|
+
get inDecameters() {
|
|
41
|
+
return e.convert(this._rawValue, this._rawValueUnit, t.decameter);
|
|
42
|
+
}
|
|
43
|
+
get inHectometers() {
|
|
44
|
+
return e.convert(this._rawValue, this._rawValueUnit, t.hectometer);
|
|
45
|
+
}
|
|
46
|
+
get inKilometers() {
|
|
47
|
+
return e.convert(this._rawValue, this._rawValueUnit, t.kilometer);
|
|
48
|
+
}
|
|
49
|
+
/** ----------------- METRIC UNITS ----------------- */
|
|
50
|
+
get inInches() {
|
|
51
|
+
return e.convert(this._rawValue, this._rawValueUnit, t.inch);
|
|
52
|
+
}
|
|
53
|
+
get inFeet() {
|
|
54
|
+
return e.convert(this._rawValue, this._rawValueUnit, t.foot);
|
|
55
|
+
}
|
|
56
|
+
get inYard() {
|
|
57
|
+
return e.convert(this._rawValue, this._rawValueUnit, t.yard);
|
|
58
|
+
}
|
|
59
|
+
get inMiles() {
|
|
60
|
+
return e.convert(this._rawValue, this._rawValueUnit, t.mile);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
e as Distance,
|
|
65
|
+
t as DistanceUnits,
|
|
66
|
+
o as UnitTypes
|
|
67
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { LitElement as s } from "lit";
|
|
2
|
+
import { Epigraph as e } from "../../Epigraph/epigraph.js";
|
|
3
|
+
class h extends HTMLElement {
|
|
4
|
+
constructor(t, i) {
|
|
5
|
+
super(), this._isReady = !1, this._elementName = "epigraph-base-solution-html", this._solutionVersion = "", this._loggerContextOverride = "[EPIGRAPH BASE SOLUTION]", this.attachShadow({ mode: "open" }), this._environment = i, this._solutionVersion = t, this._xPath = e.generateXPath(this), this._uuid = e.safeGenerateUuid() ?? this._xPath, new e(this), window.epigraph.logger.info({
|
|
6
|
+
title: "Epigraph Base Solution Ready",
|
|
7
|
+
contextOverride: this._loggerContextOverride
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
get isReady() {
|
|
11
|
+
return this._isReady;
|
|
12
|
+
}
|
|
13
|
+
get environment() {
|
|
14
|
+
return this._environment;
|
|
15
|
+
}
|
|
16
|
+
get elementName() {
|
|
17
|
+
return this._elementName;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* This is the npm package version of this solution.
|
|
21
|
+
*/
|
|
22
|
+
get solutionVersion() {
|
|
23
|
+
return this._solutionVersion;
|
|
24
|
+
}
|
|
25
|
+
get uuid() {
|
|
26
|
+
return this._uuid;
|
|
27
|
+
}
|
|
28
|
+
get xPath() {
|
|
29
|
+
return this._xPath;
|
|
30
|
+
}
|
|
31
|
+
disconnectedCallback() {
|
|
32
|
+
window.epigraph.deregisterActiveComponent(this);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
class a extends s {
|
|
36
|
+
constructor(t, i) {
|
|
37
|
+
super(), this._isReady = !1, this._elementName = "epigraph-base-solution-lit", this._solutionVersion = "", this._loggerContextOverride = "[EPIGRAPH BASE SOLUTION]", this._environment = i, this._solutionVersion = t, this._xPath = e.generateXPath(this), this._uuid = e.safeGenerateUuid() ?? this._xPath, new e(this), this._isReady = !0, window.epigraph.logger.info({
|
|
38
|
+
title: "Epigraph Base Solution Ready",
|
|
39
|
+
contextOverride: this._loggerContextOverride
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
get isReady() {
|
|
43
|
+
return this._isReady;
|
|
44
|
+
}
|
|
45
|
+
get environment() {
|
|
46
|
+
return this._environment;
|
|
47
|
+
}
|
|
48
|
+
get elementName() {
|
|
49
|
+
return this._elementName;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* This is the npm package version of this solution.
|
|
53
|
+
*/
|
|
54
|
+
get solutionVersion() {
|
|
55
|
+
return this._solutionVersion;
|
|
56
|
+
}
|
|
57
|
+
get uuid() {
|
|
58
|
+
return this._uuid;
|
|
59
|
+
}
|
|
60
|
+
get xPath() {
|
|
61
|
+
return this._xPath;
|
|
62
|
+
}
|
|
63
|
+
disconnectedCallback() {
|
|
64
|
+
window.epigraph.deregisterActiveComponent(this);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
h as EpigraphBaseSolutionHtmlElement,
|
|
69
|
+
a as EpigraphBaseSolutionLitElement
|
|
70
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
class i {
|
|
2
|
+
constructor(t) {
|
|
3
|
+
this.consentSet = !1, this.consent = !1, this.pluginName = "OneTrustConsentPlugin", this.consentIdentifier = t, this.consent = !1, this.addConsentChangedListener();
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Checks to see if the user has consented. If this is false, it will block all analytics
|
|
7
|
+
*/
|
|
8
|
+
hasConsent() {
|
|
9
|
+
if (this.consentSet)
|
|
10
|
+
return this.consent;
|
|
11
|
+
if (window.OnetrustActiveGroup !== void 0) {
|
|
12
|
+
let t = window.OnetrustActiveGroup;
|
|
13
|
+
t !== void 0 && t.split(",").forEach((n) => {
|
|
14
|
+
n === this.consentIdentifier && (this.consent = !0, this.consentSet = !0);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return this.consent;
|
|
18
|
+
}
|
|
19
|
+
addConsentChangedListener() {
|
|
20
|
+
window.addEventListener("load", () => {
|
|
21
|
+
this.hasConsent(), window.OneTrust !== void 0 && typeof window.OneTrust == "object" && window.OneTrust.OnConsentChanged(() => {
|
|
22
|
+
this.consentSet = !1, this.hasConsent();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
i as OneTrustConsentPlugin
|
|
29
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const e = Symbol("data"), s = Symbol("next"), o = class n {
|
|
2
|
+
constructor(t) {
|
|
3
|
+
this[e] = t, this[s] = null;
|
|
4
|
+
}
|
|
5
|
+
get data() {
|
|
6
|
+
return this[e];
|
|
7
|
+
}
|
|
8
|
+
set next(t) {
|
|
9
|
+
if (!(t instanceof n) && t !== null)
|
|
10
|
+
throw new Error(
|
|
11
|
+
"This node is not an instance of the custom class 'Node'."
|
|
12
|
+
);
|
|
13
|
+
this[s] = t;
|
|
14
|
+
}
|
|
15
|
+
get next() {
|
|
16
|
+
return this[s];
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
let a = o;
|
|
20
|
+
export {
|
|
21
|
+
a as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import s from "./single-linked-list.js";
|
|
2
|
+
const u = Symbol("queue"), e = Symbol("size");
|
|
3
|
+
class r {
|
|
4
|
+
constructor() {
|
|
5
|
+
this[u] = new s(), this[e] = 0;
|
|
6
|
+
}
|
|
7
|
+
get queue() {
|
|
8
|
+
return this[u];
|
|
9
|
+
}
|
|
10
|
+
get size() {
|
|
11
|
+
return this[e];
|
|
12
|
+
}
|
|
13
|
+
enqueue(t) {
|
|
14
|
+
this.queue.addToTail(t), this[e]++;
|
|
15
|
+
}
|
|
16
|
+
dequeue() {
|
|
17
|
+
const t = this.queue.removeHead();
|
|
18
|
+
return this[e]--, t;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
r as default
|
|
23
|
+
};
|