@ntix/components-scorad 1.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/dist/@ntix/components-scorad.es.js +1523 -0
- package/dist/@ntix/components-scorad.umd.js +132 -0
- package/dist/ScoradData.d.ts +12 -0
- package/dist/ScoradExtentData.d.ts +17 -0
- package/dist/ScoradExtentWeights.d.ts +5 -0
- package/dist/ScoradIntensityData.d.ts +18 -0
- package/dist/ScoradResources.d.ts +9 -0
- package/dist/ScoradScore.d.ts +7 -0
- package/dist/ScoradSubjectiveData.d.ts +10 -0
- package/dist/component.d.ts +12 -0
- package/dist/componentsScoradLogger.d.ts +1 -0
- package/dist/constants.d.ts +22 -0
- package/dist/extent/component.d.ts +17 -0
- package/dist/extent/index.d.ts +1 -0
- package/dist/getScoradScore.d.ts +10 -0
- package/dist/index.d.ts +19 -0
- package/dist/intensity/component.d.ts +16 -0
- package/dist/intensity/index.d.ts +1 -0
- package/dist/label/component.d.ts +10 -0
- package/dist/label/index.d.ts +1 -0
- package/dist/options/component.d.ts +27 -0
- package/dist/options/index.d.ts +1 -0
- package/dist/selectScoradWeights.d.ts +9 -0
- package/dist/subjective/component.d.ts +16 -0
- package/dist/subjective/index.d.ts +1 -0
- package/dist/validateScoradData.d.ts +13 -0
- package/dist/weightings/component.d.ts +13 -0
- package/dist/weightings/index.d.ts +1 -0
- package/package.json +29 -0
- package/src/vars.css +56 -0
|
@@ -0,0 +1,1523 @@
|
|
|
1
|
+
var cache = /* @__PURE__ */ new Map(), asCachedStyle = (t) => t == null ? [] : (Array.isArray(t) || (t = [t]), t.map((t) => {
|
|
2
|
+
if (cache.has(t)) return cache.get(t);
|
|
3
|
+
let n = new CSSStyleSheet();
|
|
4
|
+
return n.replaceSync(t), cache.set(t, n), n;
|
|
5
|
+
})), getConstructorMetadata = (e) => {
|
|
6
|
+
let t = e;
|
|
7
|
+
return t.__metadata = t.__metadata ?? {
|
|
8
|
+
attributes: [],
|
|
9
|
+
watches: [],
|
|
10
|
+
events: []
|
|
11
|
+
}, t;
|
|
12
|
+
};
|
|
13
|
+
(() => {
|
|
14
|
+
let e = "__drag_attached";
|
|
15
|
+
return { list: (t, n, r) => {
|
|
16
|
+
if (t.dataset[e]) return;
|
|
17
|
+
t.dataset[e] = "true";
|
|
18
|
+
let i = (e, n) => e.find((e) => e instanceof HTMLElement && t.contains(e) && n(e)), a = (e, n, r = () => !0) => !(e instanceof Node) || !t.contains(e) ? null : e == null || e instanceof HTMLElement && r(e) ? e : a(n(e), n, r), o = (e) => a(e?.nextSibling, (e) => e?.nextSibling), s = (e, t) => (n) => n instanceof HTMLElement && (e ?? ((e) => e.classList.contains(t)))(n), c = () => Array.from(t.children).filter(u).reduce((e, t) => e.set(t, t.getBoundingClientRect()), /* @__PURE__ */ new Map()), l = s(r?.gripSelector, "drag-grip"), u = s(r?.itemSelector, "drag-item"), d, f, p, m = 0, h, g, ze = (e) => {
|
|
19
|
+
let n = e.composedPath();
|
|
20
|
+
d = i(n, l), d && (e.preventDefault(), e.stopPropagation(), window.getSelection()?.removeAllRanges(), f = c(), p = i(n, u), m = e.clientY, h = p.dataset.id, p.classList.add("dragging"), p.style.pointerEvents = "none", p.style.zIndex = "2", t.style.touchAction = "none", t.style.userSelect = "none", document.addEventListener("pointermove", _), document.addEventListener("pointerup", v));
|
|
21
|
+
}, _ = (e) => {
|
|
22
|
+
if (!p || !f) throw Error("drag item is undefined");
|
|
23
|
+
let n = f.get(p), r = null;
|
|
24
|
+
for (let [t, i] of f.entries()) {
|
|
25
|
+
if (t === p || e.clientY <= i.top || e.clientY >= i.bottom) continue;
|
|
26
|
+
e.stopPropagation();
|
|
27
|
+
let a = i.top + (n.bottom - i.top) / 2;
|
|
28
|
+
r = e.clientY > a ? o(t) : t;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
if (r) {
|
|
32
|
+
g = r instanceof HTMLElement ? r.dataset.id : void 0, t.insertBefore(p, r), p.style.transform = "";
|
|
33
|
+
var i = n.top;
|
|
34
|
+
f = c(), m += f.get(p).top - i, d?.focus();
|
|
35
|
+
}
|
|
36
|
+
p.style.transform = `translateY(${e.clientY - m}px)`;
|
|
37
|
+
}, v = (e) => {
|
|
38
|
+
if (!p) throw Error("drag item is undefined");
|
|
39
|
+
e.stopPropagation(), document.removeEventListener("pointermove", _), document.removeEventListener("pointerup", v), p.classList.remove("dragging"), p.style.transform = "", p.style.pointerEvents = "", p.style.zIndex = "", p = void 0, t.style.touchAction = "", t.style.userSelect = "", h && g && (n(h, g), h = void 0, g = void 0);
|
|
40
|
+
}, y = (e) => {
|
|
41
|
+
if (!e.altKey) return;
|
|
42
|
+
let r = (e, r) => {
|
|
43
|
+
let i = document.activeElement;
|
|
44
|
+
t.insertBefore(e, r), i instanceof HTMLElement && i.focus(), n(e.dataset.id, r?.dataset.id);
|
|
45
|
+
};
|
|
46
|
+
switch (e.key) {
|
|
47
|
+
case "ArrowUp": {
|
|
48
|
+
let t = a(e.target, (e) => e?.parentElement, u);
|
|
49
|
+
if (t && u(t.previousElementSibling)) {
|
|
50
|
+
let e = t.previousElementSibling;
|
|
51
|
+
r(t, e);
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
case "ArrowDown": {
|
|
56
|
+
let t = a(e.target, (e) => e?.parentElement, u);
|
|
57
|
+
if (t && u(t.nextElementSibling)) {
|
|
58
|
+
let e = t.nextElementSibling?.nextElementSibling;
|
|
59
|
+
r(t, e);
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
return t.addEventListener("pointerdown", ze), t.addEventListener("keydown", y), () => {
|
|
66
|
+
t.removeEventListener("pointerdown", ze), t.removeEventListener("keydown", y);
|
|
67
|
+
};
|
|
68
|
+
} };
|
|
69
|
+
})();
|
|
70
|
+
var FOCUSABLE = "\n button:not([disabled]), \n [href], \n input:not([disabled]), \n select:not([disabled]), \n textarea:not([disabled]), \n [tabindex]:not([tabindex=\"-1\"]), \n [contenteditable]:not([contenteditable=\"false\"])\n", LogLevel = {
|
|
71
|
+
trace: 0,
|
|
72
|
+
debug: 1,
|
|
73
|
+
log: 2,
|
|
74
|
+
info: 3,
|
|
75
|
+
warn: 4,
|
|
76
|
+
error: 5
|
|
77
|
+
};
|
|
78
|
+
function createLogger(e, t, n) {
|
|
79
|
+
let r = () => {}, o = { provide: (r) => createLogger(`${e}.${r}`, t, n) };
|
|
80
|
+
for (let a of Object.keys(LogLevel)) {
|
|
81
|
+
let s = a, c = LogLevel[s], l = n[s];
|
|
82
|
+
t > c ? o[s] = r : o[s] = ((t, ...n) => l(`[${e}]`, t, ...n));
|
|
83
|
+
}
|
|
84
|
+
return o;
|
|
85
|
+
}
|
|
86
|
+
var provideLogger = (() => {
|
|
87
|
+
let e = (e, t) => (t ??= provideLogger.defaultLevel, createLogger(e, t, provideLogger.adapter));
|
|
88
|
+
return e.adapter = console, e.defaultLevel = LogLevel.warn, e;
|
|
89
|
+
})(), areEqual = (e, t) => {
|
|
90
|
+
if (e === t || Number.isNaN(e) && Number.isNaN(t)) return !0;
|
|
91
|
+
if (!(typeof e == "object" && e) || !(typeof t == "object" && t)) return !1;
|
|
92
|
+
let n = Array.isArray(e);
|
|
93
|
+
if (n !== Array.isArray(t)) return !1;
|
|
94
|
+
if (n) {
|
|
95
|
+
let n = e, r = t;
|
|
96
|
+
if (n.length !== r.length) return !1;
|
|
97
|
+
for (let e = 0; e < n.length; e++) if (!areEqual(n[e], r[e])) return !1;
|
|
98
|
+
return !0;
|
|
99
|
+
}
|
|
100
|
+
let r = Object.keys(e), i = Object.keys(t);
|
|
101
|
+
if (r.length !== i.length) return !1;
|
|
102
|
+
for (let n of r) {
|
|
103
|
+
if (!Object.prototype.hasOwnProperty.call(t, n)) return !1;
|
|
104
|
+
let r = e[n], i = t[n];
|
|
105
|
+
if (!areEqual(r, i)) return !1;
|
|
106
|
+
}
|
|
107
|
+
return !0;
|
|
108
|
+
}, getPropertyDescriptor = (e, t) => {
|
|
109
|
+
let n = e;
|
|
110
|
+
for (; n;) {
|
|
111
|
+
let e = Object.getOwnPropertyDescriptor(n, t);
|
|
112
|
+
if (e) return e;
|
|
113
|
+
n = Object.getPrototypeOf(n);
|
|
114
|
+
}
|
|
115
|
+
}, objectKeys = (e) => Object.keys(e);
|
|
116
|
+
function isPromise(e) {
|
|
117
|
+
return e != null && typeof e.then == "function";
|
|
118
|
+
}
|
|
119
|
+
var Success = class {
|
|
120
|
+
constructor(e) {
|
|
121
|
+
this.value = e;
|
|
122
|
+
}
|
|
123
|
+
value;
|
|
124
|
+
orThrow() {
|
|
125
|
+
return this.value;
|
|
126
|
+
}
|
|
127
|
+
orNull() {
|
|
128
|
+
return this.value;
|
|
129
|
+
}
|
|
130
|
+
}, Failure = class e {
|
|
131
|
+
constructor(e) {
|
|
132
|
+
this.errors = e;
|
|
133
|
+
}
|
|
134
|
+
errors;
|
|
135
|
+
orThrow() {
|
|
136
|
+
throw Error(e.formatErrors(this.errors));
|
|
137
|
+
}
|
|
138
|
+
orNull() {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
static formatErrors = (e) => e.join("\n");
|
|
142
|
+
}, Result = {
|
|
143
|
+
Ok: (e) => new Success(e),
|
|
144
|
+
Fail: (e) => new Failure(e)
|
|
145
|
+
}, padNumber = (e, t) => e.toString().padStart(t, "0").slice(-t), toKebabCase = (e) => e == null ? e : e?.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, t) => (t ? "-" : "") + e).toLowerCase();
|
|
146
|
+
function Att(e = {}) {
|
|
147
|
+
return function(t, r) {
|
|
148
|
+
let i = e?.name ?? r, a = e?.read ?? ((e) => e), o = e?.write ?? ((e) => e);
|
|
149
|
+
if (!o && !a) throw Error("@Att() should have read or write options");
|
|
150
|
+
var s = getConstructorMetadata(t.constructor);
|
|
151
|
+
s.__metadata.attributes = [...s.__metadata.attributes, {
|
|
152
|
+
propertyName: r,
|
|
153
|
+
name: toKebabCase(i),
|
|
154
|
+
read: a,
|
|
155
|
+
write: o
|
|
156
|
+
}];
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
var AttTrueFalse = {
|
|
160
|
+
read: (e) => e === "true",
|
|
161
|
+
write: (e) => e === !0 ? "true" : "false"
|
|
162
|
+
}, AttBoolean = {
|
|
163
|
+
read: (e) => e != null,
|
|
164
|
+
write: (e) => e === !0 ? "" : void 0
|
|
165
|
+
}, componentsCoreLogger = provideLogger("@ntix/components-core", typeof ANTIX_COMPONENTS_CORE_LOG_LEVEL > "u" ? LogLevel.warn : ANTIX_COMPONENTS_CORE_LOG_LEVEL);
|
|
166
|
+
function isComponentRender(e) {
|
|
167
|
+
return typeof e == "object" && !!e && "render" in e && typeof e.render == "function" && e.render.length === 1;
|
|
168
|
+
}
|
|
169
|
+
function Component(e = { tag: void 0 }) {
|
|
170
|
+
let n = () => {}, r = componentsCoreLogger.provide("component-decorator"), i = {
|
|
171
|
+
shadowRoot: "open",
|
|
172
|
+
delegatesFocus: !1,
|
|
173
|
+
...e,
|
|
174
|
+
css: asCachedStyle(e.css)
|
|
175
|
+
};
|
|
176
|
+
return function(t) {
|
|
177
|
+
let a = /* @__PURE__ */ new Map(), o = class extends t {
|
|
178
|
+
constructor(...e) {
|
|
179
|
+
super(...e);
|
|
180
|
+
let n = t.__metadata;
|
|
181
|
+
n && (n.events.forEach((e) => {
|
|
182
|
+
r.debug("event", e.propertyName, e.name), Object.defineProperty(this, e.propertyName, {
|
|
183
|
+
value: function(t) {
|
|
184
|
+
let n = new CustomEvent(e.name, {
|
|
185
|
+
detail: t,
|
|
186
|
+
...e.init
|
|
187
|
+
});
|
|
188
|
+
return this.dispatchEvent(n);
|
|
189
|
+
},
|
|
190
|
+
writable: !1,
|
|
191
|
+
configurable: !1,
|
|
192
|
+
enumerable: !0
|
|
193
|
+
});
|
|
194
|
+
}), n.watches.forEach((e) => {
|
|
195
|
+
let t = e.methodName;
|
|
196
|
+
r.debug(`${this.tagName}.${t}()`, { propertyNames: e.propertyNames }), e.propertyNames.forEach((e) => {
|
|
197
|
+
let n = getPropertyDescriptor(this, e);
|
|
198
|
+
r.debug("watch", e, n);
|
|
199
|
+
let i = n?.value, a = n?.get?.bind(this) ?? (() => i), o = n?.set?.bind(this) ?? ((e) => {
|
|
200
|
+
i = e;
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(this, e, {
|
|
203
|
+
get: a,
|
|
204
|
+
set: function(n) {
|
|
205
|
+
let r = a();
|
|
206
|
+
r !== n && (o(n), this[t](n, r, e) === !1 && o(r));
|
|
207
|
+
},
|
|
208
|
+
enumerable: !0,
|
|
209
|
+
configurable: !0
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
}), n.attributes.forEach((e) => {
|
|
213
|
+
let t = getPropertyDescriptor(this, e.propertyName), n = t?.value, i = t?.get?.bind(this) ?? (() => n), o = t?.set?.bind(this) ?? ((e) => {
|
|
214
|
+
n = e;
|
|
215
|
+
});
|
|
216
|
+
if (e.write) {
|
|
217
|
+
let t = o, n = e.write;
|
|
218
|
+
o = (r) => {
|
|
219
|
+
r !== i() && t(r);
|
|
220
|
+
let a = this.getAttribute(e.name), o = n(r);
|
|
221
|
+
if (o == null) a != null && this.removeAttribute(e.name);
|
|
222
|
+
else {
|
|
223
|
+
let t = `${o}`;
|
|
224
|
+
a !== t && this.setAttribute(e.name, t);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
r.debug(`${this.tagName}.${e.propertyName}`, {
|
|
229
|
+
att: e.name,
|
|
230
|
+
read: !!e.read,
|
|
231
|
+
write: !!e.write
|
|
232
|
+
}), Object.defineProperty(this, e.propertyName, {
|
|
233
|
+
get: i,
|
|
234
|
+
set: o,
|
|
235
|
+
enumerable: !0
|
|
236
|
+
}), e.read && a.set(e.name, () => {
|
|
237
|
+
this.hasAttribute(e.name) || o(i());
|
|
238
|
+
});
|
|
239
|
+
}));
|
|
240
|
+
}
|
|
241
|
+
__shadowRoot;
|
|
242
|
+
};
|
|
243
|
+
if (o.__metadata) {
|
|
244
|
+
let e = new Set(o.observedAttributes);
|
|
245
|
+
o.__metadata.attributes.forEach((t) => {
|
|
246
|
+
t.read && e.add(t.name);
|
|
247
|
+
}), o.observedAttributes = Array.from(e);
|
|
248
|
+
}
|
|
249
|
+
let s;
|
|
250
|
+
o.prototype.resizeCallback && (s = new ResizeObserver((e) => {
|
|
251
|
+
o.prototype.resizeCallback?.call(e[0].target);
|
|
252
|
+
}));
|
|
253
|
+
let l = o.prototype.attributeChangedCallback ?? n;
|
|
254
|
+
o.prototype.attributeChangedCallback = function(e, t, n) {
|
|
255
|
+
if (l(e, t, n), n !== t) {
|
|
256
|
+
var r = o.__metadata?.attributes.find((t) => t.name === e);
|
|
257
|
+
r?.read && (this[r.propertyName] = r.read(n));
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
let d = o.prototype.connectedCallback ?? n;
|
|
261
|
+
o.prototype.connectedCallback = function() {
|
|
262
|
+
a.forEach((e) => e()), (i.shadowRoot === "open" || i.shadowRoot === "closed") && !this.__shadowRoot && (this.__shadowRoot = this.attachShadow({
|
|
263
|
+
delegatesFocus: i.delegatesFocus,
|
|
264
|
+
mode: i.shadowRoot,
|
|
265
|
+
slotAssignment: "named"
|
|
266
|
+
}), this.__shadowRoot.adoptedStyleSheets = i.css), d.call(this), s && s.observe(this);
|
|
267
|
+
};
|
|
268
|
+
let f = o.prototype.disconnectedCallback ?? n;
|
|
269
|
+
o.prototype.disconnectedCallback = function() {
|
|
270
|
+
f.call(this), s && s.unobserve(this);
|
|
271
|
+
};
|
|
272
|
+
let p = o.prototype.beforeRender ?? n, m = o.prototype.render ?? n, h = o.prototype.afterRender ?? n;
|
|
273
|
+
return o.prototype.render = async function() {
|
|
274
|
+
r.debug("render", this.tagName);
|
|
275
|
+
let e = p.call(this);
|
|
276
|
+
if (isPromise(e) && await e, this.__shadowRoot) {
|
|
277
|
+
let e = this.__shadowRoot, t = m.call(this);
|
|
278
|
+
isComponentRender(t) ? await t.render(e) : e.innerHTML = t;
|
|
279
|
+
}
|
|
280
|
+
h.call(this);
|
|
281
|
+
}, r.debug("define", e.tag), window.customElements.define(e.tag, o), o;
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
function Event(e = {}) {
|
|
285
|
+
return function(t, r) {
|
|
286
|
+
var i = getConstructorMetadata(t.constructor);
|
|
287
|
+
i.__metadata.events = [...i.__metadata.events, {
|
|
288
|
+
name: e?.name ?? toKebabCase(r),
|
|
289
|
+
init: e,
|
|
290
|
+
propertyName: r
|
|
291
|
+
}];
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
var HTMLComponentElement = class extends HTMLElement {
|
|
295
|
+
addEventListener(e, t, n) {
|
|
296
|
+
return super.addEventListener(e, t, n), () => {
|
|
297
|
+
super.removeEventListener(e, t, n);
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
removeEventListener(e, t, n) {
|
|
301
|
+
super.removeEventListener(e, t, n);
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
function Watch(...e) {
|
|
305
|
+
return function(t, r) {
|
|
306
|
+
var i = getConstructorMetadata(t.constructor);
|
|
307
|
+
i.__metadata.watches = [...i.__metadata.watches, {
|
|
308
|
+
methodName: r,
|
|
309
|
+
propertyNames: e
|
|
310
|
+
}];
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
function isHTMLLiteralCallback(e) {
|
|
314
|
+
return typeof e == "function";
|
|
315
|
+
}
|
|
316
|
+
var HTMLLiteralResult = class extends Array {
|
|
317
|
+
render = (e, t = "") => new Promise((n) => {
|
|
318
|
+
let r = document.createElement("template"), i = {}, a = (e) => {
|
|
319
|
+
let t = `_${Object.keys(i).length}`;
|
|
320
|
+
return i[t] = e, t;
|
|
321
|
+
}, o = (e) => Array.isArray(e) ? e.map(o).join("") : isHTMLLiteralCallback(e) ? `_r_=${a(e)}` : `${e}`;
|
|
322
|
+
r.innerHTML = t + o(this), e.replaceChildren(r.content);
|
|
323
|
+
let s = async (e) => {
|
|
324
|
+
if (e.nodeType === Node.ELEMENT_NODE && e.hasAttribute("_r_")) {
|
|
325
|
+
let t = e.getAttribute("_r_");
|
|
326
|
+
if (t) {
|
|
327
|
+
e.removeAttribute("_r_");
|
|
328
|
+
let n = i[t];
|
|
329
|
+
for (n.element = e; !e.isConnected;) await new Promise((e) => requestAnimationFrame(() => e()));
|
|
330
|
+
n(e);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
await Promise.all([...e.children].map(s));
|
|
334
|
+
};
|
|
335
|
+
s(e).then(n);
|
|
336
|
+
});
|
|
337
|
+
}, { entries, setPrototypeOf, isFrozen, getPrototypeOf, getOwnPropertyDescriptor } = Object, { freeze, seal, create } = Object, { apply, construct } = typeof Reflect < "u" && Reflect;
|
|
338
|
+
freeze ||= function(e) {
|
|
339
|
+
return e;
|
|
340
|
+
}, seal ||= function(e) {
|
|
341
|
+
return e;
|
|
342
|
+
}, apply ||= function(e, t) {
|
|
343
|
+
var n = [...arguments].slice(2);
|
|
344
|
+
return e.apply(t, n);
|
|
345
|
+
}, construct ||= function(e) {
|
|
346
|
+
return new e(...[...arguments].slice(1));
|
|
347
|
+
};
|
|
348
|
+
var arrayForEach = unapply(Array.prototype.forEach), arrayLastIndexOf = unapply(Array.prototype.lastIndexOf), arrayPop = unapply(Array.prototype.pop), arrayPush = unapply(Array.prototype.push), arraySplice = unapply(Array.prototype.splice), stringToLowerCase = unapply(String.prototype.toLowerCase), stringToString = unapply(String.prototype.toString), stringMatch = unapply(String.prototype.match), stringReplace = unapply(String.prototype.replace), stringIndexOf = unapply(String.prototype.indexOf), stringTrim = unapply(String.prototype.trim), objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty), regExpTest = unapply(RegExp.prototype.test), typeErrorCreate = unconstruct(TypeError);
|
|
349
|
+
function unapply(e) {
|
|
350
|
+
return function(t) {
|
|
351
|
+
t instanceof RegExp && (t.lastIndex = 0);
|
|
352
|
+
var n = [...arguments].slice(1);
|
|
353
|
+
return apply(e, t, n);
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
function unconstruct(e) {
|
|
357
|
+
return function() {
|
|
358
|
+
return construct(e, [...arguments]);
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
function addToSet(e, t) {
|
|
362
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
|
|
363
|
+
setPrototypeOf && setPrototypeOf(e, null);
|
|
364
|
+
let r = t.length;
|
|
365
|
+
for (; r--;) {
|
|
366
|
+
let i = t[r];
|
|
367
|
+
if (typeof i == "string") {
|
|
368
|
+
let e = n(i);
|
|
369
|
+
e !== i && (isFrozen(t) || (t[r] = e), i = e);
|
|
370
|
+
}
|
|
371
|
+
e[i] = !0;
|
|
372
|
+
}
|
|
373
|
+
return e;
|
|
374
|
+
}
|
|
375
|
+
function cleanArray(e) {
|
|
376
|
+
for (let t = 0; t < e.length; t++) objectHasOwnProperty(e, t) || (e[t] = null);
|
|
377
|
+
return e;
|
|
378
|
+
}
|
|
379
|
+
function clone(e) {
|
|
380
|
+
let t = create(null);
|
|
381
|
+
for (let [n, r] of entries(e)) objectHasOwnProperty(e, n) && (Array.isArray(r) ? t[n] = cleanArray(r) : r && typeof r == "object" && r.constructor === Object ? t[n] = clone(r) : t[n] = r);
|
|
382
|
+
return t;
|
|
383
|
+
}
|
|
384
|
+
function lookupGetter(e, t) {
|
|
385
|
+
for (; e !== null;) {
|
|
386
|
+
let n = getOwnPropertyDescriptor(e, t);
|
|
387
|
+
if (n) {
|
|
388
|
+
if (n.get) return unapply(n.get);
|
|
389
|
+
if (typeof n.value == "function") return unapply(n.value);
|
|
390
|
+
}
|
|
391
|
+
e = getPrototypeOf(e);
|
|
392
|
+
}
|
|
393
|
+
function n() {
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
396
|
+
return n;
|
|
397
|
+
}
|
|
398
|
+
var html$1 = freeze(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), svg$1 = freeze(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), svgFilters = freeze([
|
|
399
|
+
"feBlend",
|
|
400
|
+
"feColorMatrix",
|
|
401
|
+
"feComponentTransfer",
|
|
402
|
+
"feComposite",
|
|
403
|
+
"feConvolveMatrix",
|
|
404
|
+
"feDiffuseLighting",
|
|
405
|
+
"feDisplacementMap",
|
|
406
|
+
"feDistantLight",
|
|
407
|
+
"feDropShadow",
|
|
408
|
+
"feFlood",
|
|
409
|
+
"feFuncA",
|
|
410
|
+
"feFuncB",
|
|
411
|
+
"feFuncG",
|
|
412
|
+
"feFuncR",
|
|
413
|
+
"feGaussianBlur",
|
|
414
|
+
"feImage",
|
|
415
|
+
"feMerge",
|
|
416
|
+
"feMergeNode",
|
|
417
|
+
"feMorphology",
|
|
418
|
+
"feOffset",
|
|
419
|
+
"fePointLight",
|
|
420
|
+
"feSpecularLighting",
|
|
421
|
+
"feSpotLight",
|
|
422
|
+
"feTile",
|
|
423
|
+
"feTurbulence"
|
|
424
|
+
]), svgDisallowed = freeze([
|
|
425
|
+
"animate",
|
|
426
|
+
"color-profile",
|
|
427
|
+
"cursor",
|
|
428
|
+
"discard",
|
|
429
|
+
"font-face",
|
|
430
|
+
"font-face-format",
|
|
431
|
+
"font-face-name",
|
|
432
|
+
"font-face-src",
|
|
433
|
+
"font-face-uri",
|
|
434
|
+
"foreignobject",
|
|
435
|
+
"hatch",
|
|
436
|
+
"hatchpath",
|
|
437
|
+
"mesh",
|
|
438
|
+
"meshgradient",
|
|
439
|
+
"meshpatch",
|
|
440
|
+
"meshrow",
|
|
441
|
+
"missing-glyph",
|
|
442
|
+
"script",
|
|
443
|
+
"set",
|
|
444
|
+
"solidcolor",
|
|
445
|
+
"unknown",
|
|
446
|
+
"use"
|
|
447
|
+
]), mathMl$1 = freeze(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), mathMlDisallowed = freeze([
|
|
448
|
+
"maction",
|
|
449
|
+
"maligngroup",
|
|
450
|
+
"malignmark",
|
|
451
|
+
"mlongdiv",
|
|
452
|
+
"mscarries",
|
|
453
|
+
"mscarry",
|
|
454
|
+
"msgroup",
|
|
455
|
+
"mstack",
|
|
456
|
+
"msline",
|
|
457
|
+
"msrow",
|
|
458
|
+
"semantics",
|
|
459
|
+
"annotation",
|
|
460
|
+
"annotation-xml",
|
|
461
|
+
"mprescripts",
|
|
462
|
+
"none"
|
|
463
|
+
]), text = freeze(["#text"]), html$2 = freeze(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot".split(".")), svg = freeze(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), mathMl = freeze(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), xml = freeze([
|
|
464
|
+
"xlink:href",
|
|
465
|
+
"xml:id",
|
|
466
|
+
"xlink:title",
|
|
467
|
+
"xml:space",
|
|
468
|
+
"xmlns:xlink"
|
|
469
|
+
]), MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm), ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm), TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm), DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/), ARIA_ATTR = seal(/^aria-[\-\w]+$/), IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i), ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), DOCTYPE_NAME = seal(/^html$/i), CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i), EXPRESSIONS = /* @__PURE__ */ Object.freeze({
|
|
470
|
+
__proto__: null,
|
|
471
|
+
ARIA_ATTR,
|
|
472
|
+
ATTR_WHITESPACE,
|
|
473
|
+
CUSTOM_ELEMENT,
|
|
474
|
+
DATA_ATTR,
|
|
475
|
+
DOCTYPE_NAME,
|
|
476
|
+
ERB_EXPR,
|
|
477
|
+
IS_ALLOWED_URI,
|
|
478
|
+
IS_SCRIPT_OR_DATA,
|
|
479
|
+
MUSTACHE_EXPR,
|
|
480
|
+
TMPLIT_EXPR
|
|
481
|
+
}), NODE_TYPE = {
|
|
482
|
+
element: 1,
|
|
483
|
+
attribute: 2,
|
|
484
|
+
text: 3,
|
|
485
|
+
cdataSection: 4,
|
|
486
|
+
entityReference: 5,
|
|
487
|
+
entityNode: 6,
|
|
488
|
+
progressingInstruction: 7,
|
|
489
|
+
comment: 8,
|
|
490
|
+
document: 9,
|
|
491
|
+
documentType: 10,
|
|
492
|
+
documentFragment: 11,
|
|
493
|
+
notation: 12
|
|
494
|
+
}, getGlobal = function() {
|
|
495
|
+
return typeof window > "u" ? null : window;
|
|
496
|
+
}, _createTrustedTypesPolicy = function(e, t) {
|
|
497
|
+
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
498
|
+
let n = null, r = "data-tt-policy-suffix";
|
|
499
|
+
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
500
|
+
let i = "dompurify" + (n ? "#" + n : "");
|
|
501
|
+
try {
|
|
502
|
+
return e.createPolicy(i, {
|
|
503
|
+
createHTML(e) {
|
|
504
|
+
return e;
|
|
505
|
+
},
|
|
506
|
+
createScriptURL(e) {
|
|
507
|
+
return e;
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
} catch {
|
|
511
|
+
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
512
|
+
}
|
|
513
|
+
}, _createHooksMap = function() {
|
|
514
|
+
return {
|
|
515
|
+
afterSanitizeAttributes: [],
|
|
516
|
+
afterSanitizeElements: [],
|
|
517
|
+
afterSanitizeShadowDOM: [],
|
|
518
|
+
beforeSanitizeAttributes: [],
|
|
519
|
+
beforeSanitizeElements: [],
|
|
520
|
+
beforeSanitizeShadowDOM: [],
|
|
521
|
+
uponSanitizeAttribute: [],
|
|
522
|
+
uponSanitizeElement: [],
|
|
523
|
+
uponSanitizeShadowNode: []
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
function createDOMPurify() {
|
|
527
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal(), t = (e) => createDOMPurify(e);
|
|
528
|
+
if (t.version = "3.3.0", t.removed = [], !e || !e.document || e.document.nodeType !== NODE_TYPE.document || !e.Element) return t.isSupported = !1, t;
|
|
529
|
+
let { document: n } = e, r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: o, Node: s, Element: c, NodeFilter: l, NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: d, DOMParser: f, trustedTypes: p } = e, m = c.prototype, h = lookupGetter(m, "cloneNode"), g = lookupGetter(m, "remove"), ze = lookupGetter(m, "nextSibling"), _ = lookupGetter(m, "childNodes"), v = lookupGetter(m, "parentNode");
|
|
530
|
+
if (typeof o == "function") {
|
|
531
|
+
let e = n.createElement("template");
|
|
532
|
+
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
533
|
+
}
|
|
534
|
+
let y, b = "", { implementation: Be, createNodeIterator: Ve, createDocumentFragment: He, getElementsByTagName: Ue } = n, { importNode: We } = r, x = _createHooksMap();
|
|
535
|
+
t.isSupported = typeof entries == "function" && typeof v == "function" && Be && Be.createHTMLDocument !== void 0;
|
|
536
|
+
let { MUSTACHE_EXPR: S, ERB_EXPR: Ge, TMPLIT_EXPR: Ke, DATA_ATTR: qe, ARIA_ATTR: Je, IS_SCRIPT_OR_DATA: Ye, ATTR_WHITESPACE: Xe, CUSTOM_ELEMENT: Ze } = EXPRESSIONS, { IS_ALLOWED_URI: Qe } = EXPRESSIONS, C = null, $e = addToSet({}, [
|
|
537
|
+
...html$1,
|
|
538
|
+
...svg$1,
|
|
539
|
+
...svgFilters,
|
|
540
|
+
...mathMl$1,
|
|
541
|
+
...text
|
|
542
|
+
]), w = null, et = addToSet({}, [
|
|
543
|
+
...html$2,
|
|
544
|
+
...svg,
|
|
545
|
+
...mathMl,
|
|
546
|
+
...xml
|
|
547
|
+
]), T = Object.seal(create(null, {
|
|
548
|
+
tagNameCheck: {
|
|
549
|
+
writable: !0,
|
|
550
|
+
configurable: !1,
|
|
551
|
+
enumerable: !0,
|
|
552
|
+
value: null
|
|
553
|
+
},
|
|
554
|
+
attributeNameCheck: {
|
|
555
|
+
writable: !0,
|
|
556
|
+
configurable: !1,
|
|
557
|
+
enumerable: !0,
|
|
558
|
+
value: null
|
|
559
|
+
},
|
|
560
|
+
allowCustomizedBuiltInElements: {
|
|
561
|
+
writable: !0,
|
|
562
|
+
configurable: !1,
|
|
563
|
+
enumerable: !0,
|
|
564
|
+
value: !1
|
|
565
|
+
}
|
|
566
|
+
})), E = null, D = null, O = Object.seal(create(null, {
|
|
567
|
+
tagCheck: {
|
|
568
|
+
writable: !0,
|
|
569
|
+
configurable: !1,
|
|
570
|
+
enumerable: !0,
|
|
571
|
+
value: null
|
|
572
|
+
},
|
|
573
|
+
attributeCheck: {
|
|
574
|
+
writable: !0,
|
|
575
|
+
configurable: !1,
|
|
576
|
+
enumerable: !0,
|
|
577
|
+
value: null
|
|
578
|
+
}
|
|
579
|
+
})), tt = !0, k = !0, nt = !1, rt = !0, A = !1, j = !0, M = !1, it = !1, at = !1, N = !1, P = !1, F = !1, ot = !0, st = !1, I = !0, L = !1, R = {}, z = null, ct = addToSet({}, [
|
|
580
|
+
"annotation-xml",
|
|
581
|
+
"audio",
|
|
582
|
+
"colgroup",
|
|
583
|
+
"desc",
|
|
584
|
+
"foreignobject",
|
|
585
|
+
"head",
|
|
586
|
+
"iframe",
|
|
587
|
+
"math",
|
|
588
|
+
"mi",
|
|
589
|
+
"mn",
|
|
590
|
+
"mo",
|
|
591
|
+
"ms",
|
|
592
|
+
"mtext",
|
|
593
|
+
"noembed",
|
|
594
|
+
"noframes",
|
|
595
|
+
"noscript",
|
|
596
|
+
"plaintext",
|
|
597
|
+
"script",
|
|
598
|
+
"style",
|
|
599
|
+
"svg",
|
|
600
|
+
"template",
|
|
601
|
+
"thead",
|
|
602
|
+
"title",
|
|
603
|
+
"video",
|
|
604
|
+
"xmp"
|
|
605
|
+
]), lt = null, ut = addToSet({}, [
|
|
606
|
+
"audio",
|
|
607
|
+
"video",
|
|
608
|
+
"img",
|
|
609
|
+
"source",
|
|
610
|
+
"image",
|
|
611
|
+
"track"
|
|
612
|
+
]), dt = null, ft = addToSet({}, [
|
|
613
|
+
"alt",
|
|
614
|
+
"class",
|
|
615
|
+
"for",
|
|
616
|
+
"id",
|
|
617
|
+
"label",
|
|
618
|
+
"name",
|
|
619
|
+
"pattern",
|
|
620
|
+
"placeholder",
|
|
621
|
+
"role",
|
|
622
|
+
"summary",
|
|
623
|
+
"title",
|
|
624
|
+
"value",
|
|
625
|
+
"style",
|
|
626
|
+
"xmlns"
|
|
627
|
+
]), B = "http://www.w3.org/1998/Math/MathML", V = "http://www.w3.org/2000/svg", H = "http://www.w3.org/1999/xhtml", U = H, W = !1, G = null, pt = addToSet({}, [
|
|
628
|
+
B,
|
|
629
|
+
V,
|
|
630
|
+
H
|
|
631
|
+
], stringToString), K = addToSet({}, [
|
|
632
|
+
"mi",
|
|
633
|
+
"mo",
|
|
634
|
+
"mn",
|
|
635
|
+
"ms",
|
|
636
|
+
"mtext"
|
|
637
|
+
]), q = addToSet({}, ["annotation-xml"]), mt = addToSet({}, [
|
|
638
|
+
"title",
|
|
639
|
+
"style",
|
|
640
|
+
"font",
|
|
641
|
+
"a",
|
|
642
|
+
"script"
|
|
643
|
+
]), J = null, ht = ["application/xhtml+xml", "text/html"], Y = null, X = null, gt = n.createElement("form"), _t = function(e) {
|
|
644
|
+
return e instanceof RegExp || e instanceof Function;
|
|
645
|
+
}, vt = function() {
|
|
646
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
647
|
+
if (!(X && X === e)) {
|
|
648
|
+
if ((!e || typeof e != "object") && (e = {}), e = clone(e), J = ht.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Y = J === "application/xhtml+xml" ? stringToString : stringToLowerCase, C = objectHasOwnProperty(e, "ALLOWED_TAGS") ? addToSet({}, e.ALLOWED_TAGS, Y) : $e, w = objectHasOwnProperty(e, "ALLOWED_ATTR") ? addToSet({}, e.ALLOWED_ATTR, Y) : et, G = objectHasOwnProperty(e, "ALLOWED_NAMESPACES") ? addToSet({}, e.ALLOWED_NAMESPACES, stringToString) : pt, dt = objectHasOwnProperty(e, "ADD_URI_SAFE_ATTR") ? addToSet(clone(ft), e.ADD_URI_SAFE_ATTR, Y) : ft, lt = objectHasOwnProperty(e, "ADD_DATA_URI_TAGS") ? addToSet(clone(ut), e.ADD_DATA_URI_TAGS, Y) : ut, z = objectHasOwnProperty(e, "FORBID_CONTENTS") ? addToSet({}, e.FORBID_CONTENTS, Y) : ct, E = objectHasOwnProperty(e, "FORBID_TAGS") ? addToSet({}, e.FORBID_TAGS, Y) : clone({}), D = objectHasOwnProperty(e, "FORBID_ATTR") ? addToSet({}, e.FORBID_ATTR, Y) : clone({}), R = objectHasOwnProperty(e, "USE_PROFILES") ? e.USE_PROFILES : !1, tt = e.ALLOW_ARIA_ATTR !== !1, k = e.ALLOW_DATA_ATTR !== !1, nt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, rt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, A = e.SAFE_FOR_TEMPLATES || !1, j = e.SAFE_FOR_XML !== !1, M = e.WHOLE_DOCUMENT || !1, N = e.RETURN_DOM || !1, P = e.RETURN_DOM_FRAGMENT || !1, F = e.RETURN_TRUSTED_TYPE || !1, at = e.FORCE_BODY || !1, ot = e.SANITIZE_DOM !== !1, st = e.SANITIZE_NAMED_PROPS || !1, I = e.KEEP_CONTENT !== !1, L = e.IN_PLACE || !1, Qe = e.ALLOWED_URI_REGEXP || IS_ALLOWED_URI, U = e.NAMESPACE || H, K = e.MATHML_TEXT_INTEGRATION_POINTS || K, q = e.HTML_INTEGRATION_POINTS || q, T = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && _t(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (T.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && _t(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (T.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (T.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), A && (k = !1), P && (N = !0), R && (C = addToSet({}, text), w = [], R.html === !0 && (addToSet(C, html$1), addToSet(w, html$2)), R.svg === !0 && (addToSet(C, svg$1), addToSet(w, svg), addToSet(w, xml)), R.svgFilters === !0 && (addToSet(C, svgFilters), addToSet(w, svg), addToSet(w, xml)), R.mathMl === !0 && (addToSet(C, mathMl$1), addToSet(w, mathMl), addToSet(w, xml))), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? O.tagCheck = e.ADD_TAGS : (C === $e && (C = clone(C)), addToSet(C, e.ADD_TAGS, Y))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? O.attributeCheck = e.ADD_ATTR : (w === et && (w = clone(w)), addToSet(w, e.ADD_ATTR, Y))), e.ADD_URI_SAFE_ATTR && addToSet(dt, e.ADD_URI_SAFE_ATTR, Y), e.FORBID_CONTENTS && (z === ct && (z = clone(z)), addToSet(z, e.FORBID_CONTENTS, Y)), I && (C["#text"] = !0), M && addToSet(C, [
|
|
649
|
+
"html",
|
|
650
|
+
"head",
|
|
651
|
+
"body"
|
|
652
|
+
]), C.table && (addToSet(C, ["tbody"]), delete E.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
653
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
654
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
655
|
+
y = e.TRUSTED_TYPES_POLICY, b = y.createHTML("");
|
|
656
|
+
} else y === void 0 && (y = _createTrustedTypesPolicy(p, i)), y !== null && typeof b == "string" && (b = y.createHTML(""));
|
|
657
|
+
freeze && freeze(e), X = e;
|
|
658
|
+
}
|
|
659
|
+
}, yt = addToSet({}, [
|
|
660
|
+
...svg$1,
|
|
661
|
+
...svgFilters,
|
|
662
|
+
...svgDisallowed
|
|
663
|
+
]), bt = addToSet({}, [...mathMl$1, ...mathMlDisallowed]), xt = function(e) {
|
|
664
|
+
let t = v(e);
|
|
665
|
+
(!t || !t.tagName) && (t = {
|
|
666
|
+
namespaceURI: U,
|
|
667
|
+
tagName: "template"
|
|
668
|
+
});
|
|
669
|
+
let n = stringToLowerCase(e.tagName), r = stringToLowerCase(t.tagName);
|
|
670
|
+
return G[e.namespaceURI] ? e.namespaceURI === V ? t.namespaceURI === H ? n === "svg" : t.namespaceURI === B ? n === "svg" && (r === "annotation-xml" || K[r]) : !!yt[n] : e.namespaceURI === B ? t.namespaceURI === H ? n === "math" : t.namespaceURI === V ? n === "math" && q[r] : !!bt[n] : e.namespaceURI === H ? t.namespaceURI === V && !q[r] || t.namespaceURI === B && !K[r] ? !1 : !bt[n] && (mt[n] || !yt[n]) : !!(J === "application/xhtml+xml" && G[e.namespaceURI]) : !1;
|
|
671
|
+
}, Z = function(e) {
|
|
672
|
+
arrayPush(t.removed, { element: e });
|
|
673
|
+
try {
|
|
674
|
+
v(e).removeChild(e);
|
|
675
|
+
} catch {
|
|
676
|
+
g(e);
|
|
677
|
+
}
|
|
678
|
+
}, Q = function(e, n) {
|
|
679
|
+
try {
|
|
680
|
+
arrayPush(t.removed, {
|
|
681
|
+
attribute: n.getAttributeNode(e),
|
|
682
|
+
from: n
|
|
683
|
+
});
|
|
684
|
+
} catch {
|
|
685
|
+
arrayPush(t.removed, {
|
|
686
|
+
attribute: null,
|
|
687
|
+
from: n
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
if (n.removeAttribute(e), e === "is") if (N || P) try {
|
|
691
|
+
Z(n);
|
|
692
|
+
} catch {}
|
|
693
|
+
else try {
|
|
694
|
+
n.setAttribute(e, "");
|
|
695
|
+
} catch {}
|
|
696
|
+
}, St = function(e) {
|
|
697
|
+
let t = null, r = null;
|
|
698
|
+
if (at) e = "<remove></remove>" + e;
|
|
699
|
+
else {
|
|
700
|
+
let t = stringMatch(e, /^[\r\n\t ]+/);
|
|
701
|
+
r = t && t[0];
|
|
702
|
+
}
|
|
703
|
+
J === "application/xhtml+xml" && U === H && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
704
|
+
let i = y ? y.createHTML(e) : e;
|
|
705
|
+
if (U === H) try {
|
|
706
|
+
t = new f().parseFromString(i, J);
|
|
707
|
+
} catch {}
|
|
708
|
+
if (!t || !t.documentElement) {
|
|
709
|
+
t = Be.createDocument(U, "template", null);
|
|
710
|
+
try {
|
|
711
|
+
t.documentElement.innerHTML = W ? b : i;
|
|
712
|
+
} catch {}
|
|
713
|
+
}
|
|
714
|
+
let a = t.body || t.documentElement;
|
|
715
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), U === H ? Ue.call(t, M ? "html" : "body")[0] : M ? t.documentElement : a;
|
|
716
|
+
}, Ct = function(e) {
|
|
717
|
+
return Ve.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
|
|
718
|
+
}, wt = function(e) {
|
|
719
|
+
return e instanceof d && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof u) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
720
|
+
}, Tt = function(e) {
|
|
721
|
+
return typeof s == "function" && e instanceof s;
|
|
722
|
+
};
|
|
723
|
+
function $(e, n, r) {
|
|
724
|
+
arrayForEach(e, (e) => {
|
|
725
|
+
e.call(t, n, r, X);
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
let Et = function(e) {
|
|
729
|
+
let n = null;
|
|
730
|
+
if ($(x.beforeSanitizeElements, e, null), wt(e)) return Z(e), !0;
|
|
731
|
+
let r = Y(e.nodeName);
|
|
732
|
+
if ($(x.uponSanitizeElement, e, {
|
|
733
|
+
tagName: r,
|
|
734
|
+
allowedTags: C
|
|
735
|
+
}), j && e.hasChildNodes() && !Tt(e.firstElementChild) && regExpTest(/<[/\w!]/g, e.innerHTML) && regExpTest(/<[/\w!]/g, e.textContent) || e.nodeType === NODE_TYPE.progressingInstruction || j && e.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, e.data)) return Z(e), !0;
|
|
736
|
+
if (!(O.tagCheck instanceof Function && O.tagCheck(r)) && (!C[r] || E[r])) {
|
|
737
|
+
if (!E[r] && Ot(r) && (T.tagNameCheck instanceof RegExp && regExpTest(T.tagNameCheck, r) || T.tagNameCheck instanceof Function && T.tagNameCheck(r))) return !1;
|
|
738
|
+
if (I && !z[r]) {
|
|
739
|
+
let t = v(e) || e.parentNode, n = _(e) || e.childNodes;
|
|
740
|
+
if (n && t) {
|
|
741
|
+
let r = n.length;
|
|
742
|
+
for (let i = r - 1; i >= 0; --i) {
|
|
743
|
+
let r = h(n[i], !0);
|
|
744
|
+
r.__removalCount = (e.__removalCount || 0) + 1, t.insertBefore(r, ze(e));
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
return Z(e), !0;
|
|
749
|
+
}
|
|
750
|
+
return e instanceof c && !xt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Z(e), !0) : (A && e.nodeType === NODE_TYPE.text && (n = e.textContent, arrayForEach([
|
|
751
|
+
S,
|
|
752
|
+
Ge,
|
|
753
|
+
Ke
|
|
754
|
+
], (e) => {
|
|
755
|
+
n = stringReplace(n, e, " ");
|
|
756
|
+
}), e.textContent !== n && (arrayPush(t.removed, { element: e.cloneNode() }), e.textContent = n)), $(x.afterSanitizeElements, e, null), !1);
|
|
757
|
+
}, Dt = function(e, t, r) {
|
|
758
|
+
if (ot && (t === "id" || t === "name") && (r in n || r in gt)) return !1;
|
|
759
|
+
if (!(k && !D[t] && regExpTest(qe, t)) && !(tt && regExpTest(Je, t)) && !(O.attributeCheck instanceof Function && O.attributeCheck(t, e))) {
|
|
760
|
+
if (!w[t] || D[t]) {
|
|
761
|
+
if (!(Ot(e) && (T.tagNameCheck instanceof RegExp && regExpTest(T.tagNameCheck, e) || T.tagNameCheck instanceof Function && T.tagNameCheck(e)) && (T.attributeNameCheck instanceof RegExp && regExpTest(T.attributeNameCheck, t) || T.attributeNameCheck instanceof Function && T.attributeNameCheck(t, e)) || t === "is" && T.allowCustomizedBuiltInElements && (T.tagNameCheck instanceof RegExp && regExpTest(T.tagNameCheck, r) || T.tagNameCheck instanceof Function && T.tagNameCheck(r)))) return !1;
|
|
762
|
+
} else if (!dt[t] && !regExpTest(Qe, stringReplace(r, Xe, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && stringIndexOf(r, "data:") === 0 && lt[e]) && !(nt && !regExpTest(Ye, stringReplace(r, Xe, ""))) && r) return !1;
|
|
763
|
+
}
|
|
764
|
+
return !0;
|
|
765
|
+
}, Ot = function(e) {
|
|
766
|
+
return e !== "annotation-xml" && stringMatch(e, Ze);
|
|
767
|
+
}, kt = function(e) {
|
|
768
|
+
$(x.beforeSanitizeAttributes, e, null);
|
|
769
|
+
let { attributes: n } = e;
|
|
770
|
+
if (!n || wt(e)) return;
|
|
771
|
+
let r = {
|
|
772
|
+
attrName: "",
|
|
773
|
+
attrValue: "",
|
|
774
|
+
keepAttr: !0,
|
|
775
|
+
allowedAttributes: w,
|
|
776
|
+
forceKeepAttr: void 0
|
|
777
|
+
}, i = n.length;
|
|
778
|
+
for (; i--;) {
|
|
779
|
+
let { name: a, namespaceURI: o, value: s } = n[i], c = Y(a), l = s, u = a === "value" ? l : stringTrim(l);
|
|
780
|
+
if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, $(x.uponSanitizeAttribute, e, r), u = r.attrValue, st && (c === "id" || c === "name") && (Q(a, e), u = "user-content-" + u), j && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, u)) {
|
|
781
|
+
Q(a, e);
|
|
782
|
+
continue;
|
|
783
|
+
}
|
|
784
|
+
if (c === "attributename" && stringMatch(u, "href")) {
|
|
785
|
+
Q(a, e);
|
|
786
|
+
continue;
|
|
787
|
+
}
|
|
788
|
+
if (r.forceKeepAttr) continue;
|
|
789
|
+
if (!r.keepAttr) {
|
|
790
|
+
Q(a, e);
|
|
791
|
+
continue;
|
|
792
|
+
}
|
|
793
|
+
if (!rt && regExpTest(/\/>/i, u)) {
|
|
794
|
+
Q(a, e);
|
|
795
|
+
continue;
|
|
796
|
+
}
|
|
797
|
+
A && arrayForEach([
|
|
798
|
+
S,
|
|
799
|
+
Ge,
|
|
800
|
+
Ke
|
|
801
|
+
], (e) => {
|
|
802
|
+
u = stringReplace(u, e, " ");
|
|
803
|
+
});
|
|
804
|
+
let d = Y(e.nodeName);
|
|
805
|
+
if (!Dt(d, c, u)) {
|
|
806
|
+
Q(a, e);
|
|
807
|
+
continue;
|
|
808
|
+
}
|
|
809
|
+
if (y && typeof p == "object" && typeof p.getAttributeType == "function" && !o) switch (p.getAttributeType(d, c)) {
|
|
810
|
+
case "TrustedHTML":
|
|
811
|
+
u = y.createHTML(u);
|
|
812
|
+
break;
|
|
813
|
+
case "TrustedScriptURL":
|
|
814
|
+
u = y.createScriptURL(u);
|
|
815
|
+
break;
|
|
816
|
+
}
|
|
817
|
+
if (u !== l) try {
|
|
818
|
+
o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), wt(e) ? Z(e) : arrayPop(t.removed);
|
|
819
|
+
} catch {
|
|
820
|
+
Q(a, e);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
$(x.afterSanitizeAttributes, e, null);
|
|
824
|
+
}, At = function e(t) {
|
|
825
|
+
let n = null, r = Ct(t);
|
|
826
|
+
for ($(x.beforeSanitizeShadowDOM, t, null); n = r.nextNode();) $(x.uponSanitizeShadowNode, n, null), Et(n), kt(n), n.content instanceof a && e(n.content);
|
|
827
|
+
$(x.afterSanitizeShadowDOM, t, null);
|
|
828
|
+
};
|
|
829
|
+
return t.sanitize = function(e) {
|
|
830
|
+
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
|
|
831
|
+
if (W = !e, W && (e = "<!-->"), typeof e != "string" && !Tt(e)) if (typeof e.toString == "function") {
|
|
832
|
+
if (e = e.toString(), typeof e != "string") throw typeErrorCreate("dirty is not a string, aborting");
|
|
833
|
+
} else throw typeErrorCreate("toString is not a function");
|
|
834
|
+
if (!t.isSupported) return e;
|
|
835
|
+
if (it || vt(n), t.removed = [], typeof e == "string" && (L = !1), L) {
|
|
836
|
+
if (e.nodeName) {
|
|
837
|
+
let t = Y(e.nodeName);
|
|
838
|
+
if (!C[t] || E[t]) throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
|
|
839
|
+
}
|
|
840
|
+
} else if (e instanceof s) i = St("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === NODE_TYPE.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
|
|
841
|
+
else {
|
|
842
|
+
if (!N && !A && !M && e.indexOf("<") === -1) return y && F ? y.createHTML(e) : e;
|
|
843
|
+
if (i = St(e), !i) return N ? null : F ? b : "";
|
|
844
|
+
}
|
|
845
|
+
i && at && Z(i.firstChild);
|
|
846
|
+
let u = Ct(L ? e : i);
|
|
847
|
+
for (; c = u.nextNode();) Et(c), kt(c), c.content instanceof a && At(c.content);
|
|
848
|
+
if (L) return e;
|
|
849
|
+
if (N) {
|
|
850
|
+
if (P) for (l = He.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
|
|
851
|
+
else l = i;
|
|
852
|
+
return (w.shadowroot || w.shadowrootmode) && (l = We.call(r, l, !0)), l;
|
|
853
|
+
}
|
|
854
|
+
let d = M ? i.outerHTML : i.innerHTML;
|
|
855
|
+
return M && C["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), A && arrayForEach([
|
|
856
|
+
S,
|
|
857
|
+
Ge,
|
|
858
|
+
Ke
|
|
859
|
+
], (e) => {
|
|
860
|
+
d = stringReplace(d, e, " ");
|
|
861
|
+
}), y && F ? y.createHTML(d) : d;
|
|
862
|
+
}, t.setConfig = function() {
|
|
863
|
+
vt(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), it = !0;
|
|
864
|
+
}, t.clearConfig = function() {
|
|
865
|
+
X = null, it = !1;
|
|
866
|
+
}, t.isValidAttribute = function(e, t, n) {
|
|
867
|
+
return X || vt({}), Dt(Y(e), Y(t), n);
|
|
868
|
+
}, t.addHook = function(e, t) {
|
|
869
|
+
typeof t == "function" && arrayPush(x[e], t);
|
|
870
|
+
}, t.removeHook = function(e, t) {
|
|
871
|
+
if (t !== void 0) {
|
|
872
|
+
let n = arrayLastIndexOf(x[e], t);
|
|
873
|
+
return n === -1 ? void 0 : arraySplice(x[e], n, 1)[0];
|
|
874
|
+
}
|
|
875
|
+
return arrayPop(x[e]);
|
|
876
|
+
}, t.removeHooks = function(e) {
|
|
877
|
+
x[e] = [];
|
|
878
|
+
}, t.removeAllHooks = function() {
|
|
879
|
+
x = _createHooksMap();
|
|
880
|
+
}, t;
|
|
881
|
+
}
|
|
882
|
+
var purify = createDOMPurify(), HTMLConfig = { sanitize: (e) => purify.sanitize(e) }, html = (e, ...t) => new HTMLLiteralResult(e.reduce((e, n, r) => {
|
|
883
|
+
let i = t[r] ?? "";
|
|
884
|
+
return typeof i == "string" ? [
|
|
885
|
+
...e,
|
|
886
|
+
n,
|
|
887
|
+
HTMLConfig.sanitize(i)
|
|
888
|
+
] : i === !1 ? [...e, n] : Array.isArray(i) ? [
|
|
889
|
+
...e,
|
|
890
|
+
n,
|
|
891
|
+
...i
|
|
892
|
+
] : [
|
|
893
|
+
...e,
|
|
894
|
+
n,
|
|
895
|
+
i
|
|
896
|
+
];
|
|
897
|
+
}, []));
|
|
898
|
+
function __decorate(e, t, n, r) {
|
|
899
|
+
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
900
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
901
|
+
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
902
|
+
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
903
|
+
}
|
|
904
|
+
var component_default$1 = ":host{--host-display:flex;--host-heading-border:var(--scorad-heading-border,solid 1px currentColor);--host-score-color:var(--scorad-score-color,var(--color));--host-score-background:var(--scorad-score-background,var(--background-color));--host-score-border:var(--scorad-score-border,solid 2px currentColor);gap:var(--host-spacing-unit);flex-wrap:wrap;width:fit-content}scorad-weightings{margin-bottom:var(--host-spacing-unit);align-self:center}section{flex-direction:column;flex:auto;display:flex}h3{border:var(--host-heading-border);width:1.5em;height:1.5em;padding:var(--host-padding-unit);margin:var(--host-spacing-unit);border-radius:50%;justify-content:center;align-items:center;display:inline-flex}scorad-label{flex:100%;font-size:1.2rem}scorad-label>span{padding:var(--host-padding-unit);outline:var(--host-score-border);border-radius:var(--host-border-radius);color:var(--host-score-color);background:var(--host-score-background)}", host_default = "*{box-sizing:border-box}:host{--host-spacing-unit:var(--scorad-spacing-unit,.25rem);--host-padding-unit:var(--scorad-padding-unit,.333rem);--host-border-radius:var(--scorad-border-radius,3px);--host-border-radius-outer:var(--scorad-border-radius-outer,calc(var(--host-border-radius) + var(--host-padding-unit)));display:var(--host-display,inline-flex)}";
|
|
905
|
+
const SCORAD_EXTENT_MAX_VALUE = 100, SCORAD_INTENSITY_MAX_VALUE = 3, SCORAD_SUBJECTIVE_MAX_VALUE = 10, SCORAD_EXTENT_DEFAULT = {
|
|
906
|
+
headNeck: -1,
|
|
907
|
+
anteriorTrunk: -1,
|
|
908
|
+
posteriorTrunk: -1,
|
|
909
|
+
upperLimbs: -1,
|
|
910
|
+
lowerLimbs: -1,
|
|
911
|
+
genitals: -1
|
|
912
|
+
}, SCORAD_INTENSITY_DEFAULT = {
|
|
913
|
+
erythema: -1,
|
|
914
|
+
oedemaPapulation: -1,
|
|
915
|
+
oozingCrusting: -1,
|
|
916
|
+
excoriations: -1,
|
|
917
|
+
lichenification: -1,
|
|
918
|
+
xerosis: -1
|
|
919
|
+
}, SCORAD_SUBJECTIVE_DEFAULT = {
|
|
920
|
+
pruritus: -1,
|
|
921
|
+
sleeplessness: -1
|
|
922
|
+
}, SCORAD_DEFAULT = {
|
|
923
|
+
child: !1,
|
|
924
|
+
extent: SCORAD_EXTENT_DEFAULT,
|
|
925
|
+
intensity: SCORAD_INTENSITY_DEFAULT,
|
|
926
|
+
subjective: SCORAD_SUBJECTIVE_DEFAULT
|
|
927
|
+
}, SCORAD_ADULT_WEIGHTS = {
|
|
928
|
+
headNeck: .09,
|
|
929
|
+
anteriorTrunk: .18,
|
|
930
|
+
posteriorTrunk: .18,
|
|
931
|
+
upperLimbs: .18,
|
|
932
|
+
lowerLimbs: .36,
|
|
933
|
+
genitals: .01
|
|
934
|
+
}, SCORAD_CHILD_WEIGHTS = {
|
|
935
|
+
headNeck: .18,
|
|
936
|
+
anteriorTrunk: .18,
|
|
937
|
+
posteriorTrunk: .18,
|
|
938
|
+
upperLimbs: .18,
|
|
939
|
+
lowerLimbs: .28,
|
|
940
|
+
genitals: 0
|
|
941
|
+
};
|
|
942
|
+
var component_default$6 = ":host{--host-display:inline-flex;--host-font-size:1rem;justify-content:center;align-items:center;gap:var(--host-spacing-unit);flex-wrap:wrap;position:relative}label{padding:var(--host-padding-unit)}svg{width:calc(50% - var(--host-spacing-unit));padding:var(--host-spacing-unit)0;fill:#0000;stroke:currentColor;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;flex:auto;overflow:visible}path,line{vector-effect:non-scaling-stroke}path{opacity:.333}text,line{opacity:.667}g{outline:none}g[tabindex] path{opacity:1;fill:hsla(var(--scorad-h,0),var(--extent,\"0%\"),50%,var(--opacity,0))}:is(:not(:has(:active)) g[tabindex]:hover path,:not(:has(:active)) g[tabindex]:hover line){stroke-width:2px;stroke:var(--primary-color);stroke-dasharray:2 3.5;opacity:1}g[tabindex]:focus path,g[tabindex]:active path,g[tabindex].selected path,g[tabindex]:focus line,g[tabindex]:active line,g[tabindex].selected line{stroke-width:2px;stroke:var(--primary-color);opacity:1;stroke-dasharray:none!important}g[tabindex] text{fill:currentColor;stroke:none;font-size:var(--host-font-size);text-anchor:end}:is(:not(:has(:active)) g[tabindex]:hover text,g[tabindex]:focus text,g[tabindex]:active text,g[tabindex].selected text){fill:var(--primary-color);opacity:1}", tag$6 = "scorad-extent", HTMLScoradExtentElement = class extends HTMLComponentElement {
|
|
943
|
+
connectedCallback() {
|
|
944
|
+
this.render();
|
|
945
|
+
}
|
|
946
|
+
child = !1;
|
|
947
|
+
value = SCORAD_EXTENT_DEFAULT;
|
|
948
|
+
score;
|
|
949
|
+
afterRender() {
|
|
950
|
+
if (!this.value) {
|
|
951
|
+
this.value = SCORAD_EXTENT_DEFAULT;
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
if (this.shadowRoot) for (let e of objectKeys(SCORAD_EXTENT_DEFAULT)) {
|
|
955
|
+
let t = (this.value ?? {})[e], n = this.shadowRoot.querySelector(`.${toKebabCase(e)}`);
|
|
956
|
+
if (!n) return;
|
|
957
|
+
n.style.setProperty("--extent", `${t}%`), n.style.setProperty("--opacity", `${(t ?? 0) / 100}`);
|
|
958
|
+
let r = n.querySelector("text");
|
|
959
|
+
if (!r) return;
|
|
960
|
+
r.textContent = t >= 0 ? `${t}%` : "--";
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
resizeCallback() {
|
|
964
|
+
if (!this.shadowRoot) return;
|
|
965
|
+
let e = this.shadowRoot.querySelector("svg");
|
|
966
|
+
if (!e) return;
|
|
967
|
+
let t = Math.round(18e3 / e.clientWidth) / 100;
|
|
968
|
+
this.style.setProperty("--host-font-size", `${t}rem`);
|
|
969
|
+
}
|
|
970
|
+
render() {
|
|
971
|
+
let e = (e) => {
|
|
972
|
+
let t = (t) => {
|
|
973
|
+
let n = Math.round(Math.min(100, Math.max(0, t)));
|
|
974
|
+
this.value = {
|
|
975
|
+
...this.value,
|
|
976
|
+
[e]: n
|
|
977
|
+
}, this.valueInput(this.value);
|
|
978
|
+
};
|
|
979
|
+
return (n) => {
|
|
980
|
+
if (!n) return;
|
|
981
|
+
"ontouchstart" in window && n.addEventListener("touchstart", (e) => {
|
|
982
|
+
e.preventDefault();
|
|
983
|
+
}, { passive: !1 }), n.style.touchAction = "none", n.addEventListener("pointerdown", (r) => {
|
|
984
|
+
r.preventDefault(), r.stopPropagation(), n.focus();
|
|
985
|
+
let i = this.value[e], a = r.clientY, o = (e) => {
|
|
986
|
+
e.preventDefault();
|
|
987
|
+
let n = a - e.clientY;
|
|
988
|
+
t(Math.round((i + n) / 5) * 5);
|
|
989
|
+
}, s = () => {
|
|
990
|
+
document.removeEventListener("pointermove", o), document.removeEventListener("pointerup", s), document.removeEventListener("pointercancel", s);
|
|
991
|
+
};
|
|
992
|
+
document.addEventListener("pointermove", o), document.addEventListener("pointerup", s), document.addEventListener("pointercancel", s);
|
|
993
|
+
});
|
|
994
|
+
let r, i;
|
|
995
|
+
n.addEventListener("focus", () => {
|
|
996
|
+
i = "000", r = this.value[e];
|
|
997
|
+
}), n.addEventListener("keydown", (n) => {
|
|
998
|
+
let a = this.value[e], o = n.shiftKey ? 5 : 1;
|
|
999
|
+
switch (n.key) {
|
|
1000
|
+
case "0":
|
|
1001
|
+
case "1":
|
|
1002
|
+
case "2":
|
|
1003
|
+
case "3":
|
|
1004
|
+
case "4":
|
|
1005
|
+
case "5":
|
|
1006
|
+
case "6":
|
|
1007
|
+
case "7":
|
|
1008
|
+
case "8":
|
|
1009
|
+
case "9":
|
|
1010
|
+
t(Number.parseInt(i.substring(1) + n.key)), i = padNumber(this.value[e], 3);
|
|
1011
|
+
break;
|
|
1012
|
+
case "ArrowLeft":
|
|
1013
|
+
case "ArrowDown":
|
|
1014
|
+
n.preventDefault(), t(a - o);
|
|
1015
|
+
break;
|
|
1016
|
+
case "ArrowUp":
|
|
1017
|
+
case "ArrowRight":
|
|
1018
|
+
n.preventDefault(), t(a + o);
|
|
1019
|
+
break;
|
|
1020
|
+
case "Escape":
|
|
1021
|
+
n.preventDefault(), t(r);
|
|
1022
|
+
break;
|
|
1023
|
+
}
|
|
1024
|
+
});
|
|
1025
|
+
};
|
|
1026
|
+
}, t = (e) => (t) => {
|
|
1027
|
+
t && (t.textContent = `${this.value[e]}%`);
|
|
1028
|
+
};
|
|
1029
|
+
return html`
|
|
1030
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 164 240" width="200">
|
|
1031
|
+
<g ${e("headNeck")}
|
|
1032
|
+
class="head-neck" tabindex="0">
|
|
1033
|
+
<text x="40" y="20" ${t("headNeck")}>--</text>
|
|
1034
|
+
<line x1="45" y1="16" x2="68" y2="17"></line>
|
|
1035
|
+
<path d="M100,45 100,49 Q95,48 90,49 L90,45 A20,22.5 1,1,1 100,45Z"></path>
|
|
1036
|
+
</g>
|
|
1037
|
+
${this.child ? html`
|
|
1038
|
+
<g ${e("anteriorTrunk")}
|
|
1039
|
+
class="anterior-trunk" tabindex="0">
|
|
1040
|
+
<text x="40" y="50" ${t("anteriorTrunk")}>--</text>
|
|
1041
|
+
<line x1="45" y1="46" x2="77" y2="52"></line>
|
|
1042
|
+
<path d="M80,58 Q95,52 110,58 L120,130 95,149 70,130 L80,60Z"></path>
|
|
1043
|
+
</g>
|
|
1044
|
+
` : html`
|
|
1045
|
+
<g ${e("anteriorTrunk")}
|
|
1046
|
+
class="anterior-trunk" tabindex="0">
|
|
1047
|
+
<text x="40" y="50" ${t("anteriorTrunk")}>--</text>
|
|
1048
|
+
<line x1="45" y1="46" x2="75" y2="52"></line>
|
|
1049
|
+
<path d="M80,58 Q95,52 110,58 L120,130 Q95,117 70,130 L80,60Z"></path>
|
|
1050
|
+
</g>
|
|
1051
|
+
`}
|
|
1052
|
+
<g ${e("upperLimbs")}
|
|
1053
|
+
class="upper-limbs" tabindex="0">
|
|
1054
|
+
<text x="40" y="80" ${t("upperLimbs")}>--</text>
|
|
1055
|
+
<line x1="45" y1="76" x2="50" y2="78"></line>
|
|
1056
|
+
<path d="M74,61 70,85 40,135 A1,1 0,0,1 25,130Z"></path>
|
|
1057
|
+
<path d="M116,61 120,85 150,135 A1,1 0,0,0 165,130Z"></path>
|
|
1058
|
+
</g>
|
|
1059
|
+
${this.child ? "" : html`
|
|
1060
|
+
<g ${e("genitals")}
|
|
1061
|
+
class="genitals" tabindex="0">
|
|
1062
|
+
<text x="40" y="170" ${t("genitals")}>--</text>
|
|
1063
|
+
<line x1="45" y1="164" x2="63" y2="138"></line>
|
|
1064
|
+
<path d="M76,135 Q95,126 114,135 L95,149Z"></path>
|
|
1065
|
+
</g>
|
|
1066
|
+
`}
|
|
1067
|
+
<g ${e("lowerLimbs")}
|
|
1068
|
+
class="lower-limbs" tabindex="">
|
|
1069
|
+
<text x="40" y="200" ${t("lowerLimbs")}>--</text>
|
|
1070
|
+
<line x1="45" y1="195" x2="63" y2="195"></line>
|
|
1071
|
+
<path d="M70,139 90,154 90,230 A1,1 0,0,1 70,230Z"></path>
|
|
1072
|
+
<path d="M120,139 100,154 100,230 A1,1 0,0,0 120,230Z"></path>
|
|
1073
|
+
</g>
|
|
1074
|
+
</svg>
|
|
1075
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 164 240" width="200">
|
|
1076
|
+
<g class="head-neck">
|
|
1077
|
+
<path d="M100,45 100,49 Q95,48 90,49 L90,45 A20,22.5 1,1,1 100,45Z"></path>
|
|
1078
|
+
</g>
|
|
1079
|
+
<g class="upper-limbs">
|
|
1080
|
+
<path d="M74,61 70,85 40,135 A1,1 0,0,1 25,130Z"></path>
|
|
1081
|
+
<path d="M116,61 120,85 150,135 A1,1 0,0,0 165,130Z"></path>
|
|
1082
|
+
</g>
|
|
1083
|
+
<g ${e("posteriorTrunk")}
|
|
1084
|
+
class="posterior-trunk" tabindex="0">
|
|
1085
|
+
<text x="40" y="50" ${t("posteriorTrunk")}>--</text>
|
|
1086
|
+
<line x1="45" y1="46" x2="75" y2="52"></line>
|
|
1087
|
+
<path d="M80,58 Q95,52 110,58 L120,130 Q110,152 95,142 L95,142 Q80,152 70,130 L80,60Z"></path>
|
|
1088
|
+
</g>
|
|
1089
|
+
<g class="lower-limbs">
|
|
1090
|
+
<path d="M70,142 Q80,155 90,151 L90,230 A1,1 0,0,1 70,230Z"></path>
|
|
1091
|
+
<path d="M120,142 Q110,155 100,151 L100,230 A1,1 0,0,0 120,230Z"></path>
|
|
1092
|
+
</g>
|
|
1093
|
+
</svg>
|
|
1094
|
+
`;
|
|
1095
|
+
}
|
|
1096
|
+
valueInput;
|
|
1097
|
+
valueChange;
|
|
1098
|
+
};
|
|
1099
|
+
__decorate([Att(AttBoolean)], HTMLScoradExtentElement.prototype, "child", void 0), __decorate([Watch("value")], HTMLScoradExtentElement.prototype, "afterRender", null), __decorate([Watch("child")], HTMLScoradExtentElement.prototype, "render", null), __decorate([Event()], HTMLScoradExtentElement.prototype, "valueInput", void 0), __decorate([Event()], HTMLScoradExtentElement.prototype, "valueChange", void 0), HTMLScoradExtentElement = __decorate([Component({
|
|
1100
|
+
tag: tag$6,
|
|
1101
|
+
css: [host_default, component_default$6],
|
|
1102
|
+
delegatesFocus: !0
|
|
1103
|
+
})], HTMLScoradExtentElement);
|
|
1104
|
+
var component_default$4 = ":host{--host-display:inline-flex;flex-direction:column;position:relative}scorad-options{margin-left:auto}";
|
|
1105
|
+
const ScoradResources = {
|
|
1106
|
+
child: {
|
|
1107
|
+
text: "child",
|
|
1108
|
+
description: "use weightings for a child"
|
|
1109
|
+
},
|
|
1110
|
+
extent: {
|
|
1111
|
+
headNeck: {
|
|
1112
|
+
text: "Head/Neck",
|
|
1113
|
+
description: "percentage of the head and neck area affected"
|
|
1114
|
+
},
|
|
1115
|
+
anteriorTrunk: {
|
|
1116
|
+
text: "Anterior Trunk",
|
|
1117
|
+
description: "percentage of the front torso area affected"
|
|
1118
|
+
},
|
|
1119
|
+
posteriorTrunk: {
|
|
1120
|
+
text: "Posterior Trunk",
|
|
1121
|
+
description: "percentage of the back torso area affected"
|
|
1122
|
+
},
|
|
1123
|
+
genitals: {
|
|
1124
|
+
text: "Genitals",
|
|
1125
|
+
description: "percentage of the genital area affected"
|
|
1126
|
+
},
|
|
1127
|
+
upperLimbs: {
|
|
1128
|
+
text: "Upper Limbs",
|
|
1129
|
+
description: "percentage of the arms and shoulders affected"
|
|
1130
|
+
},
|
|
1131
|
+
lowerLimbs: {
|
|
1132
|
+
text: "Lower Limbs",
|
|
1133
|
+
description: "percentage of the legs and hips affected"
|
|
1134
|
+
}
|
|
1135
|
+
},
|
|
1136
|
+
intensity: {
|
|
1137
|
+
erythema: {
|
|
1138
|
+
text: "Erythema",
|
|
1139
|
+
description: "redness of the skin"
|
|
1140
|
+
},
|
|
1141
|
+
oedemaPapulation: {
|
|
1142
|
+
text: "Oedema/Papulation",
|
|
1143
|
+
description: "swelling and small, raised bumps"
|
|
1144
|
+
},
|
|
1145
|
+
oozingCrusting: {
|
|
1146
|
+
text: "Oozing/Crusting",
|
|
1147
|
+
description: "fluid leakage and dried scabs"
|
|
1148
|
+
},
|
|
1149
|
+
excoriations: {
|
|
1150
|
+
text: "Excoriations",
|
|
1151
|
+
description: "scratch marks"
|
|
1152
|
+
},
|
|
1153
|
+
lichenification: {
|
|
1154
|
+
text: "Lichenification",
|
|
1155
|
+
description: "skin thickening and hardening"
|
|
1156
|
+
},
|
|
1157
|
+
xerosis: {
|
|
1158
|
+
text: "Xerosis",
|
|
1159
|
+
description: "dryness of the skin"
|
|
1160
|
+
}
|
|
1161
|
+
},
|
|
1162
|
+
subjective: {
|
|
1163
|
+
pruritus: {
|
|
1164
|
+
text: "Pruritus",
|
|
1165
|
+
description: "itching"
|
|
1166
|
+
},
|
|
1167
|
+
sleeplessness: {
|
|
1168
|
+
text: "Sleeplessness",
|
|
1169
|
+
description: "difficulty sleeping"
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
};
|
|
1173
|
+
var component_default$5 = ":host{--host-display:inline-flex;--host-option-width:var(--scorad-option-width,1.5em);--host-option-height:var(--scorad-option-height,1.5em);--host-option-border:var(--scorad-option-border,solid 1px var(--color));--host-option-border-selected:var(--scorad-option-border-selected,solid 2px var(--color));--host-option-color:var(--scorad-option-color,var(--color));--host-option-background:var(--scorad-option-background,transparent);--host-option-color-selected:var(--scorad-option-color-selected,var(--background-color));--host-option-background-selected:var(--scorad-option-background-selected,var(--color));gap:var(--host-spacing-unit);padding:calc(1.5*var(--host-padding-unit))0;outline:none;width:max-content;position:relative}span{height:var(--host-option-height);width:var(--host-option-width);outline:var(--host-option-border);border-radius:var(--host-border-radius);padding:calc(.5*var(--host-padding-unit))var(--host-padding-unit);color:var(--host-option-color);background:var(--host-option-background);cursor:pointer;touch-action:none}span:before{content:\"\";touch-action:none;pointer-events:none}span[aria-selected=true]{outline:var(--host-option-border-selected);color:var(--host-option-color-selected);background:var(--host-option-background-selected)}", tag$5 = "scorad-options", HTMLScoradOptionsElement = class extends HTMLComponentElement {
|
|
1174
|
+
connectedCallback() {
|
|
1175
|
+
this.render(), this.addEventListener("focusin", this._handleFocusIn, { once: !0 }), this.addEventListener("pointerdown", this._handleDown);
|
|
1176
|
+
}
|
|
1177
|
+
disconnectedCallback() {
|
|
1178
|
+
this.addEventListener("pointerdown", this._handleDown);
|
|
1179
|
+
}
|
|
1180
|
+
_handleFocusIn = () => {
|
|
1181
|
+
this.readonly || (this.committedValue = this.value, this.addEventListener("focusout", this._handleFocusOut, { once: !0 }), this.addEventListener("keydown", this._handleKeydown));
|
|
1182
|
+
};
|
|
1183
|
+
_handleFocusOut = () => {
|
|
1184
|
+
this.removeEventListener("keydown", this._handleKeydown), this.addEventListener("focusin", this._handleFocusIn, { once: !0 }), this.setValue(this.value), this.value !== this.committedValue && this.valueChange(this.value);
|
|
1185
|
+
};
|
|
1186
|
+
_handleDown = (e) => {
|
|
1187
|
+
this.readonly || (e.stopPropagation(), e.preventDefault(), this.focus(), this._handleMove(e), document.addEventListener("pointerup", this._handleUp), document.addEventListener("pointermove", this._handleMove));
|
|
1188
|
+
};
|
|
1189
|
+
_handleUp = (e) => {
|
|
1190
|
+
e.stopPropagation(), document.removeEventListener("pointerup", this._handleUp), document.removeEventListener("pointermove", this._handleMove);
|
|
1191
|
+
};
|
|
1192
|
+
_handleMove = (e) => {
|
|
1193
|
+
let t = e.composedPath()[0];
|
|
1194
|
+
if (!(t instanceof HTMLSpanElement)) return;
|
|
1195
|
+
let n = Number.parseInt(t.dataset.value);
|
|
1196
|
+
this.setValue(n);
|
|
1197
|
+
};
|
|
1198
|
+
_handleKeydown = (e) => {
|
|
1199
|
+
let t = this.value ?? 0;
|
|
1200
|
+
switch (e.key) {
|
|
1201
|
+
case "ArrowLeft":
|
|
1202
|
+
case "ArrowDown":
|
|
1203
|
+
e.preventDefault(), this.setValue(t - 1);
|
|
1204
|
+
break;
|
|
1205
|
+
case "ArrowUp":
|
|
1206
|
+
case "ArrowRight":
|
|
1207
|
+
e.preventDefault(), this.setValue(t + 1);
|
|
1208
|
+
break;
|
|
1209
|
+
case "Escape":
|
|
1210
|
+
e.preventDefault(), this.setValue(this.committedValue);
|
|
1211
|
+
break;
|
|
1212
|
+
}
|
|
1213
|
+
};
|
|
1214
|
+
min = 0;
|
|
1215
|
+
max = 5;
|
|
1216
|
+
showHue = !1;
|
|
1217
|
+
committedValue = 0;
|
|
1218
|
+
value = 0;
|
|
1219
|
+
setValue = (e) => {
|
|
1220
|
+
this.value = Math.max(this.min, Math.min(this.max, e)), this.valueInput(this.value);
|
|
1221
|
+
};
|
|
1222
|
+
readonly = !1;
|
|
1223
|
+
text = [];
|
|
1224
|
+
render() {
|
|
1225
|
+
return html`
|
|
1226
|
+
${Array.from({ length: this.max - this.min + 1 }, (e, t) => this.min + t).map((e) => html`
|
|
1227
|
+
<span data-value="${e}">${this.text[e]}</span>
|
|
1228
|
+
`)}
|
|
1229
|
+
`;
|
|
1230
|
+
}
|
|
1231
|
+
afterRender() {
|
|
1232
|
+
this.shadowRoot && this.shadowRoot.querySelectorAll("span").forEach((e) => {
|
|
1233
|
+
let t = Number.parseInt(e.dataset.value);
|
|
1234
|
+
if (e.ariaSelected = t === this.value ? "true" : "false", !this.showHue) return;
|
|
1235
|
+
if (t > this.value) {
|
|
1236
|
+
e.style.backgroundColor = "";
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
let n = Math.round(100 * t / (this.max - this.min));
|
|
1240
|
+
e.style.backgroundColor = `hsl(var(--scorad-h, 0), ${n}%, 50%, ${n}%)`;
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
valueInput;
|
|
1244
|
+
valueChange;
|
|
1245
|
+
};
|
|
1246
|
+
__decorate([Att({
|
|
1247
|
+
read: Number,
|
|
1248
|
+
write: !1
|
|
1249
|
+
})], HTMLScoradOptionsElement.prototype, "min", void 0), __decorate([Att({
|
|
1250
|
+
read: Number,
|
|
1251
|
+
write: !1
|
|
1252
|
+
})], HTMLScoradOptionsElement.prototype, "max", void 0), __decorate([Att(AttBoolean)], HTMLScoradOptionsElement.prototype, "showHue", void 0), __decorate([Att({
|
|
1253
|
+
name: "aria-readonly",
|
|
1254
|
+
...AttTrueFalse
|
|
1255
|
+
})], HTMLScoradOptionsElement.prototype, "readonly", void 0), __decorate([Att({ write: !1 })], HTMLScoradOptionsElement.prototype, "text", void 0), __decorate([Watch("min", "max", "text")], HTMLScoradOptionsElement.prototype, "render", null), __decorate([Watch("value")], HTMLScoradOptionsElement.prototype, "afterRender", null), __decorate([Event()], HTMLScoradOptionsElement.prototype, "valueInput", void 0), __decorate([Event()], HTMLScoradOptionsElement.prototype, "valueChange", void 0), HTMLScoradOptionsElement = __decorate([Component({
|
|
1256
|
+
tag: tag$5,
|
|
1257
|
+
css: [host_default, component_default$5]
|
|
1258
|
+
})], HTMLScoradOptionsElement);
|
|
1259
|
+
var tag$4 = "scorad-intensity", HTMLScoradIntensityElement = class extends HTMLComponentElement {
|
|
1260
|
+
connectedCallback() {
|
|
1261
|
+
this.render();
|
|
1262
|
+
}
|
|
1263
|
+
value = SCORAD_INTENSITY_DEFAULT;
|
|
1264
|
+
score;
|
|
1265
|
+
afterRender() {
|
|
1266
|
+
if (this.value == null) {
|
|
1267
|
+
this.value = SCORAD_INTENSITY_DEFAULT;
|
|
1268
|
+
return;
|
|
1269
|
+
}
|
|
1270
|
+
if (this.shadowRoot) for (let [e, t] of Object.entries(this.value)) {
|
|
1271
|
+
let n = this.shadowRoot.querySelector(`.${toKebabCase(e)}`);
|
|
1272
|
+
if (!n) return;
|
|
1273
|
+
n.dataset.value = `${t}`;
|
|
1274
|
+
let r = n.querySelector("scorad-options");
|
|
1275
|
+
if (!r) return;
|
|
1276
|
+
r.value = t;
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
render() {
|
|
1280
|
+
return html`
|
|
1281
|
+
${objectKeys(this.value).map((e) => this.renderLevel(e))}
|
|
1282
|
+
`;
|
|
1283
|
+
}
|
|
1284
|
+
renderLevel(e) {
|
|
1285
|
+
let t = (t) => {
|
|
1286
|
+
t && t.addEventListener("value-input", (t) => {
|
|
1287
|
+
this.value = {
|
|
1288
|
+
...this.value,
|
|
1289
|
+
[e]: t.detail
|
|
1290
|
+
}, this.valueInput(this.value);
|
|
1291
|
+
});
|
|
1292
|
+
}, n = ScoradResources.intensity[e];
|
|
1293
|
+
return html`
|
|
1294
|
+
<scorad-label class="${toKebabCase(e)} row"
|
|
1295
|
+
text="${n.text}"
|
|
1296
|
+
description="${n.description}">
|
|
1297
|
+
<scorad-options ${t}
|
|
1298
|
+
min="0" max="3" show-hue tabindex="0"
|
|
1299
|
+
></scorad-options>
|
|
1300
|
+
</scorad-label>
|
|
1301
|
+
`;
|
|
1302
|
+
}
|
|
1303
|
+
valueInput;
|
|
1304
|
+
valueChange;
|
|
1305
|
+
};
|
|
1306
|
+
__decorate([Watch("value")], HTMLScoradIntensityElement.prototype, "afterRender", null), __decorate([Event()], HTMLScoradIntensityElement.prototype, "valueInput", void 0), __decorate([Event()], HTMLScoradIntensityElement.prototype, "valueChange", void 0), HTMLScoradIntensityElement = __decorate([Component({
|
|
1307
|
+
tag: tag$4,
|
|
1308
|
+
css: [host_default, component_default$4],
|
|
1309
|
+
delegatesFocus: !0
|
|
1310
|
+
})], HTMLScoradIntensityElement);
|
|
1311
|
+
var component_default$3 = ":host{--host-display:inline-flex;flex-direction:column;position:relative}scorad-options{margin-left:auto}", tag$3 = "scorad-subjective", HTMLScoradSubjectiveElement = class extends HTMLComponentElement {
|
|
1312
|
+
connectedCallback() {
|
|
1313
|
+
this.render();
|
|
1314
|
+
}
|
|
1315
|
+
value = SCORAD_SUBJECTIVE_DEFAULT;
|
|
1316
|
+
score;
|
|
1317
|
+
afterRender() {
|
|
1318
|
+
if (this.value == null) {
|
|
1319
|
+
this.value = SCORAD_SUBJECTIVE_DEFAULT;
|
|
1320
|
+
return;
|
|
1321
|
+
}
|
|
1322
|
+
if (this.shadowRoot) for (let [e, t] of Object.entries(this.value)) {
|
|
1323
|
+
let n = this.shadowRoot.querySelector(`.${toKebabCase(e)}`);
|
|
1324
|
+
if (!n) return;
|
|
1325
|
+
n.dataset.value = `${t}`;
|
|
1326
|
+
let r = n.querySelector("scorad-options");
|
|
1327
|
+
if (!r) return;
|
|
1328
|
+
r.value = t;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
render() {
|
|
1332
|
+
return html`
|
|
1333
|
+
${objectKeys(this.value).map((e) => this.renderLevel(e))}
|
|
1334
|
+
`;
|
|
1335
|
+
}
|
|
1336
|
+
renderLevel(e) {
|
|
1337
|
+
let t = (t) => {
|
|
1338
|
+
t && t.addEventListener("value-input", (t) => {
|
|
1339
|
+
this.value = {
|
|
1340
|
+
...this.value,
|
|
1341
|
+
[e]: t.detail
|
|
1342
|
+
}, this.valueInput(this.value);
|
|
1343
|
+
});
|
|
1344
|
+
}, n = ScoradResources.subjective[e];
|
|
1345
|
+
return html`
|
|
1346
|
+
<scorad-label class="${toKebabCase(e)} row"
|
|
1347
|
+
text="${n.text}"
|
|
1348
|
+
description="${n.description}">
|
|
1349
|
+
<scorad-options ${t}
|
|
1350
|
+
min="0" max="10" show-hue tabindex="0"></scorad-options>
|
|
1351
|
+
</scorad-label>
|
|
1352
|
+
`;
|
|
1353
|
+
}
|
|
1354
|
+
valueInput;
|
|
1355
|
+
valueChange;
|
|
1356
|
+
};
|
|
1357
|
+
__decorate([Watch("value")], HTMLScoradSubjectiveElement.prototype, "afterRender", null), __decorate([Event()], HTMLScoradSubjectiveElement.prototype, "valueInput", void 0), __decorate([Event()], HTMLScoradSubjectiveElement.prototype, "valueChange", void 0), HTMLScoradSubjectiveElement = __decorate([Component({
|
|
1358
|
+
tag: tag$3,
|
|
1359
|
+
css: [host_default, component_default$3],
|
|
1360
|
+
delegatesFocus: !0
|
|
1361
|
+
})], HTMLScoradSubjectiveElement);
|
|
1362
|
+
var component_default$2 = ":host{--host-display:inline-flex;--host-outline-hover:var(--scorad-weightings-outline-hover,dashed 2px var(--primary-color));--host-outline-focus:var(--scorad-weightings-outline-focus,solid 2px var(--primary-color));padding:0 var(--host-padding-unit);border-radius:var(--host-border-radius);justify-content:center;align-items:baseline;position:relative}:host(:hover){outline:var(--host-outline-hover)}:host(:focus-within){outline:var(--host-outline-focus)}scorad-options{--host-option-width:auto;--host-option-height:auto}", tag$2 = "scorad-weightings", HTMLScoradWeightingsElement = class extends HTMLComponentElement {
|
|
1363
|
+
connectedCallback() {
|
|
1364
|
+
this.render();
|
|
1365
|
+
}
|
|
1366
|
+
value = !1;
|
|
1367
|
+
afterRender() {
|
|
1368
|
+
if (this.value == null) {
|
|
1369
|
+
this.value = !1;
|
|
1370
|
+
return;
|
|
1371
|
+
}
|
|
1372
|
+
if (!this.shadowRoot) return;
|
|
1373
|
+
let e = this.shadowRoot.querySelector("scorad-options");
|
|
1374
|
+
e && (e.value = this.value ? 1 : 0, e.text = ["Adult", "Child"]);
|
|
1375
|
+
}
|
|
1376
|
+
render() {
|
|
1377
|
+
return html`
|
|
1378
|
+
<scorad-options ${(e) => {
|
|
1379
|
+
e.addEventListener("value-input", (e) => {
|
|
1380
|
+
this.value = e.detail === 1, this.valueInput(this.value);
|
|
1381
|
+
});
|
|
1382
|
+
}}
|
|
1383
|
+
min="0" max="1" tabindex="0"
|
|
1384
|
+
></scorad-options>
|
|
1385
|
+
`;
|
|
1386
|
+
}
|
|
1387
|
+
valueInput;
|
|
1388
|
+
valueChange;
|
|
1389
|
+
};
|
|
1390
|
+
__decorate([Watch("value")], HTMLScoradWeightingsElement.prototype, "afterRender", null), __decorate([Event()], HTMLScoradWeightingsElement.prototype, "valueInput", void 0), __decorate([Event()], HTMLScoradWeightingsElement.prototype, "valueChange", void 0), HTMLScoradWeightingsElement = __decorate([Component({
|
|
1391
|
+
tag: tag$2,
|
|
1392
|
+
css: [host_default, component_default$2],
|
|
1393
|
+
delegatesFocus: !0
|
|
1394
|
+
})], HTMLScoradWeightingsElement);
|
|
1395
|
+
const selectScoradWeights = (e) => e?.child ? SCORAD_CHILD_WEIGHTS : SCORAD_ADULT_WEIGHTS, validateScoradData = (e) => {
|
|
1396
|
+
let t = [], n = (e, n, r) => {
|
|
1397
|
+
for (let [i, a] of Object.entries(e)) (a < 0 || a > r) && t.push(validateScoradData.formatError(n, i, r, a));
|
|
1398
|
+
}, r = { ...e?.extent ?? SCORAD_EXTENT_DEFAULT }, i = selectScoradWeights(e);
|
|
1399
|
+
for (let [e, t] of Object.entries(i)) t === 0 && delete r[e];
|
|
1400
|
+
return n(r, "extent", 100), n(e?.intensity ?? SCORAD_INTENSITY_DEFAULT, "intensity", 3), n(e?.subjective ?? SCORAD_SUBJECTIVE_DEFAULT, "subjective", 10), t.length ? Result.Fail(t) : Result.Ok(e);
|
|
1401
|
+
};
|
|
1402
|
+
validateScoradData.formatError = (e, t, n, r) => `${e}.${t}: must be between 0 and ${n}, but received ${r}.`;
|
|
1403
|
+
const getScoradScore = (e) => {
|
|
1404
|
+
let t = validateScoradData(e);
|
|
1405
|
+
if (t instanceof Failure) return t;
|
|
1406
|
+
e = t.value;
|
|
1407
|
+
let n = selectScoradWeights(e), r = Object.entries(e.extent).reduce((e, [t, r]) => e + r * n[t], 0), i = Object.values(e.intensity).reduce((e, t) => e + t, 0), a = e.subjective.pruritus + e.subjective.sleeplessness, o = Math.round((r / 5 + 7 * i / 2 + a) * 100) / 100;
|
|
1408
|
+
return Result.Ok({
|
|
1409
|
+
A: r,
|
|
1410
|
+
B: i,
|
|
1411
|
+
C: a,
|
|
1412
|
+
total: o
|
|
1413
|
+
});
|
|
1414
|
+
};
|
|
1415
|
+
var tag$1 = "scorad-component", HTMLScoradElement = class extends HTMLComponentElement {
|
|
1416
|
+
connectedCallback() {
|
|
1417
|
+
this.render();
|
|
1418
|
+
}
|
|
1419
|
+
value = SCORAD_DEFAULT;
|
|
1420
|
+
afterRender() {
|
|
1421
|
+
if (this.value == null) {
|
|
1422
|
+
this.value = SCORAD_DEFAULT;
|
|
1423
|
+
return;
|
|
1424
|
+
}
|
|
1425
|
+
if (!this.shadowRoot) return;
|
|
1426
|
+
let e = this.shadowRoot.querySelector("#score");
|
|
1427
|
+
if (!e) return;
|
|
1428
|
+
let t = getScoradScore(this.value).orNull();
|
|
1429
|
+
e.innerText = `${t?.total ?? "--.--"}`;
|
|
1430
|
+
let n = this.shadowRoot.querySelector("scorad-extent");
|
|
1431
|
+
n && (n.child = this.value?.child ?? !1, n.value = this.value?.extent ?? SCORAD_EXTENT_DEFAULT, n.score = t?.A);
|
|
1432
|
+
let r = this.shadowRoot.querySelector("scorad-weightings");
|
|
1433
|
+
r && (r.value = this.value?.child ?? !1);
|
|
1434
|
+
let i = this.shadowRoot.querySelector("scorad-intensity");
|
|
1435
|
+
i && (i.value = this.value?.intensity ?? SCORAD_INTENSITY_DEFAULT, i.score = t?.B);
|
|
1436
|
+
let a = this.shadowRoot.querySelector("scorad-subjective");
|
|
1437
|
+
a && (a.value = this.value?.subjective ?? SCORAD_SUBJECTIVE_DEFAULT, a.score = t?.B);
|
|
1438
|
+
}
|
|
1439
|
+
render() {
|
|
1440
|
+
return html`
|
|
1441
|
+
<section>
|
|
1442
|
+
<h3>A</h3>
|
|
1443
|
+
<scorad-weightings ${(e) => {
|
|
1444
|
+
e instanceof HTMLScoradWeightingsElement && e.addEventListener("value-input", (e) => {
|
|
1445
|
+
this.value = {
|
|
1446
|
+
...this.value,
|
|
1447
|
+
child: e.detail
|
|
1448
|
+
};
|
|
1449
|
+
});
|
|
1450
|
+
}}></scorad-weightings>
|
|
1451
|
+
<scorad-extent ${(e) => {
|
|
1452
|
+
e instanceof HTMLScoradExtentElement && e.addEventListener("value-input", (e) => {
|
|
1453
|
+
this.value = {
|
|
1454
|
+
...this.value,
|
|
1455
|
+
extent: e.detail
|
|
1456
|
+
};
|
|
1457
|
+
});
|
|
1458
|
+
}}></scorad-extent>
|
|
1459
|
+
</section>
|
|
1460
|
+
|
|
1461
|
+
<section>
|
|
1462
|
+
<h3>B</h3>
|
|
1463
|
+
<scorad-intensity ${(e) => {
|
|
1464
|
+
e instanceof HTMLScoradIntensityElement && e.addEventListener("value-input", (e) => {
|
|
1465
|
+
this.value = {
|
|
1466
|
+
...this.value,
|
|
1467
|
+
intensity: e.detail
|
|
1468
|
+
};
|
|
1469
|
+
});
|
|
1470
|
+
}}></scorad-intensity>
|
|
1471
|
+
</section>
|
|
1472
|
+
|
|
1473
|
+
<section>
|
|
1474
|
+
<h3>C</h3>
|
|
1475
|
+
<scorad-subjective ${(e) => {
|
|
1476
|
+
e instanceof HTMLScoradSubjectiveElement && e.addEventListener("value-input", (e) => {
|
|
1477
|
+
this.value = {
|
|
1478
|
+
...this.value,
|
|
1479
|
+
subjective: e.detail
|
|
1480
|
+
};
|
|
1481
|
+
});
|
|
1482
|
+
}}></scorad-subjective>
|
|
1483
|
+
</section>
|
|
1484
|
+
|
|
1485
|
+
<scorad-label
|
|
1486
|
+
text="SCORAD"
|
|
1487
|
+
description="(A / 5) + (7 * B / 2) + C"
|
|
1488
|
+
>
|
|
1489
|
+
<span id="score" tabindex="0"></span>
|
|
1490
|
+
</scorad-label>
|
|
1491
|
+
`;
|
|
1492
|
+
}
|
|
1493
|
+
};
|
|
1494
|
+
__decorate([Watch("value")], HTMLScoradElement.prototype, "afterRender", null), HTMLScoradElement = __decorate([Component({
|
|
1495
|
+
tag: tag$1,
|
|
1496
|
+
css: [host_default, component_default$1],
|
|
1497
|
+
delegatesFocus: !0
|
|
1498
|
+
})], HTMLScoradElement);
|
|
1499
|
+
const componentsScoradLogger = provideLogger("@ntix/components-scorad", typeof ANTIX_COMPONENTS_SCORAD_LOG_LEVEL > "u" ? LogLevel.warn : ANTIX_COMPONENTS_SCORAD_LOG_LEVEL);
|
|
1500
|
+
var component_default = ":host{--host-display:inline-flex;--host-options:var(--scorad-label-options,solid 1px currentColor);--host-hover:var(--scorad-label-hover,dashed 2px var(--primary-color));--host-focus:var(--scorad-label-focus,solid 2px var(--primary-color));padding:var(--host-padding-unit);border-radius:var(--host-border-radius-outer);flex-wrap:wrap;align-items:baseline;position:relative}:host(:hover){outline:var(--host-hover)}:host(:focus-within){outline:var(--host-focus)}:host>label>span{transition:all .2s ease-in-out;display:block}:host>label>small{opacity:0;height:0;transition:all .4s ease-in-out;display:block}:host(:hover)>label>span,:host(:focus-within)>label>span{transform:translateY(-.5em)}:host(:hover)>label>small,:host(:focus-within)>label>small{opacity:.667;transform:translateY(-.6em)}:host>label{padding:var(--host-padding-unit);flex:1;padding-left:0}", tag = "scorad-label", HTMLScoradLabelElement = class extends HTMLComponentElement {
|
|
1501
|
+
connectedCallback() {
|
|
1502
|
+
this.render(), this.addEventListener("mousedown", this._handleClick);
|
|
1503
|
+
}
|
|
1504
|
+
_handleClick = (e) => {
|
|
1505
|
+
this.querySelector(FOCUSABLE)?.focus();
|
|
1506
|
+
};
|
|
1507
|
+
text = "(label)";
|
|
1508
|
+
description;
|
|
1509
|
+
render() {
|
|
1510
|
+
return html`
|
|
1511
|
+
<label>
|
|
1512
|
+
<span>${this.text}</span>
|
|
1513
|
+
<small>${this.description}</small>
|
|
1514
|
+
</label>
|
|
1515
|
+
<slot></slot>
|
|
1516
|
+
`;
|
|
1517
|
+
}
|
|
1518
|
+
};
|
|
1519
|
+
__decorate([Att({ write: !1 })], HTMLScoradLabelElement.prototype, "text", void 0), __decorate([Att({ write: !1 })], HTMLScoradLabelElement.prototype, "description", void 0), HTMLScoradLabelElement = __decorate([Component({
|
|
1520
|
+
tag,
|
|
1521
|
+
css: [host_default, component_default]
|
|
1522
|
+
})], HTMLScoradLabelElement);
|
|
1523
|
+
export { HTMLScoradElement, HTMLScoradExtentElement, HTMLScoradIntensityElement, HTMLScoradLabelElement, HTMLScoradOptionsElement, HTMLScoradSubjectiveElement, HTMLScoradWeightingsElement, SCORAD_ADULT_WEIGHTS, SCORAD_CHILD_WEIGHTS, SCORAD_DEFAULT, SCORAD_EXTENT_DEFAULT, SCORAD_EXTENT_MAX_VALUE, SCORAD_INTENSITY_DEFAULT, SCORAD_INTENSITY_MAX_VALUE, SCORAD_SUBJECTIVE_DEFAULT, SCORAD_SUBJECTIVE_MAX_VALUE, ScoradResources, componentsScoradLogger, getScoradScore, selectScoradWeights, validateScoradData };
|